All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled
@ 2021-11-30 14:53 Nicholas Kazlauskas
  2021-11-30 15:10 ` Deucher, Alexander
  2021-11-30 15:21 ` Harry Wentland
  0 siblings, 2 replies; 3+ messages in thread
From: Nicholas Kazlauskas @ 2021-11-30 14:53 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Harry Wentland, Nicholas Kazlauskas

[Why]
PSR currently relies on the kernel's delayed vblank on/off mechanism
as an implicit bufferring mechanism to prevent excessive entry/exit.

Without this delay the user experience is impacted since it can take
a few frames to enter/exit.

[How]
Only allow vblank disable immediate for DC when psr is not supported.

Leave a TODO indicating that this support should be extended in the
future to delay independent of the vblank interrupt.

Fixes: 3d1508b73ff1 ("drm/amdgpu/display: set vblank_disable_immediate for DC")

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 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 0747dc7922c2..d582d44c02ad 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1599,9 +1599,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
 	adev_to_drm(adev)->mode_config.cursor_width = adev->dm.dc->caps.max_cursor_size;
 	adev_to_drm(adev)->mode_config.cursor_height = adev->dm.dc->caps.max_cursor_size;
 
-	/* Disable vblank IRQs aggressively for power-saving */
-	adev_to_drm(adev)->vblank_disable_immediate = true;
-
 	if (drm_vblank_init(adev_to_drm(adev), adev->dm.display_indexes_num)) {
 		DRM_ERROR(
 		"amdgpu: failed to initialize sw for display support.\n");
@@ -4264,6 +4261,14 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 
 	}
 
+	/*
+	 * Disable vblank IRQs aggressively for power-saving.
+	 *
+	 * TODO: Fix vblank control helpers to delay PSR entry to allow this when PSR
+	 * is also supported.
+	 */
+	adev_to_drm(adev)->vblank_disable_immediate = !psr_feature_enabled;
+
 	/* Software is initialized. Now we can register interrupt handlers. */
 	switch (adev->asic_type) {
 #if defined(CONFIG_DRM_AMD_DC_SI)
-- 
2.25.1


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

* Re: [PATCH] drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled
  2021-11-30 14:53 [PATCH] drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled Nicholas Kazlauskas
@ 2021-11-30 15:10 ` Deucher, Alexander
  2021-11-30 15:21 ` Harry Wentland
  1 sibling, 0 replies; 3+ messages in thread
From: Deucher, Alexander @ 2021-11-30 15:10 UTC (permalink / raw)
  To: Kazlauskas, Nicholas, amd-gfx; +Cc: Wentland, Harry

[-- Attachment #1: Type: text/plain, Size: 2756 bytes --]

[Public]

Acked-by: Alex Deucher <alexander.deucher@amd.com>
________________________________
From: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Sent: Tuesday, November 30, 2021 9:53 AM
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>
Cc: Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>
Subject: [PATCH] drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled

[Why]
PSR currently relies on the kernel's delayed vblank on/off mechanism
as an implicit bufferring mechanism to prevent excessive entry/exit.

Without this delay the user experience is impacted since it can take
a few frames to enter/exit.

[How]
Only allow vblank disable immediate for DC when psr is not supported.

Leave a TODO indicating that this support should be extended in the
future to delay independent of the vblank interrupt.

Fixes: 3d1508b73ff1 ("drm/amdgpu/display: set vblank_disable_immediate for DC")

Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 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 0747dc7922c2..d582d44c02ad 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -1599,9 +1599,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
         adev_to_drm(adev)->mode_config.cursor_width = adev->dm.dc->caps.max_cursor_size;
         adev_to_drm(adev)->mode_config.cursor_height = adev->dm.dc->caps.max_cursor_size;

-       /* Disable vblank IRQs aggressively for power-saving */
-       adev_to_drm(adev)->vblank_disable_immediate = true;
-
         if (drm_vblank_init(adev_to_drm(adev), adev->dm.display_indexes_num)) {
                 DRM_ERROR(
                 "amdgpu: failed to initialize sw for display support.\n");
@@ -4264,6 +4261,14 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)

         }

+       /*
+        * Disable vblank IRQs aggressively for power-saving.
+        *
+        * TODO: Fix vblank control helpers to delay PSR entry to allow this when PSR
+        * is also supported.
+        */
+       adev_to_drm(adev)->vblank_disable_immediate = !psr_feature_enabled;
+
         /* Software is initialized. Now we can register interrupt handlers. */
         switch (adev->asic_type) {
 #if defined(CONFIG_DRM_AMD_DC_SI)
--
2.25.1


[-- Attachment #2: Type: text/html, Size: 4631 bytes --]

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

* Re: [PATCH] drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled
  2021-11-30 14:53 [PATCH] drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled Nicholas Kazlauskas
  2021-11-30 15:10 ` Deucher, Alexander
@ 2021-11-30 15:21 ` Harry Wentland
  1 sibling, 0 replies; 3+ messages in thread
From: Harry Wentland @ 2021-11-30 15:21 UTC (permalink / raw)
  To: Nicholas Kazlauskas, amd-gfx; +Cc: Alex Deucher

On 2021-11-30 09:53, Nicholas Kazlauskas wrote:
> [Why]
> PSR currently relies on the kernel's delayed vblank on/off mechanism
> as an implicit bufferring mechanism to prevent excessive entry/exit.
> 
> Without this delay the user experience is impacted since it can take
> a few frames to enter/exit.
> 
> [How]
> Only allow vblank disable immediate for DC when psr is not supported.
> 
> Leave a TODO indicating that this support should be extended in the
> future to delay independent of the vblank interrupt.
> 
> Fixes: 3d1508b73ff1 ("drm/amdgpu/display: set vblank_disable_immediate for DC")
> 
> Cc: Harry Wentland <harry.wentland@amd.com>
> Cc: Alex Deucher <alexander.deucher@amd.com>
> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>

Now I'm curious whether vblank_disable_immediate or PSR
save more power.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 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 0747dc7922c2..d582d44c02ad 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -1599,9 +1599,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
>  	adev_to_drm(adev)->mode_config.cursor_width = adev->dm.dc->caps.max_cursor_size;
>  	adev_to_drm(adev)->mode_config.cursor_height = adev->dm.dc->caps.max_cursor_size;
>  
> -	/* Disable vblank IRQs aggressively for power-saving */
> -	adev_to_drm(adev)->vblank_disable_immediate = true;
> -
>  	if (drm_vblank_init(adev_to_drm(adev), adev->dm.display_indexes_num)) {
>  		DRM_ERROR(
>  		"amdgpu: failed to initialize sw for display support.\n");
> @@ -4264,6 +4261,14 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
>  
>  	}
>  
> +	/*
> +	 * Disable vblank IRQs aggressively for power-saving.
> +	 *
> +	 * TODO: Fix vblank control helpers to delay PSR entry to allow this when PSR
> +	 * is also supported.
> +	 */
> +	adev_to_drm(adev)->vblank_disable_immediate = !psr_feature_enabled;
> +
>  	/* Software is initialized. Now we can register interrupt handlers. */
>  	switch (adev->asic_type) {
>  #if defined(CONFIG_DRM_AMD_DC_SI)
> 


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

end of thread, other threads:[~2021-11-30 15:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-30 14:53 [PATCH] drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled Nicholas Kazlauskas
2021-11-30 15:10 ` Deucher, Alexander
2021-11-30 15:21 ` Harry Wentland

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.