diff options
| author | Jouni Högander <jouni.hogander@intel.com> | 2025-10-30 22:28:33 +0200 |
|---|---|---|
| committer | Jouni Högander <jouni.hogander@intel.com> | 2025-11-03 11:55:21 +0200 |
| commit | 5bef1badb34ab5f9c9342b480ae687837acdb527 (patch) | |
| tree | 1090023a9fd9c5a27db579ce6320a736d5927087 /drivers/gpu/drm/i915/intel_runtime_pm.c | |
| parent | 1914d6861b594dde7cbb359ab1ba43f2e3a82f91 (diff) | |
drm/i915/display: Runtime pm wrappers for display parent interface
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
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jouni Högander <jouni.hogander@intel.com>
Link: https://patch.msgid.link/20251030202836.1815680-4-jouni.hogander@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_runtime_pm.c')
| -rw-r--r-- | drivers/gpu/drm/i915/intel_runtime_pm.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index 7ce3e6de0c19..d11c2814b787 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 |