Selaa lähdekoodia

video: driver: add proper handling of VIDIOC_ENUM_FRAMESIZES

VIDIOC_ENUM_FRAMESIZES was not handled for OUTPUT_MPLANE.

Fixes: v4l2-compliance: testFrameSize(VIDIOC_ENUM_FRAMESIZES)
       on encoder.

Change-Id: I9031e018c13ebae94e516be1b5558d30c68b2862
Signed-off-by: Dikshita Agarwal <[email protected]>
Dikshita Agarwal 4 vuotta sitten
vanhempi
sitoutus
44f4a9fab3
1 muutettua tiedostoa jossa 8 lisäystä ja 4 poistoa
  1. 8 4
      driver/vidc/src/msm_vidc.c

+ 8 - 4
driver/vidc/src/msm_vidc.c

@@ -609,6 +609,7 @@ int msm_vidc_enum_framesizes(void *instance, struct v4l2_frmsizeenum *fsize)
 	struct msm_vidc_inst *inst = instance;
 	struct msm_vidc_inst *inst = instance;
 	struct msm_vidc_inst_capability *capability;
 	struct msm_vidc_inst_capability *capability;
 	enum msm_vidc_colorformat_type colorfmt;
 	enum msm_vidc_colorformat_type colorfmt;
+	enum msm_vidc_codec_type codec;
 
 
 	if (!inst || !fsize) {
 	if (!inst || !fsize) {
 		d_vpr_e("%s: invalid params: %pK %pK\n",
 		d_vpr_e("%s: invalid params: %pK %pK\n",
@@ -626,10 +627,13 @@ int msm_vidc_enum_framesizes(void *instance, struct v4l2_frmsizeenum *fsize)
 		return -EINVAL;
 		return -EINVAL;
 
 
 	/* validate pixel format */
 	/* validate pixel format */
-	colorfmt = v4l2_colorformat_to_driver(fsize->pixel_format, __func__);
-	if (colorfmt == MSM_VIDC_FMT_NONE) {
-		i_vpr_e(inst, "%s: unsupported pix fmt %#x\n", __func__, fsize->pixel_format);
-		return -EINVAL;
+	codec = v4l2_codec_to_driver(fsize->pixel_format, __func__);
+	if (!codec) {
+		colorfmt = v4l2_colorformat_to_driver(fsize->pixel_format, __func__);
+		if (colorfmt == MSM_VIDC_FMT_NONE) {
+			i_vpr_e(inst, "%s: unsupported pix fmt %#x\n", __func__, fsize->pixel_format);
+			return -EINVAL;
+		}
 	}
 	}
 
 
 	fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
 	fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;