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 wrong x_pos and y_pos for cursor offload

[Why]
The hubp401_cursor_set_position function programs a different value
than it stores for use with cursor offload.

This can cause a desync when switching between cursor programming paths.

[How]
We do the translation to destination space currently twice: once in the
HWSS layer, and then again in the HUBP layer since we never store the
translated result.

HUBP expects to program the pos->x and pos->y directly for other ASIC,
so follow that pattern here as well.

Reviewed-by: Alvin Lee <alvin.lee2@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nicholas Kazlauskas and committed by
Alex Deucher
c0228872 def3488e

+9 -8
+6 -8
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c
··· 733 733 const struct dc_cursor_mi_param *param) 734 734 { 735 735 struct dcn20_hubp *hubp2 = TO_DCN20_HUBP(hubp); 736 - int x_pos = pos->x - param->recout.x; 737 - int y_pos = pos->y - param->recout.y; 738 - int rec_x_offset = x_pos - pos->x_hotspot; 739 - int rec_y_offset = y_pos - pos->y_hotspot; 736 + int rec_x_offset = pos->x - pos->x_hotspot; 737 + int rec_y_offset = pos->y - pos->y_hotspot; 740 738 int dst_x_offset; 741 739 int x_pos_viewport = 0; 742 740 int x_hot_viewport = 0; ··· 746 748 * within preceeding ODM slices. 747 749 */ 748 750 if (param->recout.width) { 749 - x_pos_viewport = x_pos * param->viewport.width / param->recout.width; 751 + x_pos_viewport = pos->x * param->viewport.width / param->recout.width; 750 752 x_hot_viewport = pos->x_hotspot * param->viewport.width / param->recout.width; 751 753 } else { 752 - ASSERT(!cur_en || x_pos == 0); 754 + ASSERT(!cur_en || pos->x == 0); 753 755 ASSERT(!cur_en || pos->x_hotspot == 0); 754 756 } 755 757 ··· 788 790 789 791 if (!hubp->cursor_offload) { 790 792 REG_SET_2(CURSOR_POSITION, 0, 791 - CURSOR_X_POSITION, x_pos, 792 - CURSOR_Y_POSITION, y_pos); 793 + CURSOR_X_POSITION, pos->x, 794 + CURSOR_Y_POSITION, pos->y); 793 795 794 796 REG_SET_2(CURSOR_HOT_SPOT, 0, 795 797 CURSOR_HOT_SPOT_X, pos->x_hotspot,
+3
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c
··· 1213 1213 if (recout_y_pos + (int)hubp->curs_attr.height <= 0) 1214 1214 pos_cpy.enable = false; /* not visible beyond top edge*/ 1215 1215 1216 + pos_cpy.x = x_pos; 1217 + pos_cpy.y = y_pos; 1218 + 1216 1219 hubp->funcs->set_cursor_position(hubp, &pos_cpy, &param); 1217 1220 dpp->funcs->set_cursor_position(dpp, &pos_cpy, &param, hubp->curs_attr.width, hubp->curs_attr.height); 1218 1221 }