drm/panel-edp: modify Kconfig to prevent build error
Subsystems (4)
PATCH 1/1 drm/panel-edp: modify Kconfig to prevent build error
When CONFIG_DRM_KMS_HELPER=m and CONFIG_DRM_PANEL_EDP=y, there is a build error in gpu/drm/panel/panel-edp.o:
arm-linux-gnueabi-ld: drivers/gpu/drm/panel/panel-edp.o: in function `panel_edp_probe':
panel-edp.c:(.text+0xf38): undefined reference to `drm_panel_dp_aux_backlight'
Fix this by limiting DRM_PANEL_DEP by the value of the DRM_KMS_HELPER symbol.
--- drivers/gpu/drm/panel/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/panel/Kconfig +1 -0
@@ -104,6 +104,7 @@ config DRM_PANEL_EDP depends on OF depends on BACKLIGHT_CLASS_DEVICE depends on PM + depends on DRM_KMS_HELPER select VIDEOMODE_HELPERS select DRM_DP_AUX_BUS help
Quoted 9 lines · Randy Dunlap
When
CONFIG_DRM_KMS_HELPER=mandCONFIG_DRM_PANEL_EDP=y, there is a build error ingpu/drm/panel/panel-edp.o:arm-linux-gnueabi-ld:
drivers/gpu/drm/panel/panel-edp.o: in function `panel_edp_probe':
panel-edp.c:(.text+0xf38): undefined reference to `drm_panel_dp_aux_backlight'Fix this by limiting
DRM_PANEL_DEPby the value of theDRM_KMS_HELPERsymbol.
I think the analysis is correct, but this is not the correct fix since DRM_KMS_HELPER
is not user-selectable. (Almost) all other drivers that rely on DRM_KMS_HELPER use 'select' for this, and mixing the two risks running into circular dependencies.
I see that there are already some 'depends on DRM_KMS_HELPER' in bridge and panel drivers, so it's possible that we have to fix them all at the same to do this right. I ran into another problem like this the other day and I'm currently
testing with the patch below, but I have not posted that yet since I am not fully convinced that this is the correct fix either.
Arnd
---
commit a836092fedaac66af03ea9ed7cb13214fd2ab8a2
Author: Arnd Bergmann <[email protected]> Date: Mon Nov 15 16:54:04 2021 +0100
drm/mipi-dbi: select CONFIG_DRM_KMS_HELPER
The driver fails to build when the KMS helpers are disabled:
ld.lld: error: undefined symbol: drm_gem_fb_get_obj >>> referenced by drm_mipi_dbi.c
>>> gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in
archive drivers/built-in.a
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
referenced by
drm_mipi_dbi.c
gpu/drm/drm_mipi_dbi.o:(mipi_dbi_fb_dirty) in
archive drivers/built-in.a
ld.lld: error: undefined symbol: drm_gem_fb_begin_cpu_access >>> referenced by drm_mipi_dbi.c
>>> gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in
archive drivers/built-in.a
ld.lld: error: undefined symbol: drm_fb_swab
>>> referenced by drm_mipi_dbi.c
>>> gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in
archive drivers/built-in.a
ld.lld: error: undefined symbol: drm_fb_xrgb8888_to_rgb565 >>> referenced by drm_mipi_dbi.c
>>> gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in
archive drivers/built-in.a
ld.lld: error: undefined symbol: drm_fb_memcpy >>> referenced by drm_mipi_dbi.c
>>> gpu/drm/drm_mipi_dbi.o:(mipi_dbi_buf_copy) in
archive drivers/built-in.a
This is fairly hard to hit in randconfig drivers, but it eventually did trigger for me in a configuration where all other DRM drivers are loadable modules, but DRM_PANEL_WIDECHIPS_WS2401 was built-in.
drivers/gpu/drm/Kconfig +1 -0
@@ -29,6 +29,7 @@ menuconfig DRM config DRM_MIPI_DBI tristate + select DRM_KMS_HELPER depends on DRM config DRM_MIPI_DSI
drivers/gpu/drm/bridge/Kconfig +0 -1
@@ -8,7 +8,6 @@ config DRM_BRIDGE config DRM_PANEL_BRIDGE def_bool y depends on DRM_BRIDGE - depends on DRM_KMS_HELPER select DRM_PANEL help DRM bridge wrapper of DRM panels
drivers/gpu/drm/panel/Kconfig +1 -2
@@ -140,9 +140,8 @@ config DRM_PANEL_ILITEK_IL9322 config DRM_PANEL_ILITEK_ILI9341 tristate "Ilitek ILI9341 240x320 QVGA panels" depends on OF && SPI - depends on DRM_KMS_HELPER - depends on DRM_KMS_CMA_HELPER depends on BACKLIGHT_CLASS_DEVICE + select DRM_KMS_CMA_HELPER select DRM_MIPI_DBI help Say Y here if you want to enable support for Ilitek IL9341
Quoted 8 lines · Arnd Bergmann
Quoted 7 lines · Randy Dunlap
When
CONFIG_DRM_KMS_HELPER=mandCONFIG_DRM_PANEL_EDP=y, there is a build error ingpu/drm/panel/panel-edp.o:arm-linux-gnueabi-ld:
drivers/gpu/drm/panel/panel-edp.o: in function `panel_edp_probe':
panel-edp.c:(.text+0xf38): undefined reference to `drm_panel_dp_aux_backlight'
Quoted 8 lines
Quoted 2 lines
Fix this by limiting
DRM_PANEL_DEPby the value of theDRM_KMS_HELPERsymbol.I think the analysis is correct, but this is not the correct fix since
DRM_KMS_HELPER
is not user-selectable. (Almost) all other drivers that rely onDRM_KMS_HELPERuse 'select' for this, and mixing the two risks running into circular dependencies.
Oops. Thanks for catching that.
My first (local) version of the patch used select, but that got me into kconfig circular dependency chain land (ugly). Maybe your all-at-once patch can take care of that problem.
Quoted 7 lines
I see that there are already some 'depends on
DRM_KMS_HELPER' in bridge and panel drivers, so it's possible that we have to fix them all at the same to do this right. I ran into another problem like this the other day and I'm currently
testing with the patch below, but I have not posted that yet since I am not fully convinced that this is the correct fix either.
I'll test some with it also.
thanks.
Signature · 1 line
~Randy