[Intel-xe] [PATCH 1/1] fixup! drm/xe/display: Implement display support

Lucas De Marchi lucas.demarchi at intel.com
Fri Sep 8 17:41:42 UTC 2023


On Fri, Sep 08, 2023 at 11:42:35AM -0300, Gustavo Sousa wrote:
>Finalizer counterparts of display initializers are registered with
>drmm_add_action_or_reset(). Since there are no other explicit users of
>them outside of xe_display.c, let's turn them into static functions.
>
>Signed-off-by: Gustavo Sousa <gustavo.sousa at intel.com>


Reviewed-by: Lucas De Marchi <lucas.demarchi at intel.com>

since this is a fixup patch, what about squeezing a few more renames
and cleanups?

1) xe_display_modset_driver_remove()... there was a typo
    s/modset/modeset/ but I think just using xe_display_driver would
    be better
2) Group functions by namespace
3) Remove unused inline function
4) s/unlink/shutdown/ to follow naming nearby


Lucas De Marchi

diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index b3ecbbd6d020b..0141fd53a41cf 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -344,12 +344,12 @@ int xe_device_probe(struct xe_device *xe)
  	return 0;
  
  err_fini_display:
-	xe_display_modset_driver_remove(xe);
+	xe_display_driver_remove(xe);
  
  err_irq_shutdown:
  	xe_irq_shutdown(xe);
  err:
-	xe_display_unlink(xe);
+	xe_display_shutdown(xe);
  	return err;
  }
  
@@ -358,14 +358,14 @@ static void xe_device_remove_display(struct xe_device *xe)
  	xe_display_unregister(xe);
  
  	drm_dev_unplug(&xe->drm);
-	xe_display_modset_driver_remove(xe);
+	xe_display_driver_remove(xe);
  }
  
  void xe_device_remove(struct xe_device *xe)
  {
  	xe_device_remove_display(xe);
  
-	xe_display_unlink(xe);
+	xe_display_shutdown(xe);
  
  	xe_irq_shutdown(xe);
  }
diff --git a/drivers/gpu/drm/xe/xe_display.c b/drivers/gpu/drm/xe/xe_display.c
index 3d15d3ac431f9..32b703af44931 100644
--- a/drivers/gpu/drm/xe/xe_display.c
+++ b/drivers/gpu/drm/xe/xe_display.c
@@ -236,7 +236,7 @@ int xe_display_init(struct xe_device *xe)
  	return intel_display_driver_probe(xe);
  }
  
-void xe_display_unlink(struct xe_device *xe)
+void xe_display_shutdown(struct xe_device *xe)
  {
  	if (!xe->info.enable_display)
  		return;
@@ -269,7 +269,7 @@ void xe_display_unregister(struct xe_device *xe)
  	intel_display_driver_unregister(xe);
  }
  
-void xe_display_modset_driver_remove(struct xe_device *xe)
+void xe_display_driver_remove(struct xe_device *xe)
  {
  	if (!xe->info.enable_display)
  		return;
diff --git a/drivers/gpu/drm/xe/xe_display.h b/drivers/gpu/drm/xe/xe_display.h
index 71e0bd27f1ebe..7e05b4737b0e8 100644
--- a/drivers/gpu/drm/xe/xe_display.h
+++ b/drivers/gpu/drm/xe/xe_display.h
@@ -14,6 +14,7 @@ struct drm_driver;
  
  int xe_display_driver_probe_defer(struct pci_dev *pdev);
  void xe_display_driver_set_hooks(struct drm_driver *driver);
+void xe_display_driver_remove(struct xe_device *xe);
  
  int xe_display_create(struct xe_device *xe);
  
@@ -22,17 +23,14 @@ void xe_display_info_init(struct xe_device *xe);
  int xe_display_init_nommio(struct xe_device *xe);
  int xe_display_init_noirq(struct xe_device *xe);
  int xe_display_init_noaccel(struct xe_device *xe);
-
  int xe_display_init(struct xe_device *xe);
-void xe_display_unlink(struct xe_device *xe);
+void xe_display_shutdown(struct xe_device *xe);
  
  void xe_display_register(struct xe_device *xe);
  void xe_display_unregister(struct xe_device *xe);
-void xe_display_modset_driver_remove(struct xe_device *xe);
  
  void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl);
  void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir);
-
  void xe_display_irq_reset(struct xe_device *xe);
  void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt);
  
@@ -44,27 +42,21 @@ void xe_display_pm_resume(struct xe_device *xe);
  #else
  
  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_create(struct xe_device *xe) { return 0; }
  
  static inline void xe_display_info_init(struct xe_device *xe) { }
  
-static inline int
-xe_display_enable(struct pci_dev *pdev, struct drm_driver *driver) { return 0; }
-
  static inline int xe_display_init_nommio(struct xe_device *xe) { return 0; }
  static inline int xe_display_init_noirq(struct xe_device *xe) { return 0; }
  static inline int xe_display_init_noaccel(struct xe_device *xe) { return 0; }
-
  static inline int xe_display_init(struct xe_device *xe) { return 0; }
-static inline void xe_display_unlink(struct xe_device *xe) {}
+static inline void xe_display_shutdown(struct xe_device *xe) {}
  
  static inline void xe_display_register(struct xe_device *xe) {}
  static inline void xe_display_unregister(struct xe_device *xe) {}
-static inline void xe_display_modset_driver_remove(struct xe_device *xe) {}
  
  static inline void xe_display_irq_handler(struct xe_device *xe, u32 master_ctl) {}
  static inline void xe_display_irq_enable(struct xe_device *xe, u32 gu_misc_iir) {}
>---
> drivers/gpu/drm/xe/xe_display.c |  6 +++---
> drivers/gpu/drm/xe/xe_display.h | 15 +--------------
> 2 files changed, 4 insertions(+), 17 deletions(-)
>
>diff --git a/drivers/gpu/drm/xe/xe_display.c b/drivers/gpu/drm/xe/xe_display.c
>index a453946ad108..3d15d3ac431f 100644
>--- a/drivers/gpu/drm/xe/xe_display.c
>+++ b/drivers/gpu/drm/xe/xe_display.c
>@@ -132,7 +132,7 @@ int xe_display_create(struct xe_device *xe)
> 	return 0;
> }
>
>-void xe_display_fini_nommio(struct drm_device *dev, void *dummy)
>+static void xe_display_fini_nommio(struct drm_device *dev, void *dummy)
> {
> 	struct xe_device *xe = to_xe_device(dev);
>
>@@ -164,7 +164,7 @@ int xe_display_init_nommio(struct xe_device *xe)
> 	return drmm_add_action_or_reset(&xe->drm, xe_display_fini_nommio, xe);
> }
>
>-void xe_display_fini_noirq(struct drm_device *dev, void *dummy)
>+static void xe_display_fini_noirq(struct drm_device *dev, void *dummy)
> {
> 	struct xe_device *xe = to_xe_device(dev);
>
>@@ -204,7 +204,7 @@ int xe_display_init_noirq(struct xe_device *xe)
> 	return drmm_add_action_or_reset(&xe->drm, xe_display_fini_noirq, NULL);
> }
>
>-void xe_display_fini_noaccel(struct drm_device *dev, void *dummy)
>+static void xe_display_fini_noaccel(struct drm_device *dev, void *dummy)
> {
> 	struct xe_device *xe = to_xe_device(dev);
>
>diff --git a/drivers/gpu/drm/xe/xe_display.h b/drivers/gpu/drm/xe/xe_display.h
>index 9e29de012df7..71e0bd27f1eb 100644
>--- a/drivers/gpu/drm/xe/xe_display.h
>+++ b/drivers/gpu/drm/xe/xe_display.h
>@@ -20,13 +20,8 @@ int xe_display_create(struct xe_device *xe);
> void xe_display_info_init(struct xe_device *xe);
>
> int xe_display_init_nommio(struct xe_device *xe);
>-void xe_display_fini_nommio(struct drm_device *dev, void *dummy);
>-
> int xe_display_init_noirq(struct xe_device *xe);
>-void xe_display_fini_noirq(struct drm_device *dev, void *dummy);
>-
> int xe_display_init_noaccel(struct xe_device *xe);
>-void xe_display_fini_noaccel(struct drm_device *dev, void *dummy);
>
> int xe_display_init(struct xe_device *xe);
> void xe_display_unlink(struct xe_device *xe);
>@@ -60,17 +55,9 @@ static inline void xe_display_info_init(struct xe_device *xe) { }
> static inline int
> xe_display_enable(struct pci_dev *pdev, struct drm_driver *driver) { return 0; }
>
>-static inline int
>-xe_display_init_nommio(struct xe_device *xe) { return 0; }
>-static inline void xe_display_fini_nommio(struct drm_device *dev, void *dummy) {}
>-
>+static inline int xe_display_init_nommio(struct xe_device *xe) { return 0; }
> static inline int xe_display_init_noirq(struct xe_device *xe) { return 0; }
>-
>-static inline void
>-xe_display_fini_noirq(struct drm_device *dev, void *dummy) {}
>-
> static inline int xe_display_init_noaccel(struct xe_device *xe) { return 0; }
>-static inline void xe_display_fini_noaccel(struct drm_device *dev, void *dummy) {}
>
> static inline int xe_display_init(struct xe_device *xe) { return 0; }
> static inline void xe_display_unlink(struct xe_device *xe) {}
>-- 
>2.41.0
>


More information about the Intel-xe mailing list