video: driver: Add support for AV1D IBC feature

Add support for AV1D Intra-Block Copy (IBC) feature. This requires a
dedicated internal buffer (HFI_BUFFER_IBC_AV1D), which was previously
part of LINE buffer. A new internal buffer type called
HFI_BUFFER_PARTIAL_DATA is introduced, and this buffer type holds
HFI_BUFFER_IBC_AV1D for AV1D. HFI_BUFFER_PARTIAL_DATA is mapped to
NON_SECURE_PIXEL context bank for non-secure and to SECURE_PIXEL
context bank for secure use case.

Change-Id: If7ae22495f9981f275d54acc342c25ccdfc0c7b9
Signed-off-by: Mihir Ganu <quic_mganu@quicinc.com>
Dieser Commit ist enthalten in:
Mihir Ganu
2022-03-16 15:37:40 -07:00
Ursprung b2d8ec9191
Commit 96358cee7d
12 geänderte Dateien mit 78 neuen und 28 gelöschten Zeilen

Datei anzeigen

@@ -1054,8 +1054,7 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes) \
num_vpp_pipes) \
do \
{ \
HFI_U32 vpssLBSize, ibcBufSize, opbwr1BufSize, \
opbwr8, opbwr10, ibc8, ibc10; \
HFI_U32 vpssLBSize, opbwr1BufSize, opbwr8, opbwr10; \
_size = HFI_ALIGN(SIZE_AV1D_LB_FE_TOP_DATA(frame_width, frame_height), \
VENUS_DMA_ALIGNMENT) + \
HFI_ALIGN(SIZE_AV1D_LB_FE_TOP_CTRL(frame_width, frame_height), \
@@ -1086,13 +1085,14 @@ _yuv_bufcount_min, is_opb, num_vpp_pipes) \
SIZE_VPSS_LB(vpssLBSize, frame_width, frame_height, num_vpp_pipes); \
_size = HFI_ALIGN((_size + vpssLBSize), VENUS_DMA_ALIGNMENT); \
} \
else \
{ \
SIZE_AV1D_IBC_NV12_UBWC(ibc8, frame_width, frame_height); \
SIZE_AV1D_IBC_TP10_UBWC(ibc10, frame_width, frame_height); \
ibcBufSize = MAX(ibc8, ibc10); \
_size = HFI_ALIGN((_size + ibcBufSize), VENUS_DMA_ALIGNMENT); \
} \
} while (0)
#define HFI_BUFFER_IBC_AV1D(_size, frame_width, frame_height) \
do { \
HFI_U32 ibc8, ibc10; \
SIZE_AV1D_IBC_NV12_UBWC(ibc8, frame_width, frame_height); \
SIZE_AV1D_IBC_TP10_UBWC(ibc10, frame_width, frame_height); \
_size = HFI_ALIGN(MAX(ibc8, ibc10), VENUS_DMA_ALIGNMENT); \
} while (0)
#define AV1_CABAC_HDR_RATIO_HD_TOT 2

Datei anzeigen

@@ -165,11 +165,9 @@ static u32 msm_vidc_decoder_line_size_iris3(struct msm_vidc_inst *inst)
is_opb = false;
/*
* assume worst case, since color format is unknown at this
* time. The exception is AV1D, where line buffer size is larger
* in DPB-only mode.
* time.
*/
if (inst->codec != MSM_VIDC_AV1)
is_opb = true;
is_opb = true;
if (inst->decode_vpp_delay.enable)
vpp_delay = inst->decode_vpp_delay.size;
@@ -197,6 +195,28 @@ static u32 msm_vidc_decoder_line_size_iris3(struct msm_vidc_inst *inst)
return size;
}
static u32 msm_vidc_decoder_partial_data_size_iris3(struct msm_vidc_inst *inst)
{
u32 size = 0;
u32 width, height;
struct v4l2_format *f;
if (!inst) {
d_vpr_e("%s: invalid params\n", __func__);
return size;
}
f = &inst->fmts[INPUT_PORT];
width = f->fmt.pix_mp.width;
height = f->fmt.pix_mp.height;
if (inst->codec == MSM_VIDC_AV1)
HFI_BUFFER_IBC_AV1D(size, width, height);
i_vpr_l(inst, "%s: size %d\n", __func__, size);
return size;
}
static u32 msm_vidc_decoder_persist_size_iris3(struct msm_vidc_inst *inst)
{
u32 size = 0;
@@ -543,6 +563,7 @@ int msm_buffer_size_iris3(struct msm_vidc_inst *inst,
{MSM_VIDC_BUF_LINE, msm_vidc_decoder_line_size_iris3 },
{MSM_VIDC_BUF_PERSIST, msm_vidc_decoder_persist_size_iris3 },
{MSM_VIDC_BUF_DPB, msm_vidc_decoder_dpb_size_iris3 },
{MSM_VIDC_BUF_PARTIAL_DATA, msm_vidc_decoder_partial_data_size_iris3 },
};
static const struct msm_vidc_buf_type_handle enc_buf_type_handle[] = {
{MSM_VIDC_BUF_INPUT, msm_vidc_encoder_input_size },
@@ -675,6 +696,7 @@ int msm_buffer_min_count_iris3(struct msm_vidc_inst *inst,
case MSM_VIDC_BUF_PERSIST:
case MSM_VIDC_BUF_ARP:
case MSM_VIDC_BUF_VPSS:
case MSM_VIDC_BUF_PARTIAL_DATA:
count = msm_vidc_internal_buffer_count(inst, buffer_type);
break;
case MSM_VIDC_BUF_DPB: