Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>
Cc: <intel-xe@lists.freedesktop.org>,
	<intel-gfx@lists.freedesktop.org>,
	"Luca Coelho" <luciano.coelho@intel.com>
Subject: Re: [PATCH v2 2/3] drm/xe/display: Extract xe_display_pm_runtime_suspend_late()
Date: Fri, 29 Nov 2024 13:25:53 -0500	[thread overview]
Message-ID: <Z0oHMXwLIPaqGsGa@intel.com> (raw)
In-Reply-To: <20241129164010.29887-3-gustavo.sousa@intel.com>

On Fri, Nov 29, 2024 at 01:37:55PM -0300, Gustavo Sousa wrote:
> The current behavior for the runtime suspend case is that
> xe_display_pm_suspend_late() is only called when D3cold is allowed.
> Let's incorporate that behavior into a function specific to runtime PM
> and call it xe_display_pm_runtime_suspend_late().
> 
> With that, we keep stuff a bit more self-contained and allow having a
> place for adding more "late display runtime suspend"-related logic that
> isn't dependent on the "D3cold allowed" state.
> 
> v2:
>   - Fix typo in that caused xe_display_pm_runtime_suspend_late() to call
>     itself instead of xe_display_pm_suspend_late().
>   - Add the empty version of xe_display_pm_runtime_suspend_late() for
>     the !CONFIG_DRM_XE_DISPLAY case.
> 
> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> ---
>  drivers/gpu/drm/xe/display/xe_display.c | 9 +++++++++
>  drivers/gpu/drm/xe/display/xe_display.h | 2 ++
>  drivers/gpu/drm/xe/xe_pm.c              | 4 ++--
>  3 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index 69c828f38cb6..739db5b7b01f 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -407,6 +407,15 @@ void xe_display_pm_suspend_late(struct xe_device *xe)
>  	intel_display_power_suspend_late(xe, s2idle);
>  }
>  
> +void xe_display_pm_runtime_suspend_late(struct xe_device *xe)
> +{
> +	if (!xe->info.probe_display)
> +		return;
> +
> +	if (xe->d3cold.allowed)
> +		xe_display_pm_suspend_late(xe);
> +}
> +
>  void xe_display_pm_shutdown_late(struct xe_device *xe)
>  {
>  	if (!xe->info.probe_display)
> diff --git a/drivers/gpu/drm/xe/display/xe_display.h b/drivers/gpu/drm/xe/display/xe_display.h
> index 17afa537aee5..233f81a26c25 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.h
> +++ b/drivers/gpu/drm/xe/display/xe_display.h
> @@ -41,6 +41,7 @@ void xe_display_pm_shutdown_late(struct xe_device *xe);
>  void xe_display_pm_resume_early(struct xe_device *xe);
>  void xe_display_pm_resume(struct xe_device *xe);
>  void xe_display_pm_runtime_suspend(struct xe_device *xe);
> +void xe_display_pm_runtime_suspend_late(struct xe_device *xe);
>  void xe_display_pm_runtime_resume(struct xe_device *xe);
>  
>  #else
> @@ -74,6 +75,7 @@ static inline void xe_display_pm_shutdown_late(struct xe_device *xe) {}
>  static inline void xe_display_pm_resume_early(struct xe_device *xe) {}
>  static inline void xe_display_pm_resume(struct xe_device *xe) {}
>  static inline void xe_display_pm_runtime_suspend(struct xe_device *xe) {}
> +static inline void xe_display_pm_runtime_suspend_late(struct xe_device *xe) {}
>  static inline void xe_display_pm_runtime_resume(struct xe_device *xe) {}
>  
>  #endif /* CONFIG_DRM_XE_DISPLAY */
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index 80699dbeb2e9..a6761cb769b2 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -414,8 +414,8 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
>  
>  	xe_irq_suspend(xe);
>  
> -	if (xe->d3cold.allowed)
> -		xe_display_pm_suspend_late(xe);
> +	xe_display_pm_runtime_suspend_late(xe);
> +
>  out:
>  	if (err)
>  		xe_display_pm_runtime_resume(xe);
> -- 
> 2.47.0
> 

  reply	other threads:[~2024-11-29 18:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 16:37 [PATCH v2 0/3] Flush DMC wakelock release work at the end of runtime suspend Gustavo Sousa
2024-11-29 16:37 ` [PATCH v2 1/3] drm/i915/dmc_wl: Extract intel_dmc_wl_flush_release_work() Gustavo Sousa
2024-11-29 18:25   ` Rodrigo Vivi
2024-11-30 17:09     ` Rodrigo Vivi
2024-11-29 16:37 ` [PATCH v2 2/3] drm/xe/display: Extract xe_display_pm_runtime_suspend_late() Gustavo Sousa
2024-11-29 18:25   ` Rodrigo Vivi [this message]
2024-11-29 16:37 ` [PATCH v2 3/3] drm/xe/display: Flush DMC wakelock release work on runtime suspend Gustavo Sousa
2024-11-29 18:26   ` Rodrigo Vivi
2024-11-29 16:45 ` ✓ CI.Patch_applied: success for Flush DMC wakelock release work at the end of runtime suspend (rev2) Patchwork
2024-11-29 16:45 ` ✓ CI.checkpatch: " Patchwork
2024-11-29 16:46 ` ✓ CI.KUnit: " Patchwork
2024-11-29 17:04 ` ✓ CI.Build: " Patchwork
2024-11-29 17:07 ` ✓ CI.Hooks: " Patchwork
2024-11-29 17:08 ` ✗ CI.checksparse: warning " Patchwork
2024-11-29 17:27 ` ✓ Xe.CI.BAT: success " Patchwork
2024-11-30  3:01 ` ✗ Xe.CI.Full: failure " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z0oHMXwLIPaqGsGa@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=luciano.coelho@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox