From: Jani Nikula <jani.nikula@intel.com>
To: Imre Deak <imre.deak@intel.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH v2 2/3] drm/i915: Pass intel_display to the encoder suspend/shutdown helpers
Date: Tue, 18 Jun 2024 16:48:33 +0300 [thread overview]
Message-ID: <87wmmmfjke.fsf@intel.com> (raw)
In-Reply-To: <20240618125255.4080303-2-imre.deak@intel.com>
On Tue, 18 Jun 2024, Imre Deak <imre.deak@intel.com> wrote:
> Pass intel_display to the encoder suspend/shutdown helpers instead of
> drm_i915_private for better isolation.
>
> v2: Pass intel_display to HAS_DISPLAY() as well, update commit log
> accordingly. (Jani)
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> # v1
> Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_encoder.c | 24 ++++++++++----------
> drivers/gpu/drm/i915/display/intel_encoder.h | 6 ++---
> drivers/gpu/drm/i915/i915_driver.c | 6 ++---
> 3 files changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_encoder.c b/drivers/gpu/drm/i915/display/intel_encoder.c
> index 8a1dccb893a37..21d6385354972 100644
> --- a/drivers/gpu/drm/i915/display/intel_encoder.c
> +++ b/drivers/gpu/drm/i915/display/intel_encoder.c
> @@ -38,46 +38,46 @@ void intel_encoder_link_check_queue_work(struct intel_encoder *encoder, int dela
> &encoder->link_check_work, msecs_to_jiffies(delay_ms));
> }
>
> -void intel_encoder_suspend_all(struct drm_i915_private *i915)
> +void intel_encoder_suspend_all(struct intel_display *display)
> {
> struct intel_encoder *encoder;
>
> - if (!HAS_DISPLAY(i915))
> + if (!HAS_DISPLAY(display))
> return;
>
> /*
> * TODO: check and remove holding the modeset locks if none of
> * the encoders depends on this.
> */
> - drm_modeset_lock_all(&i915->drm);
> - for_each_intel_encoder(&i915->drm, encoder)
> + drm_modeset_lock_all(display->drm);
> + for_each_intel_encoder(display->drm, encoder)
> if (encoder->suspend)
> encoder->suspend(encoder);
> - drm_modeset_unlock_all(&i915->drm);
> + drm_modeset_unlock_all(display->drm);
>
> - for_each_intel_encoder(&i915->drm, encoder)
> + for_each_intel_encoder(display->drm, encoder)
> if (encoder->suspend_complete)
> encoder->suspend_complete(encoder);
> }
>
> -void intel_encoder_shutdown_all(struct drm_i915_private *i915)
> +void intel_encoder_shutdown_all(struct intel_display *display)
> {
> struct intel_encoder *encoder;
>
> - if (!HAS_DISPLAY(i915))
> + if (!HAS_DISPLAY(display))
> return;
>
> /*
> * TODO: check and remove holding the modeset locks if none of
> * the encoders depends on this.
> */
> - drm_modeset_lock_all(&i915->drm);
> - for_each_intel_encoder(&i915->drm, encoder)
> + drm_modeset_lock_all(display->drm);
> + for_each_intel_encoder(display->drm, encoder)
> if (encoder->shutdown)
> encoder->shutdown(encoder);
> - drm_modeset_unlock_all(&i915->drm);
> + drm_modeset_unlock_all(display->drm);
>
> - for_each_intel_encoder(&i915->drm, encoder)
> + for_each_intel_encoder(display->drm, encoder)
> if (encoder->shutdown_complete)
> encoder->shutdown_complete(encoder);
> }
> diff --git a/drivers/gpu/drm/i915/display/intel_encoder.h b/drivers/gpu/drm/i915/display/intel_encoder.h
> index 04cfc0a721993..3fa5589f0b1ce 100644
> --- a/drivers/gpu/drm/i915/display/intel_encoder.h
> +++ b/drivers/gpu/drm/i915/display/intel_encoder.h
> @@ -6,7 +6,7 @@
> #ifndef __INTEL_ENCODER_H__
> #define __INTEL_ENCODER_H__
>
> -struct drm_i915_private;
> +struct intel_display;
> struct intel_encoder;
>
> void intel_encoder_link_check_init(struct intel_encoder *encoder,
> @@ -14,7 +14,7 @@ void intel_encoder_link_check_init(struct intel_encoder *encoder,
> void intel_encoder_link_check_queue_work(struct intel_encoder *encoder, int delay_ms);
> void intel_encoder_link_check_flush_work(struct intel_encoder *encoder);
>
> -void intel_encoder_suspend_all(struct drm_i915_private *i915);
> -void intel_encoder_shutdown_all(struct drm_i915_private *i915);
> +void intel_encoder_suspend_all(struct intel_display *display);
> +void intel_encoder_shutdown_all(struct intel_display *display);
>
> #endif /* __INTEL_ENCODER_H__ */
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index e9e38ed246f66..fb8e9c2fcea53 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -956,8 +956,8 @@ void i915_driver_shutdown(struct drm_i915_private *i915)
> if (HAS_DISPLAY(i915))
> intel_display_driver_suspend_access(i915);
>
> - intel_encoder_suspend_all(i915);
> - intel_encoder_shutdown_all(i915);
> + intel_encoder_suspend_all(&i915->display);
> + intel_encoder_shutdown_all(&i915->display);
>
> intel_dmc_suspend(i915);
>
> @@ -1040,7 +1040,7 @@ static int i915_drm_suspend(struct drm_device *dev)
> if (HAS_DISPLAY(dev_priv))
> intel_display_driver_suspend_access(dev_priv);
>
> - intel_encoder_suspend_all(dev_priv);
> + intel_encoder_suspend_all(&dev_priv->display);
>
> /* Must be called before GGTT is suspended. */
> intel_dpt_suspend(dev_priv);
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-06-18 13:48 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 12:52 [PATCH v2 1/3] drm/i915: Move encoder suspend/shutdown helpers to intel_encoder.c Imre Deak
2024-06-18 12:52 ` [PATCH v2 2/3] drm/i915: Pass intel_display to the encoder suspend/shutdown helpers Imre Deak
2024-06-18 13:48 ` Jani Nikula [this message]
2024-06-18 12:52 ` [PATCH v2 3/3] drm/xe: Use the encoder suspend helper also used by the i915 driver Imre Deak
2024-06-18 13:49 ` Jani Nikula
2024-06-18 12:57 ` ✓ CI.Patch_applied: success for series starting with [v2,1/3] drm/i915: Move encoder suspend/shutdown helpers to intel_encoder.c Patchwork
2024-06-18 12:57 ` ✓ CI.checkpatch: " Patchwork
2024-06-18 12:58 ` ✓ CI.KUnit: " Patchwork
2024-06-18 13:10 ` ✓ CI.Build: " Patchwork
2024-06-18 13:12 ` ✗ CI.Hooks: failure " Patchwork
2024-06-18 13:14 ` ✗ CI.checksparse: warning " Patchwork
2024-06-18 13:20 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-06-18 13:30 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-06-18 13:57 ` Imre Deak
2024-06-18 13:35 ` ✓ CI.BAT: success " Patchwork
2024-06-19 1:44 ` ✗ CI.FULL: failure " Patchwork
2024-06-20 4:59 ` ✓ Fi.CI.BAT: success " Patchwork
2024-06-20 8:28 ` ✓ Fi.CI.IGT: " Patchwork
2024-06-20 17:01 ` Imre Deak
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=87wmmmfjke.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=rodrigo.vivi@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 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.