video: driver: Add support to enable enc ring buffer
Add support to enable ring buffer for enc intermediate bin buffer to improve encoding performance. Change-Id: Ifbf50cb48278c62c09a20bc7626a3b6288813830 Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
This commit is contained in:

committad av
Gerrit - the friendly Code Review server

förälder
fb2e2c5715
incheckning
9a5fea8ef3
@@ -28,6 +28,7 @@ struct msm_vidc_session_ops {
|
||||
int (*buffer_size)(struct msm_vidc_inst *inst, enum msm_vidc_buffer_type type);
|
||||
int (*min_count)(struct msm_vidc_inst *inst, enum msm_vidc_buffer_type type);
|
||||
int (*extra_count)(struct msm_vidc_inst *inst, enum msm_vidc_buffer_type type);
|
||||
int (*ring_buf_count)(struct msm_vidc_inst *inst, u32 data_size);
|
||||
};
|
||||
|
||||
struct msm_vidc_mem_list_info {
|
||||
|
@@ -101,6 +101,7 @@ enum msm_vidc_metadata_bits {
|
||||
#define MAX_ENCODING_REFERNCE_FRAMES 7
|
||||
#define MAX_LTR_FRAME_COUNT_5 5
|
||||
#define MAX_LTR_FRAME_COUNT_2 2
|
||||
#define MAX_ENC_RING_BUF_COUNT 5 /* to be tuned */
|
||||
|
||||
#define DCVS_WINDOW 16
|
||||
#define ENC_FPS_WINDOW 3
|
||||
@@ -288,6 +289,7 @@ enum msm_vidc_metadata_bits {
|
||||
CAP(MB_CYCLES_LP) \
|
||||
CAP(MB_CYCLES_FW) \
|
||||
CAP(MB_CYCLES_FW_VPP) \
|
||||
CAP(ENC_RING_BUFFER_COUNT) \
|
||||
CAP(CLIENT_ID) \
|
||||
CAP(SECURE_MODE) \
|
||||
CAP(FENCE_ID) \
|
||||
|
@@ -456,6 +456,29 @@ static int msm_venc_set_quality_mode(struct msm_vidc_inst *inst)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_venc_set_ring_buffer_count(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_inst_cap *cap;
|
||||
|
||||
if (!inst->capabilities) {
|
||||
i_vpr_e(inst, "%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
cap = &inst->capabilities->cap[ENC_RING_BUFFER_COUNT];
|
||||
|
||||
if (!cap->set)
|
||||
return 0;
|
||||
|
||||
rc = cap->set(inst, ENC_RING_BUFFER_COUNT);
|
||||
if (rc) {
|
||||
i_vpr_e(inst, "%s: set cap failed\n", __func__);
|
||||
return rc;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_venc_set_input_properties(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int i, j, rc = 0;
|
||||
@@ -544,6 +567,10 @@ static int msm_venc_set_internal_properties(struct msm_vidc_inst *inst)
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
rc = msm_venc_set_ring_buffer_count(inst);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1006,6 +1033,10 @@ int msm_venc_streamon_output(struct msm_vidc_inst *inst)
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
rc = msm_venc_set_internal_properties(inst);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
rc = msm_venc_get_output_internal_buffers(inst);
|
||||
if (rc)
|
||||
goto error;
|
||||
@@ -1018,10 +1049,6 @@ int msm_venc_streamon_output(struct msm_vidc_inst *inst)
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
rc = msm_venc_set_internal_properties(inst);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
||||
rc = msm_venc_property_subscription(inst, OUTPUT_PORT);
|
||||
if (rc)
|
||||
goto error;
|
||||
|
Referens i nytt ärende
Block a user