]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amd/display: Clamp dc_cursor_position x_hotspot to prevent integer overflow
authorBenjamin Nwankwo <Benjamin.Nwankwo@amd.com>
Fri, 6 Mar 2026 17:49:44 +0000 (12:49 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Mar 2026 14:36:09 +0000 (10:36 -0400)
commita2aa7987de1169548c465f6cc1019d2112e0e8b5
tree85ed4d933188a78ccd5ecc7b6362b69672eece78
parent8333f22e44a972428a4e1b5c6a92e3e774e8ac99
drm/amd/display: Clamp dc_cursor_position x_hotspot to prevent integer overflow

why:
Workaround for duplicate cursor. Cursor offsetting via x_hotspot attempts
to write a 32 bit unsigned integer to the 8 bit field CURSOR_HOT_SPOT_X.
This wraps cursor position back into focus if x_hotspot exceeds 8 bits,
making duplicate cursors visible

how:
Clamp x_hotspot before writing to hardware

Reviewed-by: Charlene Liu <charlene.liu@amd.com>
Reviewed-by: Nevenko Stupar <nevenko.stupar@amd.com>
Signed-off-by: Benjamin Nwankwo <Benjamin.Nwankwo@amd.com>
Signed-off-by: Chuanyu Tseng <chuanyu.tseng@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c