Work is in progress to make every drm_panel automatically create a
panel_bridge [0][1].

This requires the panel code to call the drm_panel_bridge APIs. However
this would create a circular dependency loop on modular builds:

__devm_drm_panel_alloc() [drm]
   -> drm_panel_bridge_add() [drm_kms_helper]
      -> drm_bridge.c APIs [drm]

Moving just the panel_brige.o file from [drm_kms_helper] to [drm] does not
work because the panel bridge code uses the drm_atomic_helper and
drm_probe_helper which add further dependencies on symbols in the
[drm_kms_helper] module.

So take a simple approach, and move the entire drm_kms_helper into the
[drm] module.

Link: 
https://lore.kernel.org/all/emuj2innmp6zmzd7pyakqzjqpdzhly6qfhakya3ydwmd63pl26@5jwxaidpikjw/
 [0]
Link: 
https://lore.kernel.org/lkml/[email protected]/
 [1]
Signed-off-by: Luca Ceresoli <[email protected]>

---

*Note* This is just a quick implementation to open a discussion while
having a working implementation. If the approach is approved there will be
more details to polish.
---
 drivers/gpu/drm/Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index e97faabcd783..945d4f117c3f 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -139,7 +139,7 @@ obj-$(CONFIG_DRM_TTM_HELPER) += drm_ttm_helper.o
 # Modesetting helpers
 #
 
-drm_kms_helper-y := \
+drm-$(CONFIG_DRM_KMS_HELPER) := \
        drm_atomic_helper.o \
        drm_atomic_state_helper.o \
        drm_bridge_helper.o \
@@ -156,9 +156,8 @@ drm_kms_helper-y := \
        drm_self_refresh_helper.o \
        drm_simple_kms_helper.o \
        drm_vblank_helper.o
-drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o
-drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o
-obj-$(CONFIG_DRM_KMS_HELPER) += drm_kms_helper.o
+drm-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o
+drm-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o
 
 #
 # Drivers and the rest

-- 
2.55.0

Reply via email to