Skip to content

Commit f3f6dbf

Browse files
committed
drm/xe/display: Runtime pm wrappers for display parent interface
Implement runtime pm wrappers for xe driver and add them into display parent interface. v3: - drop useless include - drop xe_display_rpm_{get, put}_raw v2: - move xe_display_rpm_interface code into xe_display_rpm.c - rename xe_rpm as xe_display_rpm 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-5-jouni.hogander@intel.com
1 parent 5bef1ba commit f3f6dbf

3 files changed

Lines changed: 79 additions & 0 deletions

File tree

drivers/gpu/drm/xe/display/xe_display.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "intel_hotplug.h"
3636
#include "intel_opregion.h"
3737
#include "skl_watermark.h"
38+
#include "xe_display_rpm.h"
3839
#include "xe_module.h"
3940

4041
/* Ensure drm and display members are placed properly. */
@@ -517,6 +518,7 @@ static void display_device_remove(struct drm_device *dev, void *arg)
517518
}
518519

519520
static const struct intel_display_parent_interface parent = {
521+
.rpm = &xe_display_rpm_interface,
520522
};
521523

522524
/**

drivers/gpu/drm/xe/display/xe_display_rpm.c

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: MIT
22
/* Copyright © 2025 Intel Corporation */
33

4+
#include <drm/intel/display_parent_interface.h>
5+
46
#include "intel_display_core.h"
57
#include "intel_display_rpm.h"
68
#include "xe_device.h"
@@ -71,3 +73,67 @@ void intel_display_rpm_assert_unblock(struct intel_display *display)
7173
{
7274
/* FIXME */
7375
}
76+
77+
static struct ref_tracker *xe_display_rpm_get(const struct drm_device *drm)
78+
{
79+
return xe_pm_runtime_resume_and_get(to_xe_device(drm)) ? INTEL_WAKEREF_DEF : NULL;
80+
}
81+
82+
static struct ref_tracker *xe_display_rpm_get_if_in_use(const struct drm_device *drm)
83+
{
84+
return xe_pm_runtime_get_if_in_use(to_xe_device(drm)) ? INTEL_WAKEREF_DEF : NULL;
85+
}
86+
87+
static struct ref_tracker *xe_display_rpm_get_noresume(const struct drm_device *drm)
88+
{
89+
xe_pm_runtime_get_noresume(to_xe_device(drm));
90+
91+
return INTEL_WAKEREF_DEF;
92+
}
93+
94+
static void xe_display_rpm_put(const struct drm_device *drm, struct ref_tracker *wakeref)
95+
{
96+
if (wakeref)
97+
xe_pm_runtime_put(to_xe_device(drm));
98+
}
99+
100+
static void xe_display_rpm_put_unchecked(const struct drm_device *drm)
101+
{
102+
xe_pm_runtime_put(to_xe_device(drm));
103+
}
104+
105+
static bool xe_display_rpm_suspended(const struct drm_device *drm)
106+
{
107+
struct xe_device *xe = to_xe_device(drm);
108+
109+
return pm_runtime_suspended(xe->drm.dev);
110+
}
111+
112+
static void xe_display_rpm_assert_held(const struct drm_device *drm)
113+
{
114+
/* FIXME */
115+
}
116+
117+
static void xe_display_rpm_assert_block(const struct drm_device *drm)
118+
{
119+
/* FIXME */
120+
}
121+
122+
static void xe_display_rpm_assert_unblock(const struct drm_device *drm)
123+
{
124+
/* FIXME */
125+
}
126+
127+
const struct intel_display_rpm_interface xe_display_rpm_interface = {
128+
.get = xe_display_rpm_get,
129+
.get_raw = xe_display_rpm_get,
130+
.get_if_in_use = xe_display_rpm_get_if_in_use,
131+
.get_noresume = xe_display_rpm_get_noresume,
132+
.put = xe_display_rpm_put,
133+
.put_raw = xe_display_rpm_put,
134+
.put_unchecked = xe_display_rpm_put_unchecked,
135+
.suspended = xe_display_rpm_suspended,
136+
.assert_held = xe_display_rpm_assert_held,
137+
.assert_block = xe_display_rpm_assert_block,
138+
.assert_unblock = xe_display_rpm_assert_unblock
139+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* SPDX-License-Identifier: MIT */
2+
/*
3+
* Copyright © 2025 Intel Corporation
4+
*/
5+
6+
#ifndef _XE_DISPLAY_RPM_H_
7+
#define _XE_DISPLAY_RPM_H_
8+
9+
extern const struct intel_display_rpm_interface xe_display_rpm_interface;
10+
11+
#endif /* _XE_DISPLAY_RPM_H_ */

0 commit comments

Comments
 (0)