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

Commit 553044fb authored by Chinmay Sawarkar's avatar Chinmay Sawarkar
Browse files

msm: vidc: Check resolution capability against aligned values



Firmware advertised width and height capability is based on
aligned values. Hence capability needs to be checked against
aligned values to cover all scenarios.

CRs-Fixed: 2125401
Change-Id: Id4dd70f2c39b99ae9401f81acccddd9985dde0f6
Signed-off-by: default avatarChinmay Sawarkar <chinmays@codeaurora.org>
parent 4e64e456
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -5471,15 +5471,15 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
	rotation =  msm_comm_g_ctrl_for_id(inst,
					V4L2_CID_MPEG_VIDC_VIDEO_ROTATION);

	output_height = inst->prop.height[CAPTURE_PORT];
	output_width = inst->prop.width[CAPTURE_PORT];
	output_height = ALIGN(inst->prop.height[CAPTURE_PORT], 16);
	output_width = ALIGN(inst->prop.width[CAPTURE_PORT], 16);

	if ((output_width != output_height) &&
		(rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_90 ||
		rotation == V4L2_CID_MPEG_VIDC_VIDEO_ROTATION_270)) {

		output_width = inst->prop.height[CAPTURE_PORT];
		output_height = inst->prop.width[CAPTURE_PORT];
		output_width = ALIGN(inst->prop.height[CAPTURE_PORT], 16);
		output_height = ALIGN(inst->prop.width[CAPTURE_PORT], 16);
		dprintk(VIDC_DBG,
			"Rotation=%u Swapped Output W=%u H=%u to check capability",
			rotation, output_width, output_height);