drm/amd/display: do not set traslate_by_source for DCN401 cursor
authorAurabindo Pillai <aurabindo.pillai@amd.com>
Wed, 14 Aug 2024 21:56:17 +0000 (17:56 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 27 Aug 2024 21:52:23 +0000 (17:52 -0400)
translate_by_source need not be set for DCN401 onwards since cursor
cursor composition comes after scaler in the hardware pipeline.
Hence offset calculation has been reworked, and this setting is not
necessary to be enabled anymore.

Reviewed-by: Rodrigo Siqueira <rodrigo.siqueira@amd.com>
Signed-off-by: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Zaeem Mohamed <zaeem.mohamed@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c

index a573a66398984cbd9f1e207fcc6d9fada336e959..25f63b2e7a8e20dfa7ede3344e08c095ead41ab5 100644 (file)
@@ -1283,6 +1283,7 @@ int amdgpu_dm_plane_get_cursor_position(struct drm_plane *plane, struct drm_crtc
                                        struct dc_cursor_position *position)
 {
        struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc);
+       struct amdgpu_device *adev = drm_to_adev(plane->dev);
        int x, y;
        int xorigin = 0, yorigin = 0;
 
@@ -1314,12 +1315,14 @@ int amdgpu_dm_plane_get_cursor_position(struct drm_plane *plane, struct drm_crtc
                y = 0;
        }
        position->enable = true;
-       position->translate_by_source = true;
        position->x = x;
        position->y = y;
        position->x_hotspot = xorigin;
        position->y_hotspot = yorigin;
 
+       if (amdgpu_ip_version(adev, DCE_HWIP, 0) < IP_VERSION(4, 0, 1))
+               position->translate_by_source = true;
+
        return 0;
 }