From: Nevenko Stupar Date: Tue, 11 Jun 2024 16:31:38 +0000 (-0400) Subject: drm/amd/display: Fix cursor size issues X-Git-Tag: v6.11-rc1~141^2~8^2~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51dbe0239b1fc7c435867ce28e5eb4394b6641e1;p=thirdparty%2Fkernel%2Flinux.git drm/amd/display: Fix cursor size issues [WHY & HOW] Fix the cursor size between ODM slices. Reviewed-by: Sridevi Arvindekar Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Alex Hung Signed-off-by: Nevenko Stupar Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c index 0cf55f557c3c3..42753f56d31d3 100644 --- a/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +++ b/drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c @@ -1169,6 +1169,20 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) x_pos -= (prev_odm_width + prev_odm_offset); } + /* If the position is negative then we need to add to the hotspot + * to fix cursor size between ODM slices + */ + + if (x_pos < 0) { + pos_cpy.x_hotspot -= x_pos; + x_pos = 0; + } + + if (y_pos < 0) { + pos_cpy.y_hotspot -= y_pos; + y_pos = 0; + } + pos_cpy.x = (uint32_t)x_pos; pos_cpy.y = (uint32_t)y_pos;