Skip to content

Commit

Permalink
Merge "Merge android13-gs-pixel-5.10-tm-qpr1 into android13-gs-pixel-…
Browse files Browse the repository at this point in the history
…5.10-tm-qpr2" into android13-gs-pixel-5.10-tm-qpr2
  • Loading branch information
Robin Peng committed Oct 27, 2022
2 parents f8d219c + 024f8d0 commit 408102b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/media/platform/exynos/mfc/mfc_core_enc_param.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,10 @@ static void __mfc_set_enc_params(struct mfc_core *core, struct mfc_ctx *ctx)
mfc_clear_set_bits(reg, 0x3, 24, 1);
else if (ctx->sbwcl_ratio == 75 || ctx->sbwcl_ratio == 80)
mfc_clear_set_bits(reg, 0x3, 24, 2);
} else {
mfc_clear_set_bits(reg, 0x3, 24, 0);
}

/* GDC-MFC vOTF enable */
mfc_clear_bits(reg, 0x1, 26);
if (ctx->gdc_votf && core->has_gdc_votf && core->has_mfc_votf) {
Expand Down
12 changes: 12 additions & 0 deletions drivers/media/platform/exynos/mfc/mfc_core_isr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,6 +1348,7 @@ static int __mfc_handle_stream(struct mfc_core *core, struct mfc_ctx *ctx, unsig
int slice_type, consumed_only = 0;
unsigned int strm_size;
unsigned int pic_count;
unsigned int sbwc_err;

slice_type = mfc_core_get_enc_slice_type();
strm_size = mfc_core_get_enc_strm_size();
Expand Down Expand Up @@ -1383,6 +1384,17 @@ static int __mfc_handle_stream(struct mfc_core *core, struct mfc_ctx *ctx, unsig
consumed_only = 1;
}

sbwc_err = mfc_core_get_enc_comp_err();
if (sbwc_err) {
mfc_ctx_err("[SBWC] Compressor error detected (Source: %d, DPB: %d)\n",
(sbwc_err >> 1) & 0x1, sbwc_err & 0x1);
mfc_ctx_err("[SBWC] sbwc: %d, lossy: %d(%d), option: %d, FORMAT: %#x, OPTIONS: %#x\n",
ctx->is_sbwc, ctx->is_sbwc_lossy,
ctx->sbwcl_ratio, enc->sbwc_option,
MFC_CORE_READL(MFC_REG_PIXEL_FORMAT),
MFC_CORE_READL(MFC_REG_E_ENC_OPTIONS));
}

/* handle source buffer */
__mfc_handle_stream_input(core, ctx, consumed_only);

Expand Down
15 changes: 14 additions & 1 deletion drivers/media/platform/exynos/mfc/mfc_core_nal_q.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,6 +1496,7 @@ static void __mfc_core_nal_q_handle_stream(struct mfc_core *core, struct mfc_cor
int slice_type, consumed_only = 0;
unsigned int strm_size;
unsigned int pic_count;
unsigned int sbwc_err;

mfc_debug_enter();

Expand All @@ -1515,10 +1516,22 @@ static void __mfc_core_nal_q_handle_stream(struct mfc_core *core, struct mfc_cor
ctx->sequence++;

if (strm_size == 0) {
mfc_debug(2, "[FRAME] dst buffer is not returned\n");
mfc_debug(2, "[NALQ][STREAM] dst buffer is not returned\n");
consumed_only = 1;
}

sbwc_err = ((pOutStr->NalDoneInfo >> MFC_REG_E_NAL_DONE_INFO_COMP_ERR_SHIFT)
& MFC_REG_E_NAL_DONE_INFO_COMP_ERR_MASK);
if (sbwc_err) {
mfc_ctx_err("[NALQ][SBWC] Compressor error detected (Source: %d, DPB: %d)\n",
(sbwc_err >> 1) & 0x1, sbwc_err & 0x1);
mfc_ctx_err("[SBWC] sbwc: %d, lossy: %d(%d), option: %d, FORMAT: %#x, OPTIONS: %#x\n",
ctx->is_sbwc, ctx->is_sbwc_lossy,
ctx->sbwcl_ratio, enc->sbwc_option,
MFC_CORE_READL(MFC_REG_PIXEL_FORMAT),
MFC_CORE_READL(MFC_REG_E_ENC_OPTIONS));
}

/* handle input buffer */
__mfc_core_nal_q_handle_stream_input(core_ctx, pOutStr, consumed_only);

Expand Down
4 changes: 4 additions & 0 deletions drivers/media/platform/exynos/mfc/mfc_core_reg_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@
((MFC_CORE_READL(MFC_REG_E_NAL_DONE_INFO) \
>> MFC_REG_E_NAL_DONE_INFO_IDR_SHIFT) \
& MFC_REG_E_NAL_DONE_INFO_IDR_MASK)
#define mfc_core_get_enc_comp_err() \
((MFC_CORE_READL(MFC_REG_E_NAL_DONE_INFO) \
>> MFC_REG_E_NAL_DONE_INFO_COMP_ERR_SHIFT) \
& MFC_REG_E_NAL_DONE_INFO_COMP_ERR_MASK)
#define mfc_core_get_chroma_format() (MFC_CORE_READL(MFC_REG_D_CHROMA_FORMAT) \
& MFC_REG_D_CHROMA_FORMAT_MASK)
#define mfc_core_get_color_range() ((MFC_CORE_READL(MFC_REG_D_CHROMA_FORMAT) \
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/platform/exynos/mfc/mfc_regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,8 @@
#define MFC_REG_E_SLICE_TYPE_SKIPPED 4

/* 0xFAEC: MFC_REG_E_NAL_DONE_INFO */
#define MFC_REG_E_NAL_DONE_INFO_COMP_ERR_MASK 0x3
#define MFC_REG_E_NAL_DONE_INFO_COMP_ERR_SHIFT 7
#define MFC_REG_E_NAL_DONE_INFO_IDR_MASK 0x1
#define MFC_REG_E_NAL_DONE_INFO_IDR_SHIFT 20

Expand Down

0 comments on commit 408102b

Please sign in to comment.