[Intel-xe] [PATCH 3/7] drm/xe/display: Rename and clarify xe_display_enable()

Lucas De Marchi lucas.demarchi at intel.com
Thu Mar 2 01:34:07 UTC 2023


Rename xe_display_enable() so it doesn't appear that the IP is being
enabled at this point: it's very early in the initialization phase and
this is actually setting up the SW part in the DRM driver to be able do
drive display. While at it, add the kernel doc.

Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
 drivers/gpu/drm/xe/xe_device.c  |  2 +-
 drivers/gpu/drm/xe/xe_display.c | 12 +++++++++++-
 drivers/gpu/drm/xe/xe_display.h |  5 ++++-
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index afc6fd516f6f..8b0a6cd6fd65 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -169,7 +169,7 @@ struct xe_device *xe_device_create(struct pci_dev *pdev,
 	struct xe_device *xe;
 	int err;
 
-	err = xe_display_enable(pdev, &driver);
+	err = xe_display_set_driver_hooks(pdev, &driver);
 	if (err)
 		return ERR_PTR(err);
 
diff --git a/drivers/gpu/drm/xe/xe_display.c b/drivers/gpu/drm/xe/xe_display.c
index 80fe181e5fd9..19c1f9945911 100644
--- a/drivers/gpu/drm/xe/xe_display.c
+++ b/drivers/gpu/drm/xe/xe_display.c
@@ -30,7 +30,17 @@
 
 /* Xe device functions */
 
-int xe_display_enable(struct pci_dev *pdev, struct drm_driver *driver)
+/**
+ * xe_display_set_driver_hooks - set driver flags and hooks for display
+ * @pdev: PCI device
+ * @driver: DRM device driver
+ *
+ * Set features and function hooks in @driver that are needed for driving the
+ * display IP, when that is enabled.
+ *
+ * Returns: 0 on success
+ */
+int xe_display_set_driver_hooks(struct pci_dev *pdev, struct drm_driver *driver)
 {
 	if (!enable_display)
 		return 0;
diff --git a/drivers/gpu/drm/xe/xe_display.h b/drivers/gpu/drm/xe/xe_display.h
index 5c09962f4906..cc908d8a7cd9 100644
--- a/drivers/gpu/drm/xe/xe_display.h
+++ b/drivers/gpu/drm/xe/xe_display.h
@@ -12,7 +12,7 @@
 
 #if IS_ENABLED(CONFIG_DRM_XE_DISPLAY)
 
-int xe_display_enable(struct pci_dev *pdev, struct drm_driver *driver);
+int xe_display_set_driver_hooks(struct pci_dev *pdev, struct drm_driver *driver);
 
 int xe_display_init_nommio(struct xe_device *xe);
 void xe_display_fini_nommio(struct drm_device *dev, void *dummy);
@@ -43,6 +43,9 @@ void xe_display_pm_resume(struct xe_device *xe);
 
 #else
 
+static inline int
+xe_display_set_driver_hooks(struct pci_dev *pdev, struct drm_driver *driver) { return 0; }
+
 static inline int
 xe_display_enable(struct pci_dev *pdev, struct drm_driver *driver) { return 0; };
 
-- 
2.39.0



More information about the Intel-xe mailing list