[Intel-xe] [PATCH] drm/xe: Fix module load without display IP

Lucas De Marchi lucas.demarchi at intel.com
Fri Mar 10 19:14:30 UTC 2023


When the device info initialization moved to the display part, one use
case was left behind: platforms without display IP. In order to keep the
knowledge about the display in xe_display.c, xe_display_info_init()
should be the place where this is set.

Remove the warning and set the info accordingly. This moves a later
check from  intel_device_info_runtime_init() into a very earlier one,
when no HW access is being done yet.

Fixes: 01a4268df2dd ("drm/xe/display: Move device info initialization to display")
Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---

This fixes the module loading for me in PVC as long as I also remove
the ast module, due to another unrelated issue.

I do wonder though about the need for the drm.driver_features dance. We
set it very early on probe to call aperture_remove_conflicting_pci_framebuffers(),
which may be needed if the device supports display, but should not be
driven by xe.  For now fixing just the most immediate issue that should
bring us back to the behavior we had before the commit being fixed.

 .../gpu/drm/xe/display/ext/intel_device_info.c    |  6 ------
 drivers/gpu/drm/xe/xe_display.c                   | 15 +++++++++------
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/ext/intel_device_info.c b/drivers/gpu/drm/xe/display/ext/intel_device_info.c
index 7f50b5e386f5..3dc1219864b4 100644
--- a/drivers/gpu/drm/xe/display/ext/intel_device_info.c
+++ b/drivers/gpu/drm/xe/display/ext/intel_device_info.c
@@ -107,12 +107,6 @@ void intel_device_info_runtime_init(struct drm_i915_private *dev_priv)
 			runtime->has_dsc = 0;
 	}
 
-	if (!HAS_DISPLAY(dev_priv)) {
-		dev_priv->drm.driver_features &= ~(DRIVER_MODESET |
-						   DRIVER_ATOMIC);
-		memset(runtime, 0, sizeof(*runtime));
-	}
-
 	runtime->rawclk_freq = intel_read_rawclk(dev_priv);
 	drm_dbg(&dev_priv->drm, "rawclk rate: %d kHz\n", runtime->rawclk_freq);
 }
diff --git a/drivers/gpu/drm/xe/xe_display.c b/drivers/gpu/drm/xe/xe_display.c
index cf6c60d7e5ff..9cd0c329da66 100644
--- a/drivers/gpu/drm/xe/xe_display.c
+++ b/drivers/gpu/drm/xe/xe_display.c
@@ -57,6 +57,11 @@ int xe_display_set_driver_hooks(struct pci_dev *pdev, struct drm_driver *driver)
 	return 0;
 }
 
+static void unset_driver_hooks(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);
@@ -79,7 +84,6 @@ int xe_display_create(struct xe_device *xe)
 {
 	int err;
 
-	/* Initialize display parts here.. */
 	spin_lock_init(&xe->display.fb_tracking.lock);
 
 	xe->display.hotplug.dp_wq = alloc_ordered_workqueue("xe-dp", 0);
@@ -496,11 +500,10 @@ void xe_display_info_init(struct xe_device *xe)
 		xe->info.display = (struct xe_device_display_info) { XE_LPDP };
 		break;
 	default:
-		/*
-		 * If platform doesn't have display, enable_display should
-		 * had been forced to false already at this point
-		 */
-		drm_WARN_ON(&xe->drm, 1);
+		drm_dbg(&xe->drm, "No display IP, skipping\n");
+		xe->info.enable_display = false;
+		unset_driver_hooks(xe);
+		return;
 	}
 }
 
-- 
2.39.0



More information about the Intel-xe mailing list