Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: "Jouni Högander" <jouni.hogander@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: "Jouni Högander" <jouni.hogander@intel.com>
Subject: Re: [PATCH v2 3/6] drm/i915/display: Runtime pm wrappers for display parent interface
Date: Fri, 24 Oct 2025 15:26:07 +0300	[thread overview]
Message-ID: <04c1acfe903a57791b792d0a6b2699df278e7ffc@intel.com> (raw)
In-Reply-To: <20251024093113.1119070-4-jouni.hogander@intel.com>

On Fri, 24 Oct 2025, Jouni Högander <jouni.hogander@intel.com> wrote:
> Implement runtime pm wrappers for i915 driver and add them into display
> parent interface.
>
> v2:
>   - move i915 display rpm interface implementation to intel_runtime_pm.c
>   - rename intel_display as i915_display
>
> Signed-off-by: Jouni Högander <jouni.hogander@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  drivers/gpu/drm/i915/i915_driver.c      |  1 +
>  drivers/gpu/drm/i915/intel_runtime_pm.c | 77 +++++++++++++++++++++++++
>  drivers/gpu/drm/i915/intel_runtime_pm.h |  3 +
>  3 files changed, 81 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
> index b295326eb4331..c97b767719176 100644
> --- a/drivers/gpu/drm/i915/i915_driver.c
> +++ b/drivers/gpu/drm/i915/i915_driver.c
> @@ -740,6 +740,7 @@ static void i915_welcome_messages(struct drm_i915_private *dev_priv)
>  }
>  
>  static const struct intel_display_parent_interface parent = {
> +	.rpm = &i915_display_rpm_interface,
>  };
>  
>  const struct intel_display_parent_interface *i915_driver_parent_interface(void)
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c
> index 7ce3e6de0c197..d11c2814b787b 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.c
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c
> @@ -29,6 +29,7 @@
>  #include <linux/pm_runtime.h>
>  
>  #include <drm/drm_print.h>
> +#include <drm/intel/display_parent_interface.h>
>  
>  #include "i915_drv.h"
>  #include "i915_trace.h"
> @@ -177,6 +178,82 @@ static intel_wakeref_t __intel_runtime_pm_get(struct intel_runtime_pm *rpm,
>  	return track_intel_runtime_pm_wakeref(rpm);
>  }
>  
> +static struct intel_runtime_pm *drm_to_rpm(const struct drm_device *drm)
> +{
> +	struct drm_i915_private *i915 = to_i915(drm);
> +
> +	return &i915->runtime_pm;
> +}
> +
> +static struct ref_tracker *i915_display_rpm_get(const struct drm_device *drm)
> +{
> +	return intel_runtime_pm_get(drm_to_rpm(drm));
> +}
> +
> +static struct ref_tracker *i915_display_rpm_get_raw(const struct drm_device *drm)
> +{
> +	return intel_runtime_pm_get_raw(drm_to_rpm(drm));
> +}
> +
> +static struct ref_tracker *i915_display_rpm_get_if_in_use(const struct drm_device *drm)
> +{
> +	return intel_runtime_pm_get_if_in_use(drm_to_rpm(drm));
> +}
> +
> +static struct ref_tracker *i915_display_rpm_get_noresume(const struct drm_device *drm)
> +{
> +	return intel_runtime_pm_get_noresume(drm_to_rpm(drm));
> +}
> +
> +static void i915_display_rpm_put(const struct drm_device *drm, struct ref_tracker *wakeref)
> +{
> +	intel_runtime_pm_put(drm_to_rpm(drm), wakeref);
> +}
> +
> +static void i915_display_rpm_put_raw(const struct drm_device *drm, struct ref_tracker *wakeref)
> +{
> +	intel_runtime_pm_put_raw(drm_to_rpm(drm), wakeref);
> +}
> +
> +static void i915_display_rpm_put_unchecked(const struct drm_device *drm)
> +{
> +	intel_runtime_pm_put_unchecked(drm_to_rpm(drm));
> +}
> +
> +static bool i915_display_rpm_suspended(const struct drm_device *drm)
> +{
> +	return intel_runtime_pm_suspended(drm_to_rpm(drm));
> +}
> +
> +static void i915_display_rpm_assert_held(const struct drm_device *drm)
> +{
> +	assert_rpm_wakelock_held(drm_to_rpm(drm));
> +}
> +
> +static void i915_display_rpm_assert_block(const struct drm_device *drm)
> +{
> +	disable_rpm_wakeref_asserts(drm_to_rpm(drm));
> +}
> +
> +static void i915_display_rpm_assert_unblock(const struct drm_device *drm)
> +{
> +	enable_rpm_wakeref_asserts(drm_to_rpm(drm));
> +}
> +
> +const struct intel_display_rpm_interface i915_display_rpm_interface = {
> +	.get = i915_display_rpm_get,
> +	.get_raw = i915_display_rpm_get_raw,
> +	.get_if_in_use = i915_display_rpm_get_if_in_use,
> +	.get_noresume = i915_display_rpm_get_noresume,
> +	.put = i915_display_rpm_put,
> +	.put_raw = i915_display_rpm_put_raw,
> +	.put_unchecked = i915_display_rpm_put_unchecked,
> +	.suspended = i915_display_rpm_suspended,
> +	.assert_held = i915_display_rpm_assert_held,
> +	.assert_block = i915_display_rpm_assert_block,
> +	.assert_unblock = i915_display_rpm_assert_unblock
> +};
> +
>  /**
>   * intel_runtime_pm_get_raw - grab a raw runtime pm reference
>   * @rpm: the intel_runtime_pm structure
> diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.h b/drivers/gpu/drm/i915/intel_runtime_pm.h
> index 7428bd8fa67f4..ed6c43b17f9ae 100644
> --- a/drivers/gpu/drm/i915/intel_runtime_pm.h
> +++ b/drivers/gpu/drm/i915/intel_runtime_pm.h
> @@ -14,6 +14,7 @@
>  struct device;
>  struct drm_i915_private;
>  struct drm_printer;
> +struct intel_display_rpm_interface;
>  
>  /*
>   * This struct helps tracking the state needed for runtime PM, which puts the
> @@ -226,4 +227,6 @@ static inline void print_intel_runtime_pm_wakeref(struct intel_runtime_pm *rpm,
>  }
>  #endif
>  
> +extern const struct intel_display_rpm_interface i915_display_rpm_interface;
> +
>  #endif /* __INTEL_RUNTIME_PM_H__ */

