[PATCH 2/4] drm/xe/display: do not reference xe->display inline

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


Always use a local variable for display instead of referencing
xe->display inline. This makes it easier to convert xe->display into a
pointer.

Signed-off-by: Jani Nikula <jani.nikula at intel.com>
---
 drivers/gpu/drm/xe/display/xe_display.c | 15 ++++++++++-----
 drivers/gpu/drm/xe/display/xe_fb_pin.c  |  5 +++--
 2 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
index 68f064f33d4b..b8030492fbd1 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -38,7 +38,9 @@
 
 static bool has_display(struct xe_device *xe)
 {
-	return HAS_DISPLAY(&xe->display);
+	struct intel_display *display = &xe->display;
+
+	return HAS_DISPLAY(display);
 }
 
 /**
@@ -84,8 +86,9 @@ static void unset_display_features(struct xe_device *xe)
 static void display_destroy(struct drm_device *dev, void *dummy)
 {
 	struct xe_device *xe = to_xe_device(dev);
+	struct intel_display *display = &xe->display;
 
-	destroy_workqueue(xe->display.hotplug.dp_wq);
+	destroy_workqueue(display->hotplug.dp_wq);
 }
 
 /**
@@ -101,9 +104,11 @@ static void display_destroy(struct drm_device *dev, void *dummy)
  */
 int xe_display_create(struct xe_device *xe)
 {
-	spin_lock_init(&xe->display.fb_tracking.lock);
+	struct intel_display *display = &xe->display;
+
+	spin_lock_init(&display->fb_tracking.lock);
 
-	xe->display.hotplug.dp_wq = alloc_ordered_workqueue("xe-dp", 0);
+	display->hotplug.dp_wq = alloc_ordered_workqueue("xe-dp", 0);
 
 	return drmm_add_action_or_reset(&xe->drm, display_destroy, NULL);
 }
@@ -362,7 +367,7 @@ void xe_display_pm_suspend(struct xe_device *xe)
 
 	if (has_display(xe)) {
 		intel_display_driver_suspend_access(display);
-		intel_encoder_suspend_all(&xe->display);
+		intel_encoder_suspend_all(display);
 	}
 
 	intel_opregion_suspend(display, s2idle ? PCI_D1 : PCI_D3cold);
diff --git a/drivers/gpu/drm/xe/display/xe_fb_pin.c b/drivers/gpu/drm/xe/display/xe_fb_pin.c
index d918ae1c8061..e95ca979e1fe 100644
--- a/drivers/gpu/drm/xe/display/xe_fb_pin.c
+++ b/drivers/gpu/drm/xe/display/xe_fb_pin.c
@@ -389,6 +389,7 @@ static bool reuse_vma(struct intel_plane_state *new_plane_state,
 {
 	struct intel_framebuffer *fb = to_intel_framebuffer(new_plane_state->hw.fb);
 	struct xe_device *xe = to_xe_device(fb->base.dev);
+	struct intel_display *display = &xe->display;
 	struct i915_vma *vma;
 
 	if (old_plane_state->hw.fb == new_plane_state->hw.fb &&
@@ -399,8 +400,8 @@ static bool reuse_vma(struct intel_plane_state *new_plane_state,
 		goto found;
 	}
 
-	if (fb == intel_fbdev_framebuffer(xe->display.fbdev.fbdev)) {
-		vma = intel_fbdev_vma_pointer(xe->display.fbdev.fbdev);
+	if (fb == intel_fbdev_framebuffer(display->fbdev.fbdev)) {
+		vma = intel_fbdev_vma_pointer(display->fbdev.fbdev);
 		if (vma)
 			goto found;
 	}
-- 
2.39.5



More information about the Intel-xe mailing list