Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/display: Fix disabled cursor on top screen edge

[Why]
The cursor vanishes when touching the top of edge of the screen for
Raven on Linux.

This occurs because the cursor height is not taken into account when
deciding to disable the cursor.

[How]
Factor in the cursor height into the cursor calculations - and mimic
the existing x position calculations.

Fixes: 94a4ffd1d40b ("drm/amd/display: fix PIP bugs on Dal3")

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nicholas Kazlauskas and committed by
Alex Deucher
ae1cf20d f5c412ac

+2 -2
+1 -1
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_dpp.c
··· 463 463 if (src_y_offset >= (int)param->viewport.height) 464 464 cur_en = 0; /* not visible beyond bottom edge*/ 465 465 466 - if (src_y_offset < 0) 466 + if (src_y_offset + (int)height <= 0) 467 467 cur_en = 0; /* not visible beyond top edge*/ 468 468 469 469 REG_UPDATE(CURSOR0_CONTROL,
+1 -1
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hubp.c
··· 1140 1140 if (src_y_offset >= (int)param->viewport.height) 1141 1141 cur_en = 0; /* not visible beyond bottom edge*/ 1142 1142 1143 - if (src_y_offset < 0) //+ (int)hubp->curs_attr.height 1143 + if (src_y_offset + (int)hubp->curs_attr.height <= 0) 1144 1144 cur_en = 0; /* not visible beyond top edge*/ 1145 1145 1146 1146 if (cur_en && REG_READ(CURSOR_SURFACE_ADDRESS) == 0)