]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/display: move xe->display initialization to xe_display_probe()
authorJani Nikula <jani.nikula@intel.com>
Fri, 16 May 2025 12:16:58 +0000 (15:16 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 20 May 2025 17:55:22 +0000 (20:55 +0300)
The future goal is to have intel_display_device_probe() create struct
intel_display. As the first step, postpone xe->display initialization
right before that call. This is the same location as in i915.

There's a subtle functional change here: xe->display will now be
initialized only if xe->info.probe_display.

The xe_display_create() function becomes empty, and can be removed. Move
its documentation to xe_display_probe()

Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://lore.kernel.org/r/6c3075739d84cecea258d686c3ef38455a61191c.1747397638.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/xe/display/xe_display.c
drivers/gpu/drm/xe/display/xe_display.h
drivers/gpu/drm/xe/xe_device.c

index b0f5624177bdb7cf3b7a0bd6658ad2a67034bbf2..c35444637620fd74a6f46ef07df298942e0e4665 100644 (file)
@@ -83,25 +83,6 @@ static void unset_display_features(struct xe_device *xe)
        xe->drm.driver_features &= ~(DRIVER_MODESET | DRIVER_ATOMIC);
 }
 
-/**
- * xe_display_create - create display struct
- * @xe: XE device instance
- *
- * Initialize all fields used by the display part.
- *
- * TODO: once everything can be inside a single struct, make the struct opaque
- * to the rest of xe and return it to be xe->display.
- *
- * Returns: 0 on success
- */
-int xe_display_create(struct xe_device *xe)
-{
-       /* TODO: Allocate display dynamically. */
-       xe->display = &xe->__display;
-
-       return 0;
-}
-
 static void xe_display_fini_early(void *arg)
 {
        struct xe_device *xe = arg;
@@ -524,6 +505,17 @@ static void display_device_remove(struct drm_device *dev, void *arg)
        intel_display_device_remove(display);
 }
 
+/**
+ * xe_display_probe - probe display and create display struct
+ * @xe: XE device instance
+ *
+ * Initialize all fields used by the display part.
+ *
+ * TODO: once everything can be inside a single struct, make the struct opaque
+ * to the rest of xe and return it to be xe->display.
+ *
+ * Returns: 0 on success
+ */
 int xe_display_probe(struct xe_device *xe)
 {
        struct pci_dev *pdev = to_pci_dev(xe->drm.dev);
@@ -533,6 +525,9 @@ int xe_display_probe(struct xe_device *xe)
        if (!xe->info.probe_display)
                goto no_display;
 
+       /* TODO: Allocate display dynamically. */
+       xe->display = &xe->__display;
+
        display = intel_display_device_probe(pdev);
 
        err = drmm_add_action_or_reset(&xe->drm, display_device_remove, display);
index 46e14f8dee28af6f7db93ea1261caa753f84aaa4..e533aa4750bc11bfaf9a2b81e2dd8c1ac6ee58bc 100644 (file)
@@ -15,8 +15,6 @@ struct drm_driver;
 bool xe_display_driver_probe_defer(struct pci_dev *pdev);
 void xe_display_driver_set_hooks(struct drm_driver *driver);
 
-int xe_display_create(struct xe_device *xe);
-
 int xe_display_probe(struct xe_device *xe);
 
 int xe_display_init_early(struct xe_device *xe);
@@ -46,8 +44,6 @@ static inline int xe_display_driver_probe_defer(struct pci_dev *pdev) { return 0
 static inline void xe_display_driver_set_hooks(struct drm_driver *driver) { }
 static inline void xe_display_driver_remove(struct xe_device *xe) {}
 
-static inline int xe_display_create(struct xe_device *xe) { return 0; }
-
 static inline int xe_display_probe(struct xe_device *xe) { return 0; }
 
 static inline int xe_display_init_early(struct xe_device *xe) { return 0; }
index c02c4c4e941286a13384b3a1d71649911c49a27a..b615d8ed38a21b1c301b69c5d206ae99f8df8639 100644 (file)
@@ -493,10 +493,6 @@ struct xe_device *xe_device_create(struct pci_dev *pdev,
        if (err)
                goto err;
 
-       err = xe_display_create(xe);
-       if (WARN_ON(err))
-               goto err;
-
        return xe;
 
 err: