All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vidya Srinivas <vidya.srinivas@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: chandra.konduru@intel.com, nabendu.bikash.maiti@intel.com,
	sunil.kamath@intel.com, mahesh1.kumar@intel.com,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	stable@vger.kernel.org,
	"Tvrtko Ursulin" <tvrtko.ursulin@intel.com>
Subject: [PATCH 02/11] drm/i915: Fix scaling check for 90/270 degree plane rotation
Date: Wed,  7 Jun 2017 10:21:17 +0530	[thread overview]
Message-ID: <1496811086-28706-3-git-send-email-vidya.srinivas@intel.com> (raw)
In-Reply-To: <1496811086-28706-1-git-send-email-vidya.srinivas@intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Starting from commit b63a16f6cd89 ("drm/i915: Compute display surface
offset in the plane check hook for SKL+") we've already rotated the src
coordinates by 270 degrees by the time we check if a scaler is needed
or not, so we must not account for the rotation a second time.
Previously we did these steps in the opposite order and hence the
scaler check had to deal with rotation itself. The double rotation
handling causes us to enable a scaler pretty much every time 90/270
degree plane rotation is requested, leading to fuzzier fonts and whatnot.

v2: s/unsigned/unsigned int/ to appease checkpatch

Cc: stable@vger.kernel.org
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/147690/
Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Tested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: b63a16f6cd89 ("drm/i915: Compute display surface offset in the plane check hook for SKL+")
Signed-off-by: Ville Syrjä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 035d702..9f30b95 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -4769,7 +4769,7 @@ static void cpt_verify_modeset(struct drm_device *dev, int pipe)
 
 static int
 skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
-		  unsigned scaler_user, int *scaler_id, unsigned int rotation,
+		  unsigned int scaler_user, int *scaler_id,
 		  int src_w, int src_h, int dst_w, int dst_h)
 {
 	struct intel_crtc_scaler_state *scaler_state =
@@ -4778,9 +4778,12 @@ static void cpt_verify_modeset(struct drm_device *dev, int pipe)
 		to_intel_crtc(crtc_state->base.crtc);
 	int need_scaling;
 
-	need_scaling = drm_rotation_90_or_270(rotation) ?
-		(src_h != dst_w || src_w != dst_h):
-		(src_w != dst_w || src_h != dst_h);
+	/*
+	 * Src coordinates are already rotated by 270 degrees for
+	 * the 90/270 degree plane rotation cases (to match the
+	 * GTT mapping), hence no need to account for rotation here.
+	 */
+	need_scaling = src_w != dst_w || src_h != dst_h;
 
 	/*
 	 * if plane is being disabled or scaler is no more required or force detach
@@ -4842,7 +4845,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state)
 	const struct drm_display_mode *adjusted_mode = &state->base.adjusted_mode;
 
 	return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX,
-		&state->scaler_state.scaler_id, DRM_MODE_ROTATE_0,
+		&state->scaler_state.scaler_id,
 		state->pipe_src_w, state->pipe_src_h,
 		adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay);
 }
@@ -4871,7 +4874,6 @@ static int skl_update_scaler_plane(struct intel_crtc_state *crtc_state,
 	ret = skl_update_scaler(crtc_state, force_detach,
 				drm_plane_index(&intel_plane->base),
 				&plane_state->scaler_id,
-				plane_state->base.rotation,
 				drm_rect_width(&plane_state->base.src) >> 16,
 				drm_rect_height(&plane_state->base.src) >> 16,
 				drm_rect_width(&plane_state->base.dst),
-- 
1.9.1

  parent reply	other threads:[~2017-06-07  4:44 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07  4:51 [PATCH 00/11] Adding NV12 support for SKL display Vidya Srinivas
2017-06-07  4:51 ` [PATCH 01/11] drm/i915: Add render decompression support Vidya Srinivas
2017-06-07  4:51 ` Vidya Srinivas [this message]
2017-06-07  4:51 ` [PATCH 03/11] drm/i915: Fix SKL+ watermarks for 90/270 rotation Vidya Srinivas
2017-06-07  4:51   ` Vidya Srinivas
2017-06-07  4:51 ` [PATCH 04/11] drm/i915: Fix 90/270 rotated coordinates for FBC Vidya Srinivas
2017-06-07  4:51   ` Vidya Srinivas
2017-06-07  4:51 ` [PATCH 05/11] drm/i915: Implement .get_format_info() hook for CCS Vidya Srinivas
2017-06-07  4:51 ` [PATCH 06/11] drm/i915: Set scaler mode for NV12 Vidya Srinivas
2017-06-07  4:51 ` [PATCH 07/11] drm/i915: Update format_is_yuv() to include NV12 Vidya Srinivas
2017-06-07  4:51 ` [PATCH 08/11] drm/i915: Upscale scaler max scale for NV12 Vidya Srinivas
2017-06-07  4:51 ` [PATCH 09/11] drm/i915: Add NV12 as supported format for primary plane Vidya Srinivas
2017-06-07  4:51 ` [PATCH 10/11] drm/i915: Add NV12 as supported format for sprite plane Vidya Srinivas
2017-06-07  4:51 ` [PATCH 11/11] drm/i915: Add NV12 support to intel_framebuffer_init Vidya Srinivas
2017-06-07  8:01 ` ✗ Fi.CI.BAT: failure for Adding NV12 support for SKL display Patchwork
2017-06-07 10:41 ` [PATCH 0/8] " Vidya Srinivas
2017-06-07 10:41   ` [PATCH 1/8] drm/i915: Add render decompression support Vidya Srinivas
2017-06-07 10:52     ` Daniel Stone
2017-06-07 10:41   ` [PATCH 2/8] drm/i915: Implement .get_format_info() hook for CCS Vidya Srinivas
2017-06-07 10:46     ` Daniel Stone
2017-06-07 10:41   ` [PATCH 3/8] drm/i915: Set scaler mode for NV12 Vidya Srinivas
2017-06-12 13:56     ` Ville Syrjälä
2017-06-15 11:30       ` Srinivas, Vidya
2017-06-07 10:41   ` [PATCH 4/8] drm/i915: Update format_is_yuv() to include NV12 Vidya Srinivas
2017-06-07 10:41   ` [PATCH 5/8] drm/i915: Upscale scaler max scale for NV12 Vidya Srinivas
2017-06-12 14:07     ` Ville Syrjälä
2017-06-07 10:41   ` [PATCH 6/8] drm/i915: Add NV12 as supported format for primary plane Vidya Srinivas
2017-06-12 14:12     ` Ville Syrjälä
2017-06-15 11:30       ` Srinivas, Vidya
2017-06-07 10:41   ` [PATCH 7/8] drm/i915: Add NV12 as supported format for sprite plane Vidya Srinivas
2017-06-12 14:20     ` Ville Syrjälä
2017-06-15 11:30       ` Srinivas, Vidya
2017-06-07 10:41   ` [PATCH 8/8] drm/i915: Add NV12 support to intel_framebuffer_init Vidya Srinivas
2017-06-12 14:25     ` Ville Syrjälä
2017-06-15 11:30       ` Srinivas, Vidya
2017-06-08  9:07   ` [PATCH 0/8] Adding NV12 support for SKL display Jani Nikula
2017-06-07 11:40 ` Vidya Srinivas
2017-06-07 11:40   ` [PATCH 1/8] drm/i915: Implement .get_format_info() hook for CCS Vidya Srinivas
2017-06-07 11:44     ` Daniel Stone
2017-06-07 12:53       ` Ville Syrjälä
2017-06-07 14:24         ` Daniel Stone
2017-06-07 15:33           ` Ville Syrjälä
2017-06-07 15:48             ` Daniel Stone
2017-06-07 16:28               ` Ville Syrjälä
2017-06-07 17:14                 ` Daniel Stone
2017-06-07 11:40   ` [PATCH 2/8] drm/i915: Add render decompression support Vidya Srinivas
2017-06-07 11:40   ` [PATCH 3/8] drm/i915: Set scaler mode for NV12 Vidya Srinivas
2017-06-07 11:41   ` [PATCH 4/8] drm/i915: Update format_is_yuv() to include NV12 Vidya Srinivas
2017-06-07 11:41   ` [PATCH 5/8] drm/i915: Upscale scaler max scale for NV12 Vidya Srinivas
2017-06-07 11:41   ` [PATCH 6/8] drm/i915: Add NV12 as supported format for primary plane Vidya Srinivas
2017-06-07 11:41   ` [PATCH 7/8] drm/i915: Add NV12 as supported format for sprite plane Vidya Srinivas
2017-06-07 11:41   ` [PATCH 8/8] drm/i915: Add NV12 support to intel_framebuffer_init Vidya Srinivas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1496811086-28706-3-git-send-email-vidya.srinivas@intel.com \
    --to=vidya.srinivas@intel.com \
    --cc=chandra.konduru@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mahesh1.kumar@intel.com \
    --cc=nabendu.bikash.maiti@intel.com \
    --cc=stable@vger.kernel.org \
    --cc=sunil.kamath@intel.com \
    --cc=tvrtko.ursulin@intel.com \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.