1
0
Fork 0
alistair23-linux/drivers/gpu/drm/amd/display
Nicholas Kazlauskas bd13b2b874 drm/amd/display: Fix negative cursor pos programming (v2)
[Why]
If the cursor pos passed from DM is less than the plane_state->dst_rect
top left corner then the unsigned cursor pos wraps around to a large
positive number since cursor pos is a u32.

There was an attempt to guard against this in hubp1_cursor_set_position
by checking the src_x_offset and src_y_offset and offseting the
cursor hotspot within hubp1_cursor_set_position.

However, the cursor position itself is still being programmed
incorrectly as a large value.

This manifests itself visually as the cursor disappearing or containing
strange artifacts near the middle of the screen on raven.

[How]
Don't subtract the destination rect top left corner from the pos but
add it to the hotspot instead. This happens before the pos gets
passed into hubp1_cursor_set_position.

This achieves the same result but avoids the subtraction wrap around.
With this fix the original cursor programming logic can be used again.

v2: add hunk that got dropped accidently when this patch was originally
committed. (Alex)
Fixes: 0921c41e19 ("drm/amd/display: Fix negative cursor pos programming")

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Acked-by: Murton Liu <Murton.Liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2019-04-08 10:33:40 -05:00
..
amdgpu_dm drm/amd/display: fix cursor black issue 2019-04-04 10:23:15 -05:00
dc drm/amd/display: Fix negative cursor pos programming (v2) 2019-04-08 10:33:40 -05:00
include drm/amd/display: remove screen flashes on seamless boot 2019-02-19 15:58:26 -05:00
modules drm/amd/display: Pass app_tf by value rather than by reference 2019-02-27 22:23:55 -05:00
Kconfig drm/amd/display: Add DC config flag for Raven2 (v2) 2018-09-14 09:36:56 -05:00
Makefile drm/amd/display: Load DMCU IRAM 2018-11-26 15:47:53 -05:00
TODO drm/amd/display: Convert remaining loggers off dc_logger 2018-07-13 14:48:42 -05:00