video: driver: Add support dynamic low latency for decoder

Latency property is set to firmware during streamon output port,
if set as part of initial configuration by client.
During runtime, the property is set as and when configured by
client.

1. Make the latency property dynamic for decoder.
2. For encoder, the same gets set to firmware with regular
   v4l2 set properties.
3. For decoder, set the property explicitly during streamon
   output port.

Change-Id: I35990614b95e57f113ddacfc2272cad6ae0dde82
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
This commit is contained in:
Vikash Garodia
2021-04-27 19:34:18 +05:30
parent af0c91ca4c
commit 75ecec1bb5
6 changed files with 49 additions and 66 deletions

View File

@@ -3113,3 +3113,33 @@ set_default:
capability->cap[cap_id].v4l2_id, *value);
return 0;
}
int msm_vidc_set_stage(void *instance,
enum msm_vidc_inst_capability_type cap_id)
{
int rc = 0;
u32 stage = 0;
struct msm_vidc_core *core;
struct msm_vidc_inst *inst = (struct msm_vidc_inst *)instance;
if (!inst || !inst->capabilities || !inst->core) {
d_vpr_e("%s: invalid params\n", __func__);
return -EINVAL;
}
core = inst->core;
rc = call_session_op(core, decide_work_mode, inst);
if (rc) {
i_vpr_e(inst, "%s: decide_work_mode failed\n", __func__);
return -EINVAL;
}
stage = inst->capabilities->cap[STAGE].value;
rc = msm_vidc_packetize_control(inst, cap_id, HFI_PAYLOAD_U32,
&stage, sizeof(u32), __func__);
if (rc)
return rc;
return rc;
}