Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fa503aca authored by Praneeth Paladugu's avatar Praneeth Paladugu Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Add sanity check for resolutions



Venus HW supports only YUV420 encode\decode. This means it
can't support odd dimensions in both height and width. Hence
add a check to prevent this setting to HW.

CRs-Fixed: 2124363
Change-Id: I0a680a395b40f3d859487c37d8a10faa51fc4680
Signed-off-by: default avatarPraneeth Paladugu <ppaladug@codeaurora.org>
parent 5dfea24b
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -5245,6 +5245,22 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
		rc = -ENOTSUPP;
	}

	output_height = inst->prop.height[CAPTURE_PORT];
	output_width = inst->prop.width[CAPTURE_PORT];
	input_height = inst->prop.height[OUTPUT_PORT];
	input_width = inst->prop.width[OUTPUT_PORT];

	if (input_width % 2 != 0 || input_height % 2 != 0 ||
			output_width % 2 != 0 || output_height % 2 != 0) {
		dprintk(VIDC_ERR,
			"Height and Width should be even numbers for NV12\n");
		dprintk(VIDC_ERR,
			"Input WxH = (%u)x(%u), Output WxH = (%u)x(%u)\n",
			input_width, input_height,
			output_width, output_height);
		rc = -ENOTSUPP;
	}

	rotation =  msm_comm_g_ctrl_for_id(inst,
					V4L2_CID_ROTATE);