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

Commit 32824640 authored by Ujwal Patel's avatar Ujwal Patel Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: rotator: return dst format for request match optimization



As per current implementation, every successful OVERLAY_SET IOCTL should
return destination format for that request. Now there is a driver based
optimization where if back to back OVERLAY_SET IOCTLs request same
configurations then driver avoids extra register writes. However this
optimization doesn't return correct destination format which violates the
IOCTL spec and may result in inefficiencies. Fix this by returning correct
destination format for this optimization.

Change-Id: I792e2f44f17bceb1efc7b1d389db84478581c474
Signed-off-by: default avatarUjwal Patel <ujwalp@codeaurora.org>
parent 0cfabb78
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -804,10 +804,11 @@ static int mdss_mdp_rotator_config(struct msm_fb_data_type *mfd,
	if (rot->flags & MDP_ROT_90)
		swap(rot->dst.w, rot->dst.h);

	rot->req_data = *req;

	req->src.format = mdss_mdp_get_rotator_dst_format(req->src.format,
		req->flags & MDP_ROT_90, req->flags & MDP_BWC_EN);

	rot->req_data = *req;
	rot->params_changed++;

	return 0;
@@ -889,8 +890,17 @@ static int mdss_mdp_rotator_config_ex(struct msm_fb_data_type *mfd,
	}

	/* if session hasn't changed, skip reconfiguration */
	if (!memcmp(req, &rot->req_data, sizeof(*req)))
	if (!memcmp(req, &rot->req_data, sizeof(*req))) {
		/*
		 * as per the IOCTL spec, every successful rotator setup
		 * needs to return corresponding destination format.
		 */
		req->src.format = mdss_mdp_get_rotator_dst_format(
			req->src.format, req->flags & MDP_ROT_90,
			req->flags & MDP_BWC_EN);

		return 0;
	}

	flush_work(&rot->commit_work);