-- 
Jani Nikula, Intel

  reply	other threads:[~2025-10-24 12:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24  9:31 [PATCH v2 0/6] Use display parent interface for runtime pm Jouni Högander
2025-10-24  9:31 ` [PATCH v2 1/6] drm/{i915, xe}/display: pass parent interface to display probe Jouni Högander
2025-10-24 12:25   ` [PATCH v2 1/6] drm/{i915,xe}/display: " Jani Nikula
2025-10-24  9:31 ` [PATCH v2 2/6] drm/{i915, xe}/display: Add display runtime pm parent interface Jouni Högander
2025-10-24 12:25   ` [PATCH v2 2/6] drm/{i915,xe}/display: " Jani Nikula
2025-10-24  9:31 ` [PATCH v2 3/6] drm/i915/display: Runtime pm wrappers for display " Jouni Högander
2025-10-24 12:26   ` Jani Nikula [this message]
2025-10-24  9:31 ` [PATCH v2 4/6] drm/xe/display: " Jouni Högander
2025-10-24 12:27   ` Jani Nikula
2025-10-24 12:31   ` Jani Nikula
2025-10-24  9:31 ` [PATCH v2 5/6] drm/i915/display: Use display parent interface for i915 runtime pm Jouni Högander
2025-10-24 12:28   ` Jani Nikula
2025-10-24  9:31 ` [PATCH v2 6/6] drm/xe/display: Use display parent interface for xe " Jouni Högander
2025-10-24 12:28   ` Jani Nikula
2025-10-24 13:34 ` ✗ i915.CI.BAT: failure for Use display parent interface for runtime pm (rev2) 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=04c1acfe903a57791b792d0a6b2699df278e7ffc@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jouni.hogander@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