소스 검색

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 <[email protected]>
Darshana Patil 3 년 전
부모
커밋
0602d95bd9
2개의 변경된 파일2개의 추가작업 그리고 13개의 파일을 삭제
  1. 0 11
      driver/vidc/src/msm_vidc_control.c
  2. 2 2
      driver/vidc/src/msm_vidc_vb2.c

+ 0 - 11
driver/vidc/src/msm_vidc_control.c

@@ -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;

+ 2 - 2
driver/vidc/src/msm_vidc_vb2.c

@@ -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;
 		}