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