linux/drivers/gpu/drm/amd
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
..
acp drm/amdgpu: Remove wrapper layer of cgs irq handling 2018-03-21 14:36:58 -05:00
amdgpu drm/amdgpu: amdgpu_device_recover_vram always failed if only one node in shadow_list 2019-04-04 10:22:06 -05:00
amdkfd drm/amdkfd: Add picasso pci id 2019-04-04 10:20:34 -05:00
display drm/amd/display: Fix negative cursor pos programming (v2) 2019-04-08 10:33:40 -05:00
include drm/amdkfd: Optimize out sdma doorbell array in kgd2kfd_shared_resources 2019-02-18 18:00:50 -05:00
lib
powerplay drm/amd/powerplay: fix possible hang with 3+ 4K monitors 2019-03-27 22:32:55 -05:00