RE: [PATCH] drm/amd/display: Fix overlay validation by considering cursors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



[AMD Public Use]

The tests that failed previously for me were:
amdgpu/amd_plane -> mpo-swizzle-toggle
kms_atomic -> plane-overlay-legacy
kms_plane -> plane-position-covered-pipe-a-planes
kms_plane -> plane-position-covered-pipe-c-planes
kms_plane -> plane-position-hole-dpms-pipe-a-planes
kms_plane -> plane-position-hole-dpms-pipe-c-planes
kms_plane -> plane-position-hole-pipe-a-planes
kms_plane -> plane-position-hole-pipe-c-planes
kms_plane_scaling -> pipe-a-plane-scaling
kms_plane_scaling -> pipe-c-plane-scaling

After testing this patch on a HP Envy 360, with Ryzen 5 4500u, a Sapphire Pulse RX5700XT, and an AMD Reference RX6800, these tests all now pass. 



Tested-by: Daniel Wheeler <daniel.wheeler@xxxxxxx>

 
Thank you,
 
Dan Wheeler
Technologist  |  AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook |  Twitter |  amd.com  

Thank you,

Dan Wheeler
Technologist  |  AMD
SW Display
O +(1) 905-882-2600 ext. 74665
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook |  Twitter |  amd.com  


-----Original Message-----
From: Siqueira, Rodrigo <Rodrigo.Siqueira@xxxxxxx> 
Sent: May 14, 2021 7:48 AM
To: amd-gfx@xxxxxxxxxxxxxxxxxxxxx
Cc: Yin, Tianci (Rico) <Tianci.Yin@xxxxxxx>; Wentland, Harry <Harry.Wentland@xxxxxxx>; Choi, Nicholas <Nicholas.Choi@xxxxxxx>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@xxxxxxx>; Kazlauskas, Nicholas <Nicholas.Kazlauskas@xxxxxxx>; Mark Yacoub <markyacoub@xxxxxxxxxx>; Wheeler, Daniel <Daniel.Wheeler@xxxxxxx>
Subject: [PATCH] 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 <tianci.yin@xxxxxxx>
Cc: Harry Wentland <harry.wentland@xxxxxxx>
Cc: Nicholas Choi <nicholas.choi@xxxxxxx>
Cc: Bhawanpreet Lakha <bhawanpreet.lakha@xxxxxxx>
Cc: Nicholas Kazlauskas <Nicholas.Kazlauskas@xxxxxxx>
Cc: Mark Yacoub <markyacoub@xxxxxxxxxx>
Cc: Daniel Wheeler <daniel.wheeler@xxxxxxx>

Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@xxxxxxx>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index ccd67003b120..9c2537a17a7b 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -10067,7 +10067,7 @@ static int validate_overlay(struct drm_atomic_state *state)
 	int i;
 	struct drm_plane *plane;
 	struct drm_plane_state *old_plane_state, *new_plane_state;
-	struct drm_plane_state *primary_state, *overlay_state = NULL;
+	struct drm_plane_state *primary_state, *cursor_state, *overlay_state = 
+NULL;
 
 	/* Check if primary plane is contained inside overlay */
 	for_each_oldnew_plane_in_state_reverse(state, plane, old_plane_state, new_plane_state, i) { @@ -10097,6 +10097,14 @@ static int validate_overlay(struct drm_atomic_state *state)
 	if (!primary_state->crtc)
 		return 0;
 
+	/* check if cursor plane is enabled */
+	cursor_state = drm_atomic_get_plane_state(state, overlay_state->crtc->cursor);
+	if (IS_ERR(cursor_state))
+		return PTR_ERR(cursor_state);
+
+	if (drm_atomic_plane_disabling(plane->state, cursor_state))
+		return 0;
+
 	/* Perform the bounds check to ensure the overlay plane covers the primary */
 	if (primary_state->crtc_x < overlay_state->crtc_x ||
 	    primary_state->crtc_y < overlay_state->crtc_y ||
--
2.25.1
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux