1 // SPDX-License-Identifier: MIT 2 /* Copyright © 2025 Intel Corporation */ 3 4 #include "i915_drv.h" 5 #include "intel_display_rpm.h" 6 #include "intel_runtime_pm.h" 7 8 static struct intel_runtime_pm *display_to_rpm(struct intel_display *display) 9 { 10 struct drm_i915_private *i915 = to_i915(display->drm); 11 12 return &i915->runtime_pm; 13 } 14 15 struct ref_tracker *intel_display_rpm_get_raw(struct intel_display *display) 16 { 17 return intel_runtime_pm_get_raw(display_to_rpm(display)); 18 } 19 20 void intel_display_rpm_put_raw(struct intel_display *display, struct ref_tracker *wakeref) 21 { 22 intel_runtime_pm_put_raw(display_to_rpm(display), wakeref); 23 } 24 25 struct ref_tracker *intel_display_rpm_get(struct intel_display *display) 26 { 27 return intel_runtime_pm_get(display_to_rpm(display)); 28 } 29 30 struct ref_tracker *intel_display_rpm_get_if_in_use(struct intel_display *display) 31 { 32 return intel_runtime_pm_get_if_in_use(display_to_rpm(display)); 33 } 34 35 struct ref_tracker *intel_display_rpm_get_noresume(struct intel_display *display) 36 { 37 return intel_runtime_pm_get_noresume(display_to_rpm(display)); 38 } 39 40 void intel_display_rpm_put(struct intel_display *display, struct ref_tracker *wakeref) 41 { 42 intel_runtime_pm_put(display_to_rpm(display), wakeref); 43 } 44 45 void intel_display_rpm_put_unchecked(struct intel_display *display) 46 { 47 intel_runtime_pm_put_unchecked(display_to_rpm(display)); 48 } 49 50 bool intel_display_rpm_suspended(struct intel_display *display) 51 { 52 return intel_runtime_pm_suspended(display_to_rpm(display)); 53 } 54 55 void assert_display_rpm_held(struct intel_display *display) 56 { 57 assert_rpm_wakelock_held(display_to_rpm(display)); 58 } 59 60 void intel_display_rpm_assert_block(struct intel_display *display) 61 { 62 disable_rpm_wakeref_asserts(display_to_rpm(display)); 63 } 64 65 void intel_display_rpm_assert_unblock(struct intel_display *display) 66 { 67 enable_rpm_wakeref_asserts(display_to_rpm(display)); 68 } 69