diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2017-03-31 14:00:56 -0400 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2017-06-07 09:32:09 -0400 |
commit | 1065467ed8e2601bf2d7018cf47c557ccbea3769 (patch) | |
tree | 9a011745fa1b0c26b352b133b92f81f84efc507c | |
parent | 27fe407cb5122f12cfe976813686e8206425c32a (diff) |
drm/i915: Fix 90/270 rotated coordinates for FBC
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 <tvrtko.ursulin@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Fixes: b63a16f6cd89 ("drm/i915: Compute display surface offset in the plane check hook for SKL+")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170331180056.14086-4-ville.syrjala@linux.intel.com
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
(cherry picked from commit 73714c05df97d7527e7eaaa771472ef2ede46fa3)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_fbc.c | 19 |
1 files 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) | |||
82 | static void intel_fbc_get_plane_source_size(struct intel_fbc_state_cache *cache, | 82 | static void intel_fbc_get_plane_source_size(struct intel_fbc_state_cache *cache, |
83 | int *width, int *height) | 83 | int *width, int *height) |
84 | { | 84 | { |
85 | int w, h; | ||
86 | |||
87 | if (drm_rotation_90_or_270(cache->plane.rotation)) { | ||
88 | w = cache->plane.src_h; | ||
89 | h = cache->plane.src_w; | ||
90 | } else { | ||
91 | w = cache->plane.src_w; | ||
92 | h = cache->plane.src_h; | ||
93 | } | ||
94 | |||
95 | if (width) | 85 | if (width) |
96 | *width = w; | 86 | *width = cache->plane.src_w; |
97 | if (height) | 87 | if (height) |
98 | *height = h; | 88 | *height = cache->plane.src_h; |
99 | } | 89 | } |
100 | 90 | ||
101 | static int intel_fbc_calculate_cfb_size(struct drm_i915_private *dev_priv, | 91 | 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, | |||
746 | cache->crtc.hsw_bdw_pixel_rate = crtc_state->pixel_rate; | 736 | cache->crtc.hsw_bdw_pixel_rate = crtc_state->pixel_rate; |
747 | 737 | ||
748 | cache->plane.rotation = plane_state->base.rotation; | 738 | cache->plane.rotation = plane_state->base.rotation; |
739 | /* | ||
740 | * Src coordinates are already rotated by 270 degrees for | ||
741 | * the 90/270 degree plane rotation cases (to match the | ||
742 | * GTT mapping), hence no need to account for rotation here. | ||
743 | */ | ||
749 | cache->plane.src_w = drm_rect_width(&plane_state->base.src) >> 16; | 744 | cache->plane.src_w = drm_rect_width(&plane_state->base.src) >> 16; |
750 | cache->plane.src_h = drm_rect_height(&plane_state->base.src) >> 16; | 745 | cache->plane.src_h = drm_rect_height(&plane_state->base.src) >> 16; |
751 | cache->plane.visible = plane_state->base.visible; | 746 | cache->plane.visible = plane_state->base.visible; |