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

Commit b0e0c2ba authored by Lloyd Atkinson's avatar Lloyd Atkinson
Browse files

drm/msm/sde: clear crtc roi if it matches full screen



Simplify tracking of the CRTC ROI when it matches full screen
mode resolution by resetting it to a null rectangle which
matches the non-partial update case handling.

Change-Id: I3446095261c4830e233d1c66a6c6caf653dba98c
Signed-off-by: default avatarLloyd Atkinson <latkinso@codeaurora.org>
parent 440728eb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -961,6 +961,12 @@ static int _sde_crtc_set_crtc_roi(struct drm_crtc *crtc,

	sde_kms_rect_merge_rectangles(&crtc_state->user_roi_list, crtc_roi);

	/* clear the ROI to null if it matches full screen anyways */
	if (crtc_roi->x == 0 && crtc_roi->y == 0 &&
			crtc_roi->w == state->adjusted_mode.hdisplay &&
			crtc_roi->h == state->adjusted_mode.vdisplay)
		memset(crtc_roi, 0, sizeof(*crtc_roi));

	SDE_DEBUG("%s: crtc roi (%d,%d,%d,%d)\n", sde_crtc->name,
			crtc_roi->x, crtc_roi->y, crtc_roi->w, crtc_roi->h);
	SDE_EVT32_VERBOSE(DRMID(crtc), crtc_roi->x, crtc_roi->y, crtc_roi->w,
+5 −4
Original line number Diff line number Diff line
@@ -3593,7 +3593,6 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
	struct drm_crtc *crtc;
	struct drm_framebuffer *fb;
	struct sde_rect src, dst;
	const struct sde_rect *crtc_roi;
	bool q16_data = true;
	bool blend_enabled = true;
	int idx;
@@ -3712,9 +3711,8 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
	_sde_plane_sspp_atomic_check_mode_changed(psde, state,
								old_state);

	/* re-program the output rects always in the case of partial update */
	sde_crtc_get_crtc_roi(crtc->state, &crtc_roi);
	if (!sde_kms_rect_is_null(crtc_roi))
	/* re-program the output rects always if partial update roi changed */
	if (sde_crtc_is_crtc_roi_dirty(crtc->state))
		pstate->dirty |= SDE_PLANE_DIRTY_RECTS;

	if (pstate->dirty & SDE_PLANE_DIRTY_RECTS)
@@ -3747,6 +3745,8 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,

	/* update roi config */
	if (pstate->dirty & SDE_PLANE_DIRTY_RECTS) {
		const struct sde_rect *crtc_roi;

		POPULATE_RECT(&src, rstate->out_src_x, rstate->out_src_y,
			rstate->out_src_w, rstate->out_src_h, q16_data);
		POPULATE_RECT(&dst, state->crtc_x, state->crtc_y,
@@ -3773,6 +3773,7 @@ static int sde_plane_sspp_atomic_update(struct drm_plane *plane,
		 * adjust layer mixer position of the sspp in the presence
		 * of a partial update to the active lm origin
		 */
		sde_crtc_get_crtc_roi(crtc->state, &crtc_roi);
		dst.x -= crtc_roi->x;
		dst.y -= crtc_roi->y;