From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com ([134.134.136.100]:52928 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751225AbdESLfG (ORCPT ); Fri, 19 May 2017 07:35:06 -0400 Subject: Re: [Intel-gfx] [PATCH 3/3] drm/i915: Fix 90/270 rotated coordinates for FBC To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org References: <20170331180056.14086-1-ville.syrjala@linux.intel.com> <20170331180056.14086-4-ville.syrjala@linux.intel.com> Cc: Paulo Zanoni , stable@vger.kernel.org From: Tvrtko Ursulin Message-ID: Date: Fri, 19 May 2017 12:34:58 +0100 MIME-Version: 1.0 In-Reply-To: <20170331180056.14086-4-ville.syrjala@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: On 31/03/2017 19:00, ville.syrjala@linux.intel.com wrote: > From: Ville Syrjälä > > The clipped src coordinates have already been rotated by 270 degrees for > when the plane rotation is 90/270 degrees, hence the FBC code should no > longer swap the width and height. > > Cc: stable@vger.kernel.org > Cc: Tvrtko Ursulin > Cc: Paulo Zanoni > Fixes: b63a16f6cd89 ("drm/i915: Compute display surface offset in the plane check hook for SKL+") > Signed-off-by: Ville Syrjälä > --- > drivers/gpu/drm/i915/intel_fbc.c | 19 +++++++------------ > 1 file changed, 7 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c > index ded2add18b26..d93c58410bff 100644 > --- a/drivers/gpu/drm/i915/intel_fbc.c > +++ b/drivers/gpu/drm/i915/intel_fbc.c > @@ -82,20 +82,10 @@ static unsigned int get_crtc_fence_y_offset(struct intel_crtc *crtc) > static void intel_fbc_get_plane_source_size(struct intel_fbc_state_cache *cache, > int *width, int *height) > { > - int w, h; > - > - if (drm_rotation_90_or_270(cache->plane.rotation)) { > - w = cache->plane.src_h; > - h = cache->plane.src_w; > - } else { > - w = cache->plane.src_w; > - h = cache->plane.src_h; > - } > - > if (width) > - *width = w; > + *width = cache->plane.src_w; > if (height) > - *height = h; > + *height = cache->plane.src_h; > } > > static int intel_fbc_calculate_cfb_size(struct drm_i915_private *dev_priv, > @@ -746,6 +736,11 @@ static void intel_fbc_update_state_cache(struct intel_crtc *crtc, > cache->crtc.hsw_bdw_pixel_rate = crtc_state->pixel_rate; > > cache->plane.rotation = plane_state->base.rotation; > + /* > + * 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. > + */ > cache->plane.src_w = drm_rect_width(&plane_state->base.src) >> 16; > cache->plane.src_h = drm_rect_height(&plane_state->base.src) >> 16; > cache->plane.visible = plane_state->base.visible; > For the series: Tested-by: Tvrtko Ursulin Regards, Tvrtko