diff mbox series

[RESEND] drm/self_refresh: Don't trigger the entry timer for self refresh work if CRTC state is inactive

Message ID 20220207054617.987811-1-victor.liu@nxp.com (mailing list archive)
State New, archived
Headers show
Series [RESEND] drm/self_refresh: Don't trigger the entry timer for self refresh work if CRTC state is inactive | expand

Commit Message

Liu Ying Feb. 7, 2022, 5:46 a.m. UTC
If the CRTC state is already inactive, it doesn't make sense to trigger
the entry timer for self refresh work to make the display enter self
refresh mode, because the disabled CRTC hints that either the entire
display pipeline is disabled or the previous atomic commit is triggered
by the self refresh work(the CRTC is disabled, while the relevant encoder
and bridges could be disabled or not depending on the drivers).

Cc: Rob Clark <robdclark@chromium.org>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: Zain Wang <wzz@rock-chips.com>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
 drivers/gpu/drm/drm_self_refresh_helper.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Liu Ying March 7, 2022, 2:33 a.m. UTC | #1
On Mon, 2022-02-07 at 13:46 +0800, Liu Ying wrote:
> If the CRTC state is already inactive, it doesn't make sense to trigger
> the entry timer for self refresh work to make the display enter self
> refresh mode, because the disabled CRTC hints that either the entire
> display pipeline is disabled or the previous atomic commit is triggered
> by the self refresh work(the CRTC is disabled, while the relevant encoder
> and bridges could be disabled or not depending on the drivers).
> 
> Cc: Rob Clark <robdclark@chromium.org>
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: Zain Wang <wzz@rock-chips.com>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Maxime Ripard <mripard@kernel.org>
> Cc: Thomas Zimmermann <tzimmermann@suse.de>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> Signed-off-by: Liu Ying <victor.liu@nxp.com>

Gentle ping...

Thanks,
Liu Ying

> ---
>  drivers/gpu/drm/drm_self_refresh_helper.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_self_refresh_helper.c b/drivers/gpu/drm/drm_self_refresh_helper.c
> index dd33fec5aabd..e76eb3cd22c7 100644
> --- a/drivers/gpu/drm/drm_self_refresh_helper.c
> +++ b/drivers/gpu/drm/drm_self_refresh_helper.c
> @@ -204,8 +204,12 @@ void drm_self_refresh_helper_alter_state(struct drm_atomic_state *state)
>  		struct drm_self_refresh_data *sr_data;
>  		unsigned int delay;
>  
> -		/* Don't trigger the entry timer when we're already in SR */
> -		if (crtc_state->self_refresh_active)
> +		/*
> +		 * Don't trigger the entry timer when we're already inactive.
> +		 * Note that the inactive state hints that either we're already
> +		 * in SR or the entire display pipeline is already disabled.
> +		 */
> +		if (!crtc_state->active)
>  			continue;
>  
>  		sr_data = crtc->self_refresh_data;
diff mbox series

Patch

diff --git a/drivers/gpu/drm/drm_self_refresh_helper.c b/drivers/gpu/drm/drm_self_refresh_helper.c
index dd33fec5aabd..e76eb3cd22c7 100644
--- a/drivers/gpu/drm/drm_self_refresh_helper.c
+++ b/drivers/gpu/drm/drm_self_refresh_helper.c
@@ -204,8 +204,12 @@  void drm_self_refresh_helper_alter_state(struct drm_atomic_state *state)
 		struct drm_self_refresh_data *sr_data;
 		unsigned int delay;
 
-		/* Don't trigger the entry timer when we're already in SR */
-		if (crtc_state->self_refresh_active)
+		/*
+		 * Don't trigger the entry timer when we're already inactive.
+		 * Note that the inactive state hints that either we're already
+		 * in SR or the entire display pipeline is already disabled.
+		 */
+		if (!crtc_state->active)
 			continue;
 
 		sr_data = crtc->self_refresh_data;