As the first step towards making struct intel_display an opaque pointer
in i915 and xe drivers, convert the struct drm_i915_private and struct
xe_device display members into pointers.

Initially, add temporary struct intel_display __display members, and
point display at it to avoid dynamic allocation. In follow-up, we can
drop this, and switch to dynamic allocation.

Note: This is just the manual parts. All the conversions all over the
place are scripted, and the results of that are in a separate patch for
now.

Signed-off-by: Jani Nikula <jani.nik...@intel.com>
---
 drivers/gpu/drm/i915/i915_driver.c      | 3 +++
 drivers/gpu/drm/i915/i915_drv.h         | 3 ++-
 drivers/gpu/drm/xe/display/xe_display.c | 3 +++
 drivers/gpu/drm/xe/xe_device_types.h    | 3 ++-
 4 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_driver.c 
b/drivers/gpu/drm/i915/i915_driver.c
index ce3cc93ea211..fcddb18dfd82 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -754,6 +754,9 @@ i915_driver_create(struct pci_dev *pdev, const struct 
pci_device_id *ent)
        /* Set up device info and initial runtime info. */
        intel_device_info_driver_create(i915, pdev->device, match_info);
 
+       /* Transitional. To be allocated dynamically. */
+       i915->display = &i915->__display;
+
        intel_display_device_probe(pdev);
 
        return i915;
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ffc346379cc2..8ea147dd0fd8 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -179,7 +179,8 @@ struct i915_selftest_stash {
 struct drm_i915_private {
        struct drm_device drm;
 
-       struct intel_display display;
+       struct intel_display *display;
+       struct intel_display __display; /* Transitional. Do not use. */
 
        /* FIXME: Device release actions should all be moved to drmm_ */
        bool do_release;
diff --git a/drivers/gpu/drm/xe/display/xe_display.c 
b/drivers/gpu/drm/xe/display/xe_display.c
index 0b0aca7a25af..5e9c8aee5ef4 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -101,6 +101,9 @@ static void display_destroy(struct drm_device *dev, void 
*dummy)
  */
 int xe_display_create(struct xe_device *xe)
 {
+       /* Transitional. To be allocated dynamically. */
+       xe->display = &xe->__display;
+
        spin_lock_init(&xe->display.fb_tracking.lock);
 
        xe->display.hotplug.dp_wq = alloc_ordered_workqueue("xe-dp", 0);
diff --git a/drivers/gpu/drm/xe/xe_device_types.h 
b/drivers/gpu/drm/xe/xe_device_types.h
index 72ef0b6fc425..a7362c756caf 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -569,7 +569,8 @@ struct xe_device {
         * drm_i915_private during build. After cleanup these should go away,
         * migrating to the right sub-structs
         */
-       struct intel_display display;
+       struct intel_display *display;
+       struct intel_display __display; /* Transitional. Do not use. */
        enum intel_pch pch_type;
 
        struct dram_info {
-- 
2.39.5

Reply via email to