From: "Govindapillai, Vinod" <vinod.govindapillai@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"maarten.lankhorst@linux.intel.com"
<maarten.lankhorst@linux.intel.com>
Subject: Re: [PATCH 2/4] drm/xe: Remove runtime argument from display s/r functions
Date: Fri, 6 Sep 2024 09:25:23 +0000 [thread overview]
Message-ID: <a1c60333b0580411b72755ea67f301c2c261e962.camel@intel.com> (raw)
In-Reply-To: <20240905150052.174895-3-maarten.lankhorst@linux.intel.com>
On Thu, 2024-09-05 at 17:00 +0200, Maarten Lankhorst wrote:
> The previous change ensures that pm_suspend is only called when
> suspending or resuming. This ensures no further bugs like those
> in the previous commit.
>
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
> drivers/gpu/drm/xe/display/xe_display.c | 53 +++++++++++++++----------
> drivers/gpu/drm/xe/display/xe_display.h | 8 ++--
> drivers/gpu/drm/xe/xe_pm.c | 6 +--
> 3 files changed, 39 insertions(+), 28 deletions(-)
Nice solution! Thanks
Reviewed-by: Vinod Govindapillai <vinod.govindapillai@intel.com
>
> diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
> index c0e9aa7a274f1..33071ac3bc12d 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.c
> +++ b/drivers/gpu/drm/xe/display/xe_display.c
> @@ -310,18 +310,7 @@ static void xe_display_flush_cleanup_work(struct xe_device *xe)
> }
>
> /* TODO: System and runtime suspend/resume sequences will be sanitized as a follow-up. */
> -void xe_display_pm_runtime_suspend(struct xe_device *xe)
> -{
> - if (!xe->info.probe_display)
> - return;
> -
> - if (xe->d3cold.allowed)
> - xe_display_pm_suspend(xe, true);
> -
> - intel_hpd_poll_enable(xe);
> -}
> -
> -void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
> +static void __xe_display_pm_suspend(struct xe_device *xe, bool runtime)
> {
> struct intel_display *display = &xe->display;
> bool s2idle = suspend_to_idle();
> @@ -356,26 +345,31 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
> intel_dmc_suspend(xe);
> }
>
> -void xe_display_pm_suspend_late(struct xe_device *xe)
> +void xe_display_pm_suspend(struct xe_device *xe)
> +{
> + __xe_display_pm_suspend(xe, false);
> +}
> +
> +void xe_display_pm_runtime_suspend(struct xe_device *xe)
> {
> - bool s2idle = suspend_to_idle();
> if (!xe->info.probe_display)
> return;
>
> - intel_power_domains_suspend(xe, s2idle);
> + if (xe->d3cold.allowed)
> + __xe_display_pm_suspend(xe, true);
>
> - intel_display_power_suspend_late(xe);
> + intel_hpd_poll_enable(xe);
> }
>
> -void xe_display_pm_runtime_resume(struct xe_device *xe)
> +void xe_display_pm_suspend_late(struct xe_device *xe)
> {
> + bool s2idle = suspend_to_idle();
> if (!xe->info.probe_display)
> return;
>
> - intel_hpd_poll_disable(xe);
> + intel_power_domains_suspend(xe, s2idle);
>
> - if (xe->d3cold.allowed)
> - xe_display_pm_resume(xe, true);
> + intel_display_power_suspend_late(xe);
> }
>
> void xe_display_pm_resume_early(struct xe_device *xe)
> @@ -388,7 +382,7 @@ void xe_display_pm_resume_early(struct xe_device *xe)
> intel_power_domains_resume(xe);
> }
>
> -void xe_display_pm_resume(struct xe_device *xe, bool runtime)
> +static void __xe_display_pm_resume(struct xe_device *xe, bool runtime)
> {
> struct intel_display *display = &xe->display;
>
> @@ -422,6 +416,23 @@ void xe_display_pm_resume(struct xe_device *xe, bool runtime)
> intel_power_domains_enable(xe);
> }
>
> +void xe_display_pm_resume(struct xe_device *xe)
> +{
> + __xe_display_pm_resume(xe, false);
> +}
> +
> +void xe_display_pm_runtime_resume(struct xe_device *xe)
> +{
> + if (!xe->info.probe_display)
> + return;
> +
> + intel_hpd_poll_disable(xe);
> +
> + if (xe->d3cold.allowed)
> + __xe_display_pm_resume(xe, true);
> +}
> +
> +
> static void display_device_remove(struct drm_device *dev, void *arg)
> {
> struct xe_device *xe = arg;
> diff --git a/drivers/gpu/drm/xe/display/xe_display.h b/drivers/gpu/drm/xe/display/xe_display.h
> index 53d727fd792b4..bed55fd26f304 100644
> --- a/drivers/gpu/drm/xe/display/xe_display.h
> +++ b/drivers/gpu/drm/xe/display/xe_display.h
> @@ -34,10 +34,10 @@ void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir);
> void xe_display_irq_reset(struct xe_device *xe);
> void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt);
>
> -void xe_display_pm_suspend(struct xe_device *xe, bool runtime);
> +void xe_display_pm_suspend(struct xe_device *xe);
> void xe_display_pm_suspend_late(struct xe_device *xe);
> void xe_display_pm_resume_early(struct xe_device *xe);
> -void xe_display_pm_resume(struct xe_device *xe, bool runtime);
> +void xe_display_pm_resume(struct xe_device *xe);
> void xe_display_pm_runtime_suspend(struct xe_device *xe);
> void xe_display_pm_runtime_resume(struct xe_device *xe);
>
> @@ -65,10 +65,10 @@ static inline void xe_display_irq_enable(struct xe_device *xe, u32
> gu_misc_iir)
> static inline void xe_display_irq_reset(struct xe_device *xe) {}
> static inline void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt) {}
>
> -static inline void xe_display_pm_suspend(struct xe_device *xe, bool runtime) {}
> +static inline void xe_display_pm_suspend(struct xe_device *xe) {}
> static inline void xe_display_pm_suspend_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, bool runtime) {}
> +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_resume(struct xe_device *xe) {}
>
> diff --git a/drivers/gpu/drm/xe/xe_pm.c b/drivers/gpu/drm/xe/xe_pm.c
> index 9b1204db12c3d..960ed50e3a41b 100644
> --- a/drivers/gpu/drm/xe/xe_pm.c
> +++ b/drivers/gpu/drm/xe/xe_pm.c
> @@ -123,7 +123,7 @@ int xe_pm_suspend(struct xe_device *xe)
> for_each_gt(gt, xe, id)
> xe_gt_suspend_prepare(gt);
>
> - xe_display_pm_suspend(xe, false);
> + xe_display_pm_suspend(xe);
>
> /* FIXME: Super racey... */
> err = xe_bo_evict_all(xe);
> @@ -133,7 +133,7 @@ int xe_pm_suspend(struct xe_device *xe)
> for_each_gt(gt, xe, id) {
> err = xe_gt_suspend(gt);
> if (err) {
> - xe_display_pm_resume(xe, false);
> + xe_display_pm_resume(xe);
> goto err;
> }
> }
> @@ -187,7 +187,7 @@ int xe_pm_resume(struct xe_device *xe)
> for_each_gt(gt, xe, id)
> xe_gt_resume(gt);
>
> - xe_display_pm_resume(xe, false);
> + xe_display_pm_resume(xe);
>
> err = xe_bo_restore_user(xe);
> if (err)
next prev parent reply other threads:[~2024-09-06 9:25 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-05 15:00 [PATCH 0/4] drm/xe: Implement device shutdown to make kexec work Maarten Lankhorst
2024-09-05 15:00 ` [PATCH 1/4] drm/xe: Fix missing conversion to xe_display_pm_runtime_resume Maarten Lankhorst
2024-09-05 16:36 ` Lucas De Marchi
2024-09-06 5:18 ` Govindapillai, Vinod
2024-09-05 15:00 ` [PATCH 2/4] drm/xe: Remove runtime argument from display s/r functions Maarten Lankhorst
2024-09-05 16:44 ` Lucas De Marchi
2024-09-06 9:45 ` Govindapillai, Vinod
2024-09-06 9:25 ` Govindapillai, Vinod [this message]
2024-09-05 15:00 ` [PATCH 3/4] drm/xe: Wire up device shutdown handler Maarten Lankhorst
2024-09-05 16:52 ` Lucas De Marchi
2024-09-06 13:37 ` Maarten Lankhorst
2024-09-06 15:43 ` Rodrigo Vivi
2024-09-05 15:00 ` [PATCH 4/4] CI-only: Test if FLR is disabled? Maarten Lankhorst
2024-09-05 15:06 ` ✓ CI.Patch_applied: success for drm/xe: Implement device shutdown to make kexec work Patchwork
2024-09-05 15:06 ` ✗ CI.checkpatch: warning " Patchwork
2024-09-05 15:07 ` ✓ CI.KUnit: success " Patchwork
2024-09-05 15:19 ` ✓ CI.Build: " Patchwork
2024-09-05 15:22 ` ✓ CI.Hooks: " Patchwork
2024-09-05 15:23 ` ✓ CI.checksparse: " Patchwork
2024-09-05 15:59 ` ✗ CI.BAT: failure " Patchwork
2024-09-05 17:34 ` [PATCH 0/4] " Jani Nikula
2024-09-06 9:52 ` Maarten Lankhorst
2024-09-06 15:53 ` Rodrigo Vivi
2024-09-09 5:42 ` Aravind Iddamsetty
2024-09-07 16:26 ` ✗ CI.FULL: failure for " 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=a1c60333b0580411b72755ea67f301c2c261e962.camel@intel.com \
--to=vinod.govindapillai@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=maarten.lankhorst@linux.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