OSDN Git Service

drm/amd/display: Use oriented source size when checking cursor scaling
authorVlad Zahorodnii <vlad.zahorodnii@kde.org>
Thu, 2 Dec 2021 12:52:15 +0000 (14:52 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 2 Dec 2021 17:43:36 +0000 (12:43 -0500)
commit69cb56290d9d10cdcc461aa2685e67e540507a96
tree09bcd873e32d2d0c455d76ba13db999ebc6dd38f
parentb220110e4cd442156f36e1d9b4914bb9e87b0d00
drm/amd/display: Use oriented source size when checking cursor scaling

dm_check_crtc_cursor() doesn't take into account plane transforms when
calculating plane scaling, this can result in false positives.

For example, if there's an output with resolution 3840x2160 and the
output is rotated 90 degrees, CRTC_W and CRTC_H will be 3840 and 2160,
respectively, but SRC_W and SRC_H will be 2160 and 3840, respectively.

Since the cursor plane usually has a square buffer attached to it, the
dm_check_crtc_cursor() will think that there's a scale factor mismatch
even though there isn't really.

This fixes an issue where kwin fails to use hardware plane transforms.

Changes since version 1:
- s/orientated/oriented/g

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Vlad Zahorodnii <vlad.zahorodnii@kde.org>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c