linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RESEND] drm/self_refresh: Don't trigger the entry timer for self refresh work if CRTC state is inactive
@ 2022-02-07  5:46 Liu Ying
  2022-03-07  2:33 ` Liu Ying
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Ying @ 2022-02-07  5:46 UTC (permalink / raw)
  To: dri-devel, linux-kernel
  Cc: linux-imx, Rob Clark, Sean Paul, Zain Wang, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter

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(-)

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;
-- 
2.25.1


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

* Re: [PATCH RESEND] drm/self_refresh: Don't trigger the entry timer for self refresh work if CRTC state is inactive
  2022-02-07  5:46 [PATCH RESEND] drm/self_refresh: Don't trigger the entry timer for self refresh work if CRTC state is inactive Liu Ying
@ 2022-03-07  2:33 ` Liu Ying
  0 siblings, 0 replies; 2+ messages in thread
From: Liu Ying @ 2022-03-07  2:33 UTC (permalink / raw)
  To: dri-devel, linux-kernel
  Cc: linux-imx, Rob Clark, Sean Paul, Zain Wang, Maarten Lankhorst,
	Maxime Ripard, Thomas Zimmermann, David Airlie, Daniel Vetter

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;


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

end of thread, other threads:[~2022-03-07  2:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07  5:46 [PATCH RESEND] drm/self_refresh: Don't trigger the entry timer for self refresh work if CRTC state is inactive Liu Ying
2022-03-07  2:33 ` Liu Ying

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).