Skip to content

Commit 33f409e

Browse files
Rodrigo Siqueiraalexdeucher
authored andcommitted
drm/amd/display: Fix overlay validation by considering cursors
A few weeks ago, we saw a two cursor issue in a ChromeOS system. We fixed it in the commit: drm/amd/display: Fix two cursor duplication when using overlay (read the commit message for more details) After this change, we noticed that some IGT subtests related to kms_plane and kms_plane_scaling started to fail. After investigating this issue, we noticed that all subtests that fail have a primary plane covering the overlay plane, which is currently rejected by amdgpu dm. Fail those IGT tests highlight that our verification was too broad and compromises the overlay usage in our drive. This patch fixes this issue by ensuring that we only reject commits where the primary plane is not fully covered by the overlay when the cursor hardware is enabled. With this fix, all IGT tests start to pass again, which means our overlay support works as expected. Cc: Tianci.Yin <[email protected]> Cc: Harry Wentland <[email protected]> Cc: Nicholas Choi <[email protected]> Cc: Bhawanpreet Lakha <[email protected]> Cc: Nicholas Kazlauskas <[email protected]> Cc: Mark Yacoub <[email protected]> Cc: Daniel Wheeler <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 5cfc912 commit 33f409e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9891,7 +9891,7 @@ static int validate_overlay(struct drm_atomic_state *state)
98919891
int i;
98929892
struct drm_plane *plane;
98939893
struct drm_plane_state *old_plane_state, *new_plane_state;
9894-
struct drm_plane_state *primary_state, *overlay_state = NULL;
9894+
struct drm_plane_state *primary_state, *cursor_state, *overlay_state = NULL;
98959895

98969896
/* Check if primary plane is contained inside overlay */
98979897
for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, new_plane_state, i) {
@@ -9921,6 +9921,14 @@ static int validate_overlay(struct drm_atomic_state *state)
99219921
if (!primary_state->crtc)
99229922
return 0;
99239923

9924+
/* check if cursor plane is enabled */
9925+
cursor_state = drm_atomic_get_plane_state(state, overlay_state->crtc->cursor);
9926+
if (IS_ERR(cursor_state))
9927+
return PTR_ERR(cursor_state);
9928+
9929+
if (drm_atomic_plane_disabling(plane->state, cursor_state))
9930+
return 0;
9931+
99249932
/* Perform the bounds check to ensure the overlay plane covers the primary */
99259933
if (primary_state->crtc_x < overlay_state->crtc_x ||
99269934
primary_state->crtc_y < overlay_state->crtc_y ||

0 commit comments

Comments
 (0)