]> www.infradead.org Git - nvme.git/commitdiff
drm/amd/display: Fix cursor issues with ODMs and magnification
authorNevenko Stupar <nevenko.stupar@amd.com>
Thu, 13 Jun 2024 21:19:42 +0000 (17:19 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Jun 2024 21:10:38 +0000 (17:10 -0400)
[WHY & HOW]
Adjust hot spot positions between ODM slices when cursor
magnification is used.

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 79a911e1a09a0d17af7943057d65d4b54f0944f6..5306c8c170c52bc1c93316e18f8d09337b90e99d 100644 (file)
@@ -1177,6 +1177,15 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
 
        if (x_pos < 0) {
                pos_cpy.x_hotspot -= x_pos;
+               if ((odm_combine_on) && (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION)) {
+                       if (hubp->curs_attr.width <= 128) {
+                               pos_cpy.x_hotspot /= 2;
+                               pos_cpy.x_hotspot += 1;
+                       } else {
+                               pos_cpy.x_hotspot /= 2;
+                               pos_cpy.x_hotspot += 2;
+                       }
+               }
                x_pos = 0;
        }