]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915/display: move hotplug.dp_wq init from xe and i915 to display
authorJani Nikula <jani.nikula@intel.com>
Fri, 16 May 2025 12:16:57 +0000 (15:16 +0300)
committerJani Nikula <jani.nikula@intel.com>
Tue, 20 May 2025 17:55:22 +0000 (20:55 +0300)
The workqueue init and destroy belongs in display. Move it.

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

index 581787d0452e605ea01e024a25405ed5209c7cba..2bdafab9b6d00c1d4317b06f18e83fc3e09c13a4 100644 (file)
@@ -243,10 +243,16 @@ int intel_display_driver_probe_noirq(struct intel_display *display)
 
        intel_dmc_init(display);
 
+       display->hotplug.dp_wq = alloc_ordered_workqueue("intel-dp", 0);
+       if (!display->hotplug.dp_wq) {
+               ret = -ENOMEM;
+               goto cleanup_vga_client_pw_domain_dmc;
+       }
+
        display->wq.modeset = alloc_ordered_workqueue("i915_modeset", 0);
        if (!display->wq.modeset) {
                ret = -ENOMEM;
-               goto cleanup_vga_client_pw_domain_dmc;
+               goto cleanup_wq_dp;
        }
 
        display->wq.flip = alloc_workqueue("i915_flip", WQ_HIGHPRI |
@@ -296,6 +302,8 @@ cleanup_wq_flip:
        destroy_workqueue(display->wq.flip);
 cleanup_wq_modeset:
        destroy_workqueue(display->wq.modeset);
+cleanup_wq_dp:
+       destroy_workqueue(display->hotplug.dp_wq);
 cleanup_vga_client_pw_domain_dmc:
        intel_dmc_fini(display);
        intel_power_domains_driver_remove(display);
@@ -631,6 +639,7 @@ void intel_display_driver_remove_noirq(struct intel_display *display)
 
        intel_gmbus_teardown(display);
 
+       destroy_workqueue(display->hotplug.dp_wq);
        destroy_workqueue(display->wq.flip);
        destroy_workqueue(display->wq.modeset);
        destroy_workqueue(display->wq.cleanup);
index 5c69d14a7673e632adc8ca7735355fefaa6fcdce..950b7ad8d675f55bf654ac9183dfb358846a7105 100644 (file)
@@ -115,8 +115,6 @@ static const struct drm_driver i915_drm_driver;
 
 static int i915_workqueues_init(struct drm_i915_private *dev_priv)
 {
-       struct intel_display *display = dev_priv->display;
-
        /*
         * The i915 workqueue is primarily used for batched retirement of
         * requests (and thus managing bo) once the task has been completed
@@ -135,10 +133,6 @@ static int i915_workqueues_init(struct drm_i915_private *dev_priv)
        if (dev_priv->wq == NULL)
                goto out_err;
 
-       display->hotplug.dp_wq = alloc_ordered_workqueue("i915-dp", 0);
-       if (!display->hotplug.dp_wq)
-               goto out_free_wq;
-
        /*
         * The unordered i915 workqueue should be used for all work
         * scheduling that do not require running in order, which used
@@ -147,12 +141,10 @@ static int i915_workqueues_init(struct drm_i915_private *dev_priv)
         */
        dev_priv->unordered_wq = alloc_workqueue("i915-unordered", 0, 0);
        if (dev_priv->unordered_wq == NULL)
-               goto out_free_dp_wq;
+               goto out_free_wq;
 
        return 0;
 
-out_free_dp_wq:
-       destroy_workqueue(display->hotplug.dp_wq);
 out_free_wq:
        destroy_workqueue(dev_priv->wq);
 out_err:
@@ -163,10 +155,7 @@ out_err:
 
 static void i915_workqueues_cleanup(struct drm_i915_private *dev_priv)
 {
-       struct intel_display *display = dev_priv->display;
-
        destroy_workqueue(dev_priv->unordered_wq);
-       destroy_workqueue(display->hotplug.dp_wq);
        destroy_workqueue(dev_priv->wq);
 }
 
index 9513b03847a8282f80a352b0c8cfb43cba2417d5..b0f5624177bdb7cf3b7a0bd6658ad2a67034bbf2 100644 (file)
@@ -83,14 +83,6 @@ static void unset_display_features(struct xe_device *xe)
        xe->drm.driver_features &= ~(DRIVER_MODESET | DRIVER_ATOMIC);
 }
 
-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(display->hotplug.dp_wq);
-}
-
 /**
  * xe_display_create - create display struct
  * @xe: XE device instance
@@ -105,15 +97,9 @@ static void display_destroy(struct drm_device *dev, void *dummy)
 int xe_display_create(struct xe_device *xe)
 {
        /* TODO: Allocate display dynamically. */
-       struct intel_display *display = &xe->__display;
-
        xe->display = &xe->__display;
 
-       display->hotplug.dp_wq = alloc_ordered_workqueue("xe-dp", 0);
-       if (!display->hotplug.dp_wq)
-               return -ENOMEM;
-
-       return drmm_add_action_or_reset(&xe->drm, display_destroy, NULL);
+       return 0;
 }
 
 static void xe_display_fini_early(void *arg)