Skip to content

Commit 5b2695f

Browse files
vsyrjalarodrigovivi
authored andcommitted
drm/i915: Fix glk/cnl display w/a #1175
The workaround was supposed to look at the plane destination coordinates. Currently it's looking at some mixture of src and dst coordinates that doesn't make sense. Fix it up. Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Fixes: 394676f (drm/i915: Add WA for planes ending close to left screen edge) Reviewed-by: Imre Deak <[email protected]> (cherry picked from commit b1f1c2c) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 5b394b2 commit 5b2695f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,6 +2988,7 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,
29882988
int w = drm_rect_width(&plane_state->base.src) >> 16;
29892989
int h = drm_rect_height(&plane_state->base.src) >> 16;
29902990
int dst_x = plane_state->base.dst.x1;
2991+
int dst_w = drm_rect_width(&plane_state->base.dst);
29912992
int pipe_src_w = crtc_state->pipe_src_w;
29922993
int max_width = skl_max_plane_width(fb, 0, rotation);
29932994
int max_height = 4096;
@@ -3009,10 +3010,10 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,
30093010
* screen may cause FIFO underflow and display corruption.
30103011
*/
30113012
if ((IS_GEMINILAKE(dev_priv) || IS_CANNONLAKE(dev_priv)) &&
3012-
(dst_x + w < 4 || dst_x > pipe_src_w - 4)) {
3013+
(dst_x + dst_w < 4 || dst_x > pipe_src_w - 4)) {
30133014
DRM_DEBUG_KMS("requested plane X %s position %d invalid (valid range %d-%d)\n",
3014-
dst_x + w < 4 ? "end" : "start",
3015-
dst_x + w < 4 ? dst_x + w : dst_x,
3015+
dst_x + dst_w < 4 ? "end" : "start",
3016+
dst_x + dst_w < 4 ? dst_x + dst_w : dst_x,
30163017
4, pipe_src_w - 4);
30173018
return -ERANGE;
30183019
}

0 commit comments

Comments
 (0)