mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Revert "drm/amd/display: Check all enabled planes in dm_check_crtc_cursor"
@ 2023-09-29 20:41 Hamza Mahfooz
  2023-10-02 10:05 ` Michel Dänzer
  0 siblings, 1 reply; 4+ messages in thread
From: Hamza Mahfooz @ 2023-09-29 20:41 UTC (permalink / raw)
  To: amd-gfx
  Cc: Michel Dänzer, Ivan Lipski, Hamza Mahfooz, Harry Wentland,
	Leo Li, Rodrigo Siqueira, Alex Deucher, Christian König,
	Pan, Xinhui, David Airlie, Daniel Vetter, Qingqing Zhuo,
	Aurabindo Pillai, Hersen Wu, Alex Hung, Srinivasan Shanmugam,
	Wayne Lin, Stylon Wang, dri-devel, linux-kernel

From: Ivan Lipski <ivlipski@amd.com>

This reverts commit 45e1ade04b4d60fe5df859076005779f27c4c9be.

Since, it causes the following IGT tests to fail:
kms_cursor_legacy@cursor-vs-flip.*
kms_cursor_legacy@flip-vs-cursor.*

Signed-off-by: Ivan Lipski <ivlipski@amd.com>
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

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 32156609fbcf..49ffb4d6e9cc 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -10290,24 +10290,14 @@ static int dm_check_crtc_cursor(struct drm_atomic_state *state,
 	 * blending properties match the underlying planes'.
 	 */
 
-	new_cursor_state = drm_atomic_get_plane_state(state, cursor);
-	if (IS_ERR(new_cursor_state))
-		return PTR_ERR(new_cursor_state);
-
-	if (!new_cursor_state->fb)
+	new_cursor_state = drm_atomic_get_new_plane_state(state, cursor);
+	if (!new_cursor_state || !new_cursor_state->fb)
 		return 0;
 
 	dm_get_oriented_plane_size(new_cursor_state, &cursor_src_w, &cursor_src_h);
 	cursor_scale_w = new_cursor_state->crtc_w * 1000 / cursor_src_w;
 	cursor_scale_h = new_cursor_state->crtc_h * 1000 / cursor_src_h;
 
-	/* Need to check all enabled planes, even if this commit doesn't change
-	 * their state
-	 */
-	i = drm_atomic_add_affected_planes(state, crtc);
-	if (i)
-		return i;
-
 	for_each_new_plane_in_state_reverse(state, underlying, new_underlying_state, i) {
 		/* Narrow down to non-cursor planes on the same CRTC as the cursor */
 		if (new_underlying_state->crtc != crtc || underlying == crtc->cursor)
-- 
2.42.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "drm/amd/display: Check all enabled planes in dm_check_crtc_cursor"
  2023-09-29 20:41 [PATCH] Revert "drm/amd/display: Check all enabled planes in dm_check_crtc_cursor" Hamza Mahfooz
@ 2023-10-02 10:05 ` Michel Dänzer
  2023-10-02 10:48   ` Michel Dänzer
  0 siblings, 1 reply; 4+ messages in thread
From: Michel Dänzer @ 2023-10-02 10:05 UTC (permalink / raw)
  To: Hamza Mahfooz
  Cc: Stylon Wang, Ivan Lipski, Leo Li, David Airlie, Qingqing Zhuo,
	Pan, Xinhui, Rodrigo Siqueira, linux-kernel, dri-devel,
	Alex Hung, Michel Dänzer, Aurabindo Pillai, Hersen Wu,
	Daniel Vetter, Wayne Lin, Alex Deucher, Srinivasan Shanmugam,
	Harry Wentland, Christian König, amd-gfx

On 9/29/23 22:41, Hamza Mahfooz wrote:
> From: Ivan Lipski <ivlipski@amd.com>
> 
> This reverts commit 45e1ade04b4d60fe5df859076005779f27c4c9be.
> 
> Since, it causes the following IGT tests to fail:
> kms_cursor_legacy@cursor-vs-flip.*
> kms_cursor_legacy@flip-vs-cursor.*

Any information about how those tests fail? Maybe they accidentally rely on the broken behaviour?


FWIW, something like the reverted commit is definitely needed, see https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3177#note_1829068 . That MR is blocked by the reverted fix.


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "drm/amd/display: Check all enabled planes in dm_check_crtc_cursor"
  2023-10-02 10:05 ` Michel Dänzer
@ 2023-10-02 10:48   ` Michel Dänzer
  2023-10-02 14:19     ` Michel Dänzer
  0 siblings, 1 reply; 4+ messages in thread
From: Michel Dänzer @ 2023-10-02 10:48 UTC (permalink / raw)
  To: Hamza Mahfooz
  Cc: Stylon Wang, Ivan Lipski, Leo Li, Harry Wentland, Qingqing Zhuo,
	Pan, Xinhui, Rodrigo Siqueira, linux-kernel, dri-devel,
	Alex Hung, Michel Dänzer, Aurabindo Pillai, Hersen Wu,
	amd-gfx, Daniel Vetter, Wayne Lin, Alex Deucher,
	Srinivasan Shanmugam, David Airlie, Christian König

On 10/2/23 12:05, Michel Dänzer wrote:
> On 9/29/23 22:41, Hamza Mahfooz wrote:
>> From: Ivan Lipski <ivlipski@amd.com>
>>
>> This reverts commit 45e1ade04b4d60fe5df859076005779f27c4c9be.
>>
>> Since, it causes the following IGT tests to fail:
>> kms_cursor_legacy@cursor-vs-flip.*
>> kms_cursor_legacy@flip-vs-cursor.*
> 
> Any information about how those tests fail? Maybe they accidentally rely on the broken behaviour?

I was able to reproduce, that doesn't seem to be the case. They just rely on multiple legacy cursor ioctl calls being able to complete between consecutive flips, which I suppose is broken by always pulling in non-cursor plane state with any cursor plane state changes.

I'll see if I can find a better solution. Meanwhile,

Acked-by: Michel Dänzer <mdaenzer@redhat.com>

for the revert.


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] Revert "drm/amd/display: Check all enabled planes in dm_check_crtc_cursor"
  2023-10-02 10:48   ` Michel Dänzer
@ 2023-10-02 14:19     ` Michel Dänzer
  0 siblings, 0 replies; 4+ messages in thread
From: Michel Dänzer @ 2023-10-02 14:19 UTC (permalink / raw)
  To: Hamza Mahfooz
  Cc: Stylon Wang, Ivan Lipski, Leo Li, David Airlie, Qingqing Zhuo,
	Pan, Xinhui, Rodrigo Siqueira, linux-kernel, dri-devel,
	Alex Hung, Michel Dänzer, Aurabindo Pillai, Hersen Wu,
	amd-gfx, Daniel Vetter, Wayne Lin, Alex Deucher,
	Srinivasan Shanmugam, Harry Wentland, Christian König

On 10/2/23 12:48, Michel Dänzer wrote:
> On 10/2/23 12:05, Michel Dänzer wrote:
>> On 9/29/23 22:41, Hamza Mahfooz wrote:
>>> From: Ivan Lipski <ivlipski@amd.com>
>>>
>>> This reverts commit 45e1ade04b4d60fe5df859076005779f27c4c9be.
>>>
>>> Since, it causes the following IGT tests to fail:
>>> kms_cursor_legacy@cursor-vs-flip.*
>>> kms_cursor_legacy@flip-vs-cursor.*
>>
>> Any information about how those tests fail? Maybe they accidentally rely on the broken behaviour?
> 
> I was able to reproduce, that doesn't seem to be the case. They just rely on multiple legacy cursor ioctl calls being able to complete between consecutive flips, which I suppose is broken by always pulling in non-cursor plane state with any cursor plane state changes.
> 
> I'll see if I can find a better solution. Meanwhile,
> 
> Acked-by: Michel Dänzer <mdaenzer@redhat.com>
> 
> for the revert.

Alternatively, here's an incremental fix:

https://patchwork.freedesktop.org/series/124527/


-- 
Earthling Michel Dänzer            |                  https://redhat.com
Libre software enthusiast          |         Mesa and Xwayland developer


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-02 14:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-29 20:41 [PATCH] Revert "drm/amd/display: Check all enabled planes in dm_check_crtc_cursor" Hamza Mahfooz
2023-10-02 10:05 ` Michel Dänzer
2023-10-02 10:48   ` Michel Dänzer
2023-10-02 14:19     ` Michel Dänzer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®