[PATCH 1/4] drm/xe/rpm: use to_xe_device() instead of container_of

Jani Nikula jani.nikula at intel.com
Wed May 7 09:38:33 UTC 2025


Drop the dependency on display being a sub-struct of xe_device.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/xe/display/xe_display_rpm.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display_rpm.c b/drivers/gpu/drm/xe/display/xe_display_rpm.c
index 1955153aadba..ef76efe42e9f 100644
--- a/drivers/gpu/drm/xe/display/xe_display_rpm.c
+++ b/drivers/gpu/drm/xe/display/xe_display_rpm.c
@@ -2,12 +2,13 @@
 /* Copyright © 2025 Intel Corporation */
 
 #include "intel_display_rpm.h"
+#include "xe_device.h"
 #include "xe_device_types.h"
 #include "xe_pm.h"
 
 static struct xe_device *display_to_xe(struct intel_display *display)
 {
-	return container_of(display, struct xe_device, display);
+	return to_xe_device(display->drm);
 }
 
 struct ref_tracker *intel_display_rpm_get_raw(struct intel_display *display)
-- 
2.39.5



More information about the Intel-xe mailing list