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

Configure Feed

Select the types of activity you want to include in your feed.

drm/amd/display: Fix cursor pos at overlay plane edges on DCN4

[Why&How]
On DCN4, when cursor straddles the left/top edge of an overlay plane, the
recout-relative position becomes negative. These negative values wrap
to large positive numbers when cast to uint32_t, causing the cursor on the
the overlay plane to disappear.

Fix by adding hotspot adjustment and position clamping after the
recout-relative calculation, matching the existing ODM/MPC slice
boundary handling.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Ivan Lipski and committed by
Alex Deucher
d8f6c978 f44c0944

+19
+19
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
··· 1202 1202 x_pos = pos_cpy.x - param.recout.x; 1203 1203 y_pos = pos_cpy.y - param.recout.y; 1204 1204 1205 + /** 1206 + * If the cursor position is negative after recout adjustment, we need 1207 + * to shift the hotspot to compensate and clamp position to 0. This 1208 + * handles the case where cursor straddles the left/top edge of an 1209 + * overlay plane - the cursor is partially visible and needs correct 1210 + * hotspot adjustment to render the visible portion. 1211 + */ 1212 + if (x_pos < 0) { 1213 + pos_cpy.x_hotspot -= x_pos; 1214 + if (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION) 1215 + adjust_hotspot_between_slices_for_2x_magnify(hubp->curs_attr.width, &pos_cpy); 1216 + x_pos = 0; 1217 + } 1218 + 1219 + if (y_pos < 0) { 1220 + pos_cpy.y_hotspot -= y_pos; 1221 + y_pos = 0; 1222 + } 1223 + 1205 1224 recout_x_pos = x_pos - pos_cpy.x_hotspot; 1206 1225 recout_y_pos = y_pos - pos_cpy.y_hotspot; 1207 1226