]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Fix double cursor on non-video RGB MPO
authorLeo Li <sunpeng.li@amd.com>
Tue, 30 Aug 2022 20:38:16 +0000 (16:38 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 21 Sep 2022 21:18:15 +0000 (17:18 -0400)
commit2d4d4e7ea335718f82dccf8f9d190b41a035b432
tree04e5fe8bef371ce5a205ab141802fe8b6b5b15ca
parentebc31bb5b2b2b50bc36eee10759953c3d1d4aa18
drm/amd/display: Fix double cursor on non-video RGB MPO

[Why]

DC makes use of layer_index (zpos) when picking the HW plane to enable
HW cursor on. However, some compositors will not attach zpos information
to each DRM plane. Consequently, in amdgpu, we default layer_index to 0
and do not update it.

This causes said DC logic to enable HW cursor on all planes of the same
layer_index, which manifests as a double cursor issue if one of the
planes is scaled (and hence scaling the cursor as well).

[How]

Use DRM core helpers to calculate a normalized_zpos value for each
drm_plane_state under each crtc, within the atomic state.

This helper will first consider existing zpos values, and if
identical/unset, fallback to plane ID ordering.

The normalized_zpos is then passed to dc_plane_info during atomic check
for later use by the cursor logic.

Reviewed-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: Wayne Lin <wayne.lin@amd.com>
Signed-off-by: Leo Li <sunpeng.li@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.c