Skip to contentSkip to conversation

drm: rework FB_CORE dependency

PATCH In review Arnd Bergmann 2 participants 4 messages Nov 15, 2024 – Dec 10, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 drm: rework FB_CORE dependency

From: Arnd Bergmann <[email protected]>

The 'select FB_CORE' statement moved from CONFIG_DRM to DRM_CLIENT_LIB, but there are now configurations that have code calling into fb_core as built-in even though the client_lib itself is a loadable module:

x86_64-linux-ld: drivers/gpu/drm/drm_fbdev_shmem.o: in function `drm_fbdev_shmem_driver_fbdev_probe':
drm_fbdev_shmem.c:(.text+0x1fc): undefined reference to `fb_deferred_io_init'
x86_64-linux-ld: drivers/gpu/drm/drm_fbdev_shmem.o: in function `drm_fbdev_shmem_fb_destroy':
drm_fbdev_shmem.c:(.text+0x2e1): undefined reference to `fb_deferred_io_cleanup'
...
x86_64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_set_suspend':
drm_fb_helper.c:(.text+0x2c6): undefined reference to `fb_set_suspend'
x86_64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_resume_worker':
drm_fb_helper.c:(.text+0x2e1): undefined reference to `fb_set_suspend'

In addition to DRM_CLIENT_LIB, the 'select' needs to be at least in two more parts, DRM_KMS_HELPER and DRM_GEM_SHMEM_HELPER, so add those here.

Fixes dadd28d4142f ("drm/client: Add client-lib module")

---
v2: keep the select in DRM_CLIENT_LIB, keep alphabetic sorting

---
 drivers/gpu/drm/Kconfig | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/Kconfig +2 -0
index a4a092ee70d9..410bd6d78408 100644
@@ -98,6 +98,7 @@ config DRM_KUNIT_TEST
 config DRM_KMS_HELPER
 	tristate
 	depends on DRM
+	select FB_CORE if DRM_FBDEV_EMULATION
 	help
 	  CRTC helpers for KMS drivers.
 
@@ -371,6 +372,7 @@ config DRM_GEM_DMA_HELPER
 config DRM_GEM_SHMEM_HELPER
 	tristate
 	depends on DRM && MMU
+	select FB_CORE if DRM_FBDEV_EMULATION
 	select FB_SYSMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
 	help
 	  Choose this if you need the GEM shmem helper functions
Signature · 1 line
2.39.5
#1 lore raw

Hi

Am 15.11.24 um 17:23 schrieb Arnd Bergmann:

Quoted 41 lines

From: Arnd Bergmann <[email protected]>

The 'select FB_CORE' statement moved from CONFIG_DRM to DRM_CLIENT_LIB, but there are now configurations that have code calling into fb_core as built-in even though the client_lib itself is a loadable module:

x86_64-linux-ld: drivers/gpu/drm/drm_fbdev_shmem.o: in function `drm_fbdev_shmem_driver_fbdev_probe':
drm_fbdev_shmem.c:(.text+0x1fc): undefined reference to `fb_deferred_io_init'
x86_64-linux-ld: drivers/gpu/drm/drm_fbdev_shmem.o: in function `drm_fbdev_shmem_fb_destroy':
drm_fbdev_shmem.c:(.text+0x2e1): undefined reference to `fb_deferred_io_cleanup'
...
x86_64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_set_suspend':
drm_fb_helper.c:(.text+0x2c6): undefined reference to `fb_set_suspend'
x86_64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_resume_worker':
drm_fb_helper.c:(.text+0x2e1): undefined reference to `fb_set_suspend'

In addition to DRM_CLIENT_LIB, the 'select' needs to be at least in two more parts, DRM_KMS_HELPER and DRM_GEM_SHMEM_HELPER, so add those here.

Fixes dadd28d4142f ("drm/client: Add client-lib module")

---
v2: keep the select in DRM_CLIENT_LIB, keep alphabetic sorting

---
  drivers/gpu/drm/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/Kconfig +1 -0
index a4a092ee70d9..410bd6d78408 100644
@@ -98,6 +98,7 @@ config DRM_KUNIT_TEST
  config DRM_KMS_HELPER
  	tristate
  	depends on DRM
+	select FB_CORE if DRM_FBDEV_EMULATION
  	help
  	  CRTC helpers for KMS drivers.
 

drivers/gpu/drm/Kconfig config DRM_GEM_DMA_HELPER · line 375

Quoted 4 lines
drivers/gpu/drm/Kconfig +1 -0
@@ -371,6 +372,7 @@ config DRM_GEM_DMA_HELPER
  config DRM_GEM_SHMEM_HELPER
  	tristate
  	depends on DRM && MMU
+	select FB_CORE if DRM_FBDEV_EMULATION

This select statement is also required for DRM_GEM_DMA_HELPER and DRM_GEM_TTM_HELPER

Best regards
Thomas

Quoted 3 lines
drivers/gpu/drm/Kconfig +0 -0
  	select FB_SYSMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
  	help
  	  Choose this if you need the GEM shmem helper functions
Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
maintainer Reviewed-by on v2 1/1
#2 lore raw
In reply to Arnd Bergmann

Hi

Am 15.11.24 um 17:23 schrieb Arnd Bergmann:

Quoted 16 lines

From: Arnd Bergmann <[email protected]>

The 'select FB_CORE' statement moved from CONFIG_DRM to DRM_CLIENT_LIB, but there are now configurations that have code calling into fb_core as built-in even though the client_lib itself is a loadable module:

x86_64-linux-ld: drivers/gpu/drm/drm_fbdev_shmem.o: in function `drm_fbdev_shmem_driver_fbdev_probe':
drm_fbdev_shmem.c:(.text+0x1fc): undefined reference to `fb_deferred_io_init'
x86_64-linux-ld: drivers/gpu/drm/drm_fbdev_shmem.o: in function `drm_fbdev_shmem_fb_destroy':
drm_fbdev_shmem.c:(.text+0x2e1): undefined reference to `fb_deferred_io_cleanup'
...
x86_64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_set_suspend':
drm_fb_helper.c:(.text+0x2c6): undefined reference to `fb_set_suspend'
x86_64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_resume_worker':
drm_fb_helper.c:(.text+0x2e1): undefined reference to `fb_set_suspend'

Quoted 6 lines

In addition to DRM_CLIENT_LIB, the 'select' needs to be at least in two more parts, DRM_KMS_HELPER and DRM_GEM_SHMEM_HELPER, so add those here.

Fixes dadd28d4142f ("drm/client: Add client-lib module")

Looks like this patch got lost. I'll merge it now and will also send a patch for DMA- and TTM-related options.

Best regards
Thomas

Quoted 26 lines

---
v2: keep the select in DRM_CLIENT_LIB, keep alphabetic sorting

---
  drivers/gpu/drm/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/Kconfig +2 -0
index a4a092ee70d9..410bd6d78408 100644
@@ -98,6 +98,7 @@ config DRM_KUNIT_TEST
  config DRM_KMS_HELPER
  	tristate
  	depends on DRM
+	select FB_CORE if DRM_FBDEV_EMULATION
  	help
  	  CRTC helpers for KMS drivers.
 
@@ -371,6 +372,7 @@ config DRM_GEM_DMA_HELPER
  config DRM_GEM_SHMEM_HELPER
  	tristate
  	depends on DRM && MMU
+	select FB_CORE if DRM_FBDEV_EMULATION
  	select FB_SYSMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
  	help
  	  Choose this if you need the GEM shmem helper functions
Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
#3 lore raw
In reply to Arnd Bergmann

Hi

Am 15.11.24 um 17:23 schrieb Arnd Bergmann:

Quoted 33 lines

From: Arnd Bergmann <[email protected]>

The 'select FB_CORE' statement moved from CONFIG_DRM to DRM_CLIENT_LIB, but there are now configurations that have code calling into fb_core as built-in even though the client_lib itself is a loadable module:

x86_64-linux-ld: drivers/gpu/drm/drm_fbdev_shmem.o: in function `drm_fbdev_shmem_driver_fbdev_probe':
drm_fbdev_shmem.c:(.text+0x1fc): undefined reference to `fb_deferred_io_init'
x86_64-linux-ld: drivers/gpu/drm/drm_fbdev_shmem.o: in function `drm_fbdev_shmem_fb_destroy':
drm_fbdev_shmem.c:(.text+0x2e1): undefined reference to `fb_deferred_io_cleanup'
...
x86_64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_set_suspend':
drm_fb_helper.c:(.text+0x2c6): undefined reference to `fb_set_suspend'
x86_64-linux-ld: drivers/gpu/drm/drm_fb_helper.o: in function `drm_fb_helper_resume_worker':
drm_fb_helper.c:(.text+0x2e1): undefined reference to `fb_set_suspend'

In addition to DRM_CLIENT_LIB, the 'select' needs to be at least in two more parts, DRM_KMS_HELPER and DRM_GEM_SHMEM_HELPER, so add those here.

Fixes dadd28d4142f ("drm/client: Add client-lib module")

---
v2: keep the select in DRM_CLIENT_LIB, keep alphabetic sorting

---
  drivers/gpu/drm/Kconfig | 2 ++
  1 file changed, 2 insertions(+)
drivers/gpu/drm/Kconfig +0 -0
index a4a092ee70d9..410bd6d78408 100644

drivers/gpu/drm/Kconfig config DRM_KUNIT_TEST · line 101

Quoted 4 lines
drivers/gpu/drm/Kconfig +1 -0
@@ -98,6 +98,7 @@ config DRM_KUNIT_TEST
  config DRM_KMS_HELPER
  	tristate
  	depends on DRM
+	select FB_CORE if DRM_FBDEV_EMULATION

This line gives me

error: recursive dependency detected!
        symbol BACKLIGHT_CLASS_DEVICE is selected by FB_BACKLIGHT symbol FB_BACKLIGHT is selected by FB_SH_MOBILE_LCDC symbol FB_SH_MOBILE_LCDC depends on FB_DEVICE
        symbol FB_DEVICE depends on FB_CORE
        symbol FB_CORE is selected by DRM_KMS_HELPER
        symbol DRM_KMS_HELPER is selected by DRM_MIPI_DBI symbol DRM_MIPI_DBI is selected by DRM_PANEL_ILITEK_ILI9341 symbol DRM_PANEL_ILITEK_ILI9341 depends on BACKLIGHT_CLASS_DEVICE

I'm leaving it out for now.

Best regards
Thomas

Quoted 11 lines
drivers/gpu/drm/Kconfig +1 -0
  	help
  	  CRTC helpers for KMS drivers.
 
@@ -371,6 +372,7 @@ config DRM_GEM_DMA_HELPER
  config DRM_GEM_SHMEM_HELPER
  	tristate
  	depends on DRM && MMU
+	select FB_CORE if DRM_FBDEV_EMULATION
  	select FB_SYSMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION
  	help
  	  Choose this if you need the GEM shmem helper functions
Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)