Commit eb0192fe authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Rodrigo Vivi

drm/i915: Fix g4x sprite scaling stride check with GTT remapping

I forgot to update the g4x sprite scaling stride check when GTT
remapping was introduced. The stride of the original framebuffer
is irrelevant when remapping is used and instead we want to check
the stride of the remapped view.

Also drop the duplicate width_bytes check. We already check that
a few lines earlier.

Fixes: df79cf44 ("drm/i915: Store the final plane stride in plane_state")
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190930183045.662-1-ville.syrjala@linux.intel.comReviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit 006e5701)
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent cffb4c3e
...@@ -1528,6 +1528,7 @@ g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state, ...@@ -1528,6 +1528,7 @@ g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state,
int src_x, src_w, src_h, crtc_w, crtc_h; int src_x, src_w, src_h, crtc_w, crtc_h;
const struct drm_display_mode *adjusted_mode = const struct drm_display_mode *adjusted_mode =
&crtc_state->base.adjusted_mode; &crtc_state->base.adjusted_mode;
unsigned int stride = plane_state->color_plane[0].stride;
unsigned int cpp = fb->format->cpp[0]; unsigned int cpp = fb->format->cpp[0];
unsigned int width_bytes; unsigned int width_bytes;
int min_width, min_height; int min_width, min_height;
...@@ -1569,9 +1570,9 @@ g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state, ...@@ -1569,9 +1570,9 @@ g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state,
return -EINVAL; return -EINVAL;
} }
if (width_bytes > 4096 || fb->pitches[0] > 4096) { if (stride > 4096) {
DRM_DEBUG_KMS("Stride (%u) exceeds hardware max with scaling (%u)\n", DRM_DEBUG_KMS("Stride (%u) exceeds hardware max with scaling (%u)\n",
fb->pitches[0], 4096); stride, 4096);
return -EINVAL; return -EINVAL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment