1
0
Fork 0
alistair23-linux/drivers/gpu/drm/amd/display/dc/dcn10
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
..
Makefile drm/amd/display: rename dccg to clk_mgr 2018-11-05 14:20:48 -05:00
dcn10_clk_mgr.c drm/amd/display: Start using the new pp_smu interface 2019-01-14 15:04:42 -05:00
dcn10_clk_mgr.h drm/amd/display: Clean up for DCN1 clock debug logging 2018-11-30 12:04:45 -05:00
dcn10_cm_common.c drm/amd/display: Add tracing to dc 2018-12-05 17:49:49 -05:00
dcn10_cm_common.h drm/amd/display: Set gamma not working on MPO planes 2018-11-05 14:21:31 -05:00
dcn10_dpp.c drm/amd/display: Fix disabled cursor on top screen edge 2019-01-14 16:01:52 -05:00
dcn10_dpp.h drm/amd/display: fix PIP bugs on Dal3 2018-08-27 11:10:14 -05:00
dcn10_dpp_cm.c drm/amd/display: Fix runtime errors for diagnostic tests 2019-01-14 15:04:32 -05:00
dcn10_dpp_dscl.c drm/amd/display: Check if registers are available before accessing 2019-01-14 15:42:22 -05:00
dcn10_hubbub.c drm/amd/display: Disable Stutter for Stereo 3D 2019-02-06 13:30:04 -05:00
dcn10_hubbub.h drm/amd/display: Disable Stutter for Stereo 3D 2019-02-06 13:30:04 -05:00
dcn10_hubp.c drm/amd/display: Fix negative cursor pos programming (v2) 2019-04-08 10:33:40 -05:00
dcn10_hubp.h drm/amd/display: Introduce DC VM interface 2019-01-25 16:15:36 -05:00
dcn10_hw_sequencer.c Linux 5.0 2019-03-04 12:02:55 +10:00
dcn10_hw_sequencer.h drm/amd/display: Refactor for setup periodic interrupt. 2019-02-19 15:58:27 -05:00
dcn10_hw_sequencer_debug.c drm/amd/display: fix compliler errors [-Werror,-Wmissing-braces] 2019-01-14 15:04:45 -05:00
dcn10_ipp.c drm/amd/display: moving cursor functions from ipp to mem_input 2017-10-21 16:44:03 -04:00
dcn10_ipp.h drm/amd/display: Move dpp reg access from hwss to dpp module. 2018-02-19 14:17:33 -05:00
dcn10_link_encoder.c drm/amd/display: interface to check if timing can be seamless 2019-02-06 13:30:44 -05:00
dcn10_link_encoder.h drm/amd/display: interface to check if timing can be seamless 2019-02-06 13:30:44 -05:00
dcn10_mpc.c drm/amd/display: Make function pointer structs const 2018-07-10 14:17:23 -05:00
dcn10_mpc.h drm/amd/display: add mpc to dtn log 2018-04-11 13:07:38 -05:00
dcn10_opp.c drm/amd/display: Make function pointer structs const 2018-07-10 14:17:23 -05:00
dcn10_opp.h drm/amd/display: Move opp reg access from hwss to opp module. 2018-02-19 14:17:34 -05:00
dcn10_optc.c drm/amd/display: Refactor for setup periodic interrupt. 2019-02-19 15:58:27 -05:00
dcn10_optc.h drm/amd/display: Refactor for setup periodic interrupt. 2019-02-19 15:58:27 -05:00
dcn10_resource.c revert "drm/amd/display: Add condition to sync eDP SW status and HW status" 2019-01-25 16:15:37 -05:00
dcn10_resource.h drm/amd/display: Flattening core_dc to dc 2017-09-26 18:16:40 -04:00
dcn10_stream_encoder.c drm/amd/display: Connect dig_fe to otg directly instead of calling bios 2019-01-25 16:15:37 -05:00
dcn10_stream_encoder.h drm/amd/display: Connect dig_fe to otg directly instead of calling bios 2019-01-25 16:15:37 -05:00