]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit34748c8b3660dd9c75d19bee258ab61f699e9deb
tree09bcd873e32d2d0c455d76ba13db999ebc6dd38f
parent9d27e013fb328480bd2c48aba1eb58a36d12a73c
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