video: driver: optimize thumbnail input buffer count
Update thumbnail input buffer count to 1 after recieving thumbnail enable control. Change-Id: I9341d34d3427c00fd6792f47c947bf4b12966a39 Signed-off-by: Shi Zhongbo <zhongbos@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
19cdce1711
commit
34ed55ecd1
@@ -348,6 +348,7 @@ void inst_unlock(struct msm_vidc_inst *inst, const char *function);
|
|||||||
bool inst_lock_check(struct msm_vidc_inst *inst, const char *function);
|
bool inst_lock_check(struct msm_vidc_inst *inst, const char *function);
|
||||||
int msm_vidc_update_bitstream_buffer_size(struct msm_vidc_inst *inst);
|
int msm_vidc_update_bitstream_buffer_size(struct msm_vidc_inst *inst);
|
||||||
int msm_vidc_update_meta_port_settings(struct msm_vidc_inst *inst);
|
int msm_vidc_update_meta_port_settings(struct msm_vidc_inst *inst);
|
||||||
|
int msm_vidc_update_buffer_count(struct msm_vidc_inst *inst, u32 port);
|
||||||
void msm_vidc_schedule_core_deinit(struct msm_vidc_core *core);
|
void msm_vidc_schedule_core_deinit(struct msm_vidc_core *core);
|
||||||
bool msm_vidc_is_super_buffer(struct msm_vidc_inst *inst);
|
bool msm_vidc_is_super_buffer(struct msm_vidc_inst *inst);
|
||||||
int msm_vidc_init_core_caps(struct msm_vidc_core* core);
|
int msm_vidc_init_core_caps(struct msm_vidc_core* core);
|
||||||
|
@@ -656,13 +656,16 @@ int msm_v4l2_op_s_ctrl(struct v4l2_ctrl *ctrl)
|
|||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctrl->id == V4L2_CID_MPEG_VIDC_PRIORITY) {
|
if (ctrl->id == V4L2_CID_MPEG_VIDC_PRIORITY) {
|
||||||
rc = msm_vidc_adjust_session_priority(inst, ctrl);
|
rc = msm_vidc_adjust_session_priority(inst, ctrl);
|
||||||
if (rc)
|
if (rc)
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
if (ctrl->id == V4L2_CID_MPEG_VIDC_THUMBNAIL_MODE) {
|
||||||
|
rc = msm_vidc_update_buffer_count(inst, INPUT_PORT);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
if (is_meta_ctrl(ctrl->id)) {
|
if (is_meta_ctrl(ctrl->id)) {
|
||||||
if (cap_id == META_DPB_TAG_LIST) {
|
if (cap_id == META_DPB_TAG_LIST) {
|
||||||
/*
|
/*
|
||||||
|
@@ -4056,6 +4056,80 @@ int msm_vidc_update_meta_port_settings(struct msm_vidc_inst *inst)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int msm_vidc_update_buffer_count(struct msm_vidc_inst *inst, u32 port)
|
||||||
|
{
|
||||||
|
struct msm_vidc_core *core;
|
||||||
|
|
||||||
|
if (!inst || !inst->core) {
|
||||||
|
d_vpr_e("%s: invalid params\n", __func__);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
core = inst->core;
|
||||||
|
|
||||||
|
switch (port) {
|
||||||
|
case INPUT_PORT:
|
||||||
|
inst->buffers.input.min_count = call_session_op(core,
|
||||||
|
min_count, inst, MSM_VIDC_BUF_INPUT);
|
||||||
|
inst->buffers.input.extra_count = call_session_op(core,
|
||||||
|
extra_count, inst, MSM_VIDC_BUF_INPUT);
|
||||||
|
if (inst->buffers.input.actual_count <
|
||||||
|
inst->buffers.input.min_count +
|
||||||
|
inst->buffers.input.extra_count) {
|
||||||
|
inst->buffers.input.actual_count =
|
||||||
|
inst->buffers.input.min_count +
|
||||||
|
inst->buffers.input.extra_count;
|
||||||
|
}
|
||||||
|
if (is_input_meta_enabled(inst)) {
|
||||||
|
inst->buffers.input_meta.min_count =
|
||||||
|
inst->buffers.input.min_count;
|
||||||
|
inst->buffers.input_meta.extra_count =
|
||||||
|
inst->buffers.input.extra_count;
|
||||||
|
inst->buffers.input_meta.actual_count =
|
||||||
|
inst->buffers.input.actual_count;
|
||||||
|
} else {
|
||||||
|
inst->buffers.input_meta.min_count = 0;
|
||||||
|
inst->buffers.input_meta.extra_count = 0;
|
||||||
|
inst->buffers.input_meta.actual_count = 0;
|
||||||
|
}
|
||||||
|
d_vpr_h("update input min buffer to %u\n",
|
||||||
|
inst->buffers.input.min_count);
|
||||||
|
break;
|
||||||
|
case OUTPUT_PORT:
|
||||||
|
if (!inst->vb2q[INPUT_PORT].streaming)
|
||||||
|
inst->buffers.output.min_count = call_session_op(core,
|
||||||
|
min_count, inst, MSM_VIDC_BUF_OUTPUT);
|
||||||
|
inst->buffers.output.extra_count = call_session_op(core,
|
||||||
|
extra_count, inst, MSM_VIDC_BUF_OUTPUT);
|
||||||
|
if (inst->buffers.output.actual_count <
|
||||||
|
inst->buffers.output.min_count +
|
||||||
|
inst->buffers.output.extra_count) {
|
||||||
|
inst->buffers.output.actual_count =
|
||||||
|
inst->buffers.output.min_count +
|
||||||
|
inst->buffers.output.extra_count;
|
||||||
|
}
|
||||||
|
if (is_output_meta_enabled(inst)) {
|
||||||
|
inst->buffers.output_meta.min_count =
|
||||||
|
inst->buffers.output.min_count;
|
||||||
|
inst->buffers.output_meta.extra_count =
|
||||||
|
inst->buffers.output.extra_count;
|
||||||
|
inst->buffers.output_meta.actual_count =
|
||||||
|
inst->buffers.output.actual_count;
|
||||||
|
} else {
|
||||||
|
inst->buffers.output_meta.min_count = 0;
|
||||||
|
inst->buffers.output_meta.extra_count = 0;
|
||||||
|
inst->buffers.output_meta.actual_count = 0;
|
||||||
|
}
|
||||||
|
d_vpr_h("update output min buffer to %u\n",
|
||||||
|
inst->buffers.output.min_count);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
d_vpr_e("%s unknown port %d\n", __func__, port);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
void msm_vidc_schedule_core_deinit(struct msm_vidc_core *core)
|
void msm_vidc_schedule_core_deinit(struct msm_vidc_core *core)
|
||||||
{
|
{
|
||||||
if (!core)
|
if (!core)
|
||||||
|
Reference in New Issue
Block a user