Skip to content

Commit eb0192f

Browse files
vsyrjalarodrigovivi
authored andcommitted
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: df79cf4 ("drm/i915: Store the final plane stride in plane_state") Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Chris Wilson <[email protected]> (cherry picked from commit 006e570) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent cffb4c3 commit eb0192f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/i915/display/intel_sprite.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,7 @@ g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state,
15281528
int src_x, src_w, src_h, crtc_w, crtc_h;
15291529
const struct drm_display_mode *adjusted_mode =
15301530
&crtc_state->base.adjusted_mode;
1531+
unsigned int stride = plane_state->color_plane[0].stride;
15311532
unsigned int cpp = fb->format->cpp[0];
15321533
unsigned int width_bytes;
15331534
int min_width, min_height;
@@ -1569,9 +1570,9 @@ g4x_sprite_check_scaling(struct intel_crtc_state *crtc_state,
15691570
return -EINVAL;
15701571
}
15711572

1572-
if (width_bytes > 4096 || fb->pitches[0] > 4096) {
1573+
if (stride > 4096) {
15731574
DRM_DEBUG_KMS("Stride (%u) exceeds hardware max with scaling (%u)\n",
1574-
fb->pitches[0], 4096);
1575+
stride, 4096);
15751576
return -EINVAL;
15761577
}
15771578

0 commit comments

Comments
 (0)