1
0

video: driver: add s_fmt allow checks inside state handler

use state specific checks inside state_handler instead of
relying global msm_vidc_allow_s_fmt function.

Change-Id: I92af08e4cd5d49f763c5a2d381af86eb10a4c061
Signed-off-by: Govindaraj Rajagopal <quic_grajagop@quicinc.com>
Este cometimento está contido em:
Govindaraj Rajagopal
2023-02-16 14:50:07 +05:30
ascendente e044c01ccc
cometimento 373880e521
2 ficheiros modificados com 15 adições e 3 eliminações

Ver ficheiro

@@ -253,9 +253,6 @@ int msm_vidc_s_fmt(void *instance, struct v4l2_format *f)
return -EINVAL;
}
if (!msm_vidc_allow_s_fmt(inst, f->type))
return -EBUSY;
if (inst->domain == MSM_VIDC_DECODER)
rc = msm_vdec_s_fmt(inst, f);
if (inst->domain == MSM_VIDC_ENCODER)

Ver ficheiro

@@ -648,6 +648,7 @@ static int msm_vidc_open_state(struct msm_vidc_inst *inst,
{
struct v4l2_format *f = (struct v4l2_format *)data;
/* allow s_fmt request in open state */
rc = msm_vidc_s_fmt(inst, f);
if (rc)
return rc;
@@ -771,6 +772,13 @@ static int msm_vidc_input_streaming_state(struct msm_vidc_inst *inst,
{
struct v4l2_format *f = (struct v4l2_format *)data;
/* disallow */
if (f->type == INPUT_MPLANE || f->type == INPUT_META_PLANE) {
i_vpr_e(inst, "%s: (%s) not allowed for (%s) port\n",
__func__, event_name(event), v4l2_type_name(f->type));
return -EBUSY;
}
rc = msm_vidc_s_fmt(inst, f);
if (rc)
return rc;
@@ -921,6 +929,13 @@ static int msm_vidc_output_streaming_state(struct msm_vidc_inst *inst,
{
struct v4l2_format *f = (struct v4l2_format *)data;
/* disallow */
if (f->type == OUTPUT_MPLANE || f->type == OUTPUT_META_PLANE) {
i_vpr_e(inst, "%s: (%s) not allowed for (%s) port\n",
__func__, event_name(event), v4l2_type_name(f->type));
return -EBUSY;
}
rc = msm_vidc_s_fmt(inst, f);
if (rc)
return rc;