Skip to contentSkip to conversation

drm/amd/display: Enable fast plane updates when state->allow_modeset = true

PATCH In review Nicholas Kazlauskas 3 participants 3 messages Jun 7, 2019 – Jun 20, 2019 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Enable fast plane updates when state->allow_modeset = true

[Why]
Whenever the a modeset is allowed (but not neccessarily required) we currently recreate all the planes in the state. Most IGT tests and legacy IOCTLs create atomic commits with this flag set, so the pipes are often unnecessarily reprogrammed.

Poor performance and stuttering can occur when many of these commits are frequently issued.

This flag was needed when the appropriate conditions for checking whether the planes needed a reset were not in place, but should_reset_plane should cover everything needed now.

[How]
Drop the check for state->allow_modeset in should_reset_plane.

All planes on a CRTC should reset in the following conditions:
- The CRTC needs a modeset
- The CRTC degamma changes
- Planes are added or removed to the CRTC

These conditions are all covered in should_reset_plane.

We still can't drop the format change check in should_reset_plane since fill_dc_plane_info_and_addr isn't called when validating the state, so we can't tell if a FULL update is needed or not.

Cc David Francis <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -8
index a698c8f272ed..45f0d5b6c468 100644
@@ -6446,14 +6446,6 @@ static bool should_reset_plane(struct drm_atomic_state *state,
 	struct drm_crtc_state *new_crtc_state;
 	int i;
 
-	/*
-	 * TODO: Remove this hack once the checks below are sufficient
-	 * enough to determine when we need to reset all the planes on
-	 * the stream.
-	 */
-	if (state->allow_modeset)
-		return true;
-
 	/* Exit early if we know that we're adding or removing the plane. */
 	if (old_plane_state->crtc != new_plane_state->crtc)
 		return true;
Signature · 6 lines
2.17.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20190607151655.7991-1-nicholas.kazlauskas-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#2 lore raw

Patch is

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Nicholas Kazlauskas <[email protected]>
Sent: June 7, 2019 11:16:55 AM
To: [email protected]
Cc: Francis, David; Wentland, Harry; Kazlauskas, Nicholas
Subject: [PATCH] drm/amd/display: Enable fast plane updates when state->allow_modeset = true

[Why]
Whenever the a modeset is allowed (but not neccessarily required) we currently recreate all the planes in the state. Most IGT tests and legacy IOCTLs create atomic commits with this flag set, so the pipes are often unnecessarily reprogrammed.

Poor performance and stuttering can occur when many of these commits are frequently issued.

This flag was needed when the appropriate conditions for checking whether the planes needed a reset were not in place, but should_reset_plane should cover everything needed now.

[How]
Drop the check for state->allow_modeset in should_reset_plane.

All planes on a CRTC should reset in the following conditions:
- The CRTC needs a modeset
- The CRTC degamma changes
- Planes are added or removed to the CRTC

These conditions are all covered in should_reset_plane.

We still can't drop the format change check in should_reset_plane since fill_dc_plane_info_and_addr isn't called when validating the state, so we can't tell if a FULL update is needed or not.

Cc David Francis <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -8
index a698c8f272ed..45f0d5b6c468 100644
@@ -6446,14 +6446,6 @@ static bool should_reset_plane(struct drm_atomic_state *state,
         struct drm_crtc_state *new_crtc_state;
         int i;
 
-       /*
-        * TODO: Remove this hack once the checks below are sufficient
-        * enough to determine when we need to reset all the planes on
-        * the stream.
-        */
-       if (state->allow_modeset)
-               return true;
-
         /* Exit early if we know that we're adding or removing the plane. */
         if (old_plane_state->crtc != new_plane_state->crtc)
                 return true;

--
2.17.1

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN8PR12MB32175DF8FD6509F800439BF3EF100-h6+T2+wrnx1RCczRXbE7rwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#4 lore raw

Hi

This patch causes warnings for me in a continuous loop

https://bugs.freedesktop.org/show_bug.cgi?id=110949

Let me know if you'd like any more detail

Cheers

Mike

Quoted 68 lines · David

Patch is

________________________________
From: amd-gfx <[email protected]> on behalf of Nicholas Kazlauskas <[email protected]>
Sent: June 7, 2019 11:16:55 AM
To: [email protected]
Cc: Francis, David; Wentland, Harry; Kazlauskas, Nicholas
Subject: [PATCH] drm/amd/display: Enable fast plane updates when state->allow_modeset = true

[Why]
Whenever the a modeset is allowed (but not neccessarily required) we currently recreate all the planes in the state. Most IGT tests and legacy IOCTLs create atomic commits with this flag set, so the pipes are often unnecessarily reprogrammed.

Poor performance and stuttering can occur when many of these commits are frequently issued.

This flag was needed when the appropriate conditions for checking whether the planes needed a reset were not in place, but should_reset_plane should cover everything needed now.

[How]
Drop the check for state->allow_modeset in should_reset_plane.

All planes on a CRTC should reset in the following conditions:
- The CRTC needs a modeset
- The CRTC degamma changes
- Planes are added or removed to the CRTC

These conditions are all covered in should_reset_plane.

We still can't drop the format change check in should_reset_plane since fill_dc_plane_info_and_addr isn't called when validating the state, so we can't tell if a FULL update is needed or not.

Cc David Francis <[email protected]>
Cc Harry Wentland <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 8 --------
 1 file changed, 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -9
index a698c8f272ed..45f0d5b6c468 100644
@@ -6446,14 +6446,6 @@ static bool should_reset_plane(struct drm_atomic_state *state,
         struct drm_crtc_state *new_crtc_state;
         int i;
 
-       /*
-        * TODO: Remove this hack once the checks below are sufficient
-        * enough to determine when we need to reset all the planes on
-        * the stream.
-        */
-       if (state->allow_modeset)
-               return true;
-
         /* Exit early if we know that we're adding or removing the plane. */
         if (old_plane_state->crtc != new_plane_state->crtc)
                 return true;
--

2.17.1

Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx