drm/amd/display: Fix cursor size issues
authorNevenko Stupar <nevenko.stupar@amd.com>
Tue, 11 Jun 2024 16:31:38 +0000 (12:31 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2024 21:10:36 +0000 (17:10 -0400)
[WHY & HOW]
Fix the cursor size between ODM slices.

Reviewed-by: Sridevi Arvindekar <sridevi.arvindekar@amd.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Nevenko Stupar <nevenko.stupar@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c

index 0cf55f557c3c33804baf21b439d6f24a93b08f9b..42753f56d31d31c4aa94f484ff2ced07ad2a07d7 100644 (file)
@@ -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;