Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+81
+1
drivers/gpu/drm/i915/i915_driver.c
··· 740 740 } 741 741 742 742 static const struct intel_display_parent_interface parent = { 743 + .rpm = &i915_display_rpm_interface, 743 744 }; 744 745 745 746 const struct intel_display_parent_interface *i915_driver_parent_interface(void)
+77
drivers/gpu/drm/i915/intel_runtime_pm.c
··· 29 29 #include <linux/pm_runtime.h> 30 30 31 31 #include <drm/drm_print.h> 32 + #include <drm/intel/display_parent_interface.h> 32 33 33 34 #include "i915_drv.h" 34 35 #include "i915_trace.h" ··· 177 176 178 177 return track_intel_runtime_pm_wakeref(rpm); 179 178 } 179 + 180 + static struct intel_runtime_pm *drm_to_rpm(const struct drm_device *drm) 181 + { 182 + struct drm_i915_private *i915 = to_i915(drm); 183 + 184 + return &i915->runtime_pm; 185 + } 186 + 187 + static struct ref_tracker *i915_display_rpm_get(const struct drm_device *drm) 188 + { 189 + return intel_runtime_pm_get(drm_to_rpm(drm)); 190 + } 191 + 192 + static struct ref_tracker *i915_display_rpm_get_raw(const struct drm_device *drm) 193 + { 194 + return intel_runtime_pm_get_raw(drm_to_rpm(drm)); 195 + } 196 + 197 + static struct ref_tracker *i915_display_rpm_get_if_in_use(const struct drm_device *drm) 198 + { 199 + return intel_runtime_pm_get_if_in_use(drm_to_rpm(drm)); 200 + } 201 + 202 + static struct ref_tracker *i915_display_rpm_get_noresume(const struct drm_device *drm) 203 + { 204 + return intel_runtime_pm_get_noresume(drm_to_rpm(drm)); 205 + } 206 + 207 + static void i915_display_rpm_put(const struct drm_device *drm, struct ref_tracker *wakeref) 208 + { 209 + intel_runtime_pm_put(drm_to_rpm(drm), wakeref); 210 + } 211 + 212 + static void i915_display_rpm_put_raw(const struct drm_device *drm, struct ref_tracker *wakeref) 213 + { 214 + intel_runtime_pm_put_raw(drm_to_rpm(drm), wakeref); 215 + } 216 + 217 + static void i915_display_rpm_put_unchecked(const struct drm_device *drm) 218 + { 219 + intel_runtime_pm_put_unchecked(drm_to_rpm(drm)); 220 + } 221 + 222 + static bool i915_display_rpm_suspended(const struct drm_device *drm) 223 + { 224 + return intel_runtime_pm_suspended(drm_to_rpm(drm)); 225 + } 226 + 227 + static void i915_display_rpm_assert_held(const struct drm_device *drm) 228 + { 229 + assert_rpm_wakelock_held(drm_to_rpm(drm)); 230 + } 231 + 232 + static void i915_display_rpm_assert_block(const struct drm_device *drm) 233 + { 234 + disable_rpm_wakeref_asserts(drm_to_rpm(drm)); 235 + } 236 + 237 + static void i915_display_rpm_assert_unblock(const struct drm_device *drm) 238 + { 239 + enable_rpm_wakeref_asserts(drm_to_rpm(drm)); 240 + } 241 + 242 + const struct intel_display_rpm_interface i915_display_rpm_interface = { 243 + .get = i915_display_rpm_get, 244 + .get_raw = i915_display_rpm_get_raw, 245 + .get_if_in_use = i915_display_rpm_get_if_in_use, 246 + .get_noresume = i915_display_rpm_get_noresume, 247 + .put = i915_display_rpm_put, 248 + .put_raw = i915_display_rpm_put_raw, 249 + .put_unchecked = i915_display_rpm_put_unchecked, 250 + .suspended = i915_display_rpm_suspended, 251 + .assert_held = i915_display_rpm_assert_held, 252 + .assert_block = i915_display_rpm_assert_block, 253 + .assert_unblock = i915_display_rpm_assert_unblock 254 + }; 180 255 181 256 /** 182 257 * intel_runtime_pm_get_raw - grab a raw runtime pm reference
+3
drivers/gpu/drm/i915/intel_runtime_pm.h
··· 14 14 struct device; 15 15 struct drm_i915_private; 16 16 struct drm_printer; 17 + struct intel_display_rpm_interface; 17 18 18 19 /* 19 20 * This struct helps tracking the state needed for runtime PM, which puts the ··· 226 225 { 227 226 } 228 227 #endif 228 + 229 + extern const struct intel_display_rpm_interface i915_display_rpm_interface; 229 230 230 231 #endif /* __INTEL_RUNTIME_PM_H__ */