video: driver: createbufs and controls v4l2-compliance fixes

when create_bufs ioctl is called for meta port, v4l2
framework calls queue_setup with num_planes as 1.
fixed the num_planes condition by updating it for only
input and output ports.
removed a condition to check if client has set unsupported
bits for metadata controls.

Change-Id: I0faf2cfc2827af7d3992bda63a04d4203f13c9e1
Signed-off-by: Darshana Patil <quic_darshana@quicinc.com>
This commit is contained in:
Darshana Patil
2022-04-08 15:54:21 -07:00
committed by Gerrit - the friendly Code Review server
vanhempi 6b08ced7fe
commit 0602d95bd9
2 muutettua tiedostoa jossa 2 lisäystä ja 13 poistoa

Näytä tiedosto

@@ -859,9 +859,7 @@ int msm_vidc_ctrl_init(struct msm_vidc_inst *inst)
ctrl_cfg.type = V4L2_CTRL_TYPE_BITMASK;
else
ctrl_cfg.type = V4L2_CTRL_TYPE_INTEGER;
/* allow all metadata modes from v4l2 side */
if (is_meta_cap(idx)) {
ctrl_cfg.max = V4L2_MPEG_VIDC_META_MAX - 1;
/* bitmask is expected to be enabled for meta controls */
if (ctrl_cfg.type != V4L2_CTRL_TYPE_BITMASK) {
i_vpr_e(inst,
@@ -1117,15 +1115,6 @@ static int msm_vidc_update_static_property(struct msm_vidc_inst *inst,
msm_vidc_update_cap_value(inst, LAYER_ENABLE, enable, __func__);
}
if (is_meta_cap(cap_id)) {
/* validate metadata control value against allowed settings */
if ((ctrl->val & inst->capabilities->cap[cap_id].max) != ctrl->val) {
i_vpr_e(inst,
"%s: allowed bits for cap %s is %#x, client set %#x\n",
__func__, cap_name(cap_id),
inst->capabilities->cap[cap_id].max,
ctrl->val);
return -EINVAL;
}
rc = msm_vidc_update_meta_port_settings(inst);
if (rc)
return rc;

Näytä tiedosto

@@ -121,10 +121,10 @@ int msm_vidc_queue_setup(struct vb2_queue *q,
if (port < 0)
return -EINVAL;
if (*num_planes) {
if (*num_planes && (port == INPUT_PORT || port == OUTPUT_PORT)) {
f = &inst->fmts[port];
if (*num_planes != f->fmt.pix_mp.num_planes) {
i_vpr_i(inst, "%s: requested num_planes %d not supported\n",
i_vpr_e(inst, "%s: requested num_planes %d not supported %d\n",
__func__, *num_planes, f->fmt.pix_mp.num_planes);
return -EINVAL;
}