Skip to contentSkip to conversation

drm/display: Select DP helpers for DRM_DP_AUX_CHARDEV and DRM_DP_CEC

PATCH Superseded Javier Martinez Canillas 1 participant 2 messages Apr 27, 2022

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/display: Select DP helpers for DRM_DP_AUX_CHARDEV and DRM_DP_CEC

The DRM_DP_AUX_CHARDEV and DRM_DP_CEC boolean Kconfig symbols enable code that use DP helper functions, exported by the display-helper module.

But these don't select the DRM_DISPLAY_DP_HELPER and DRM_DISPLAY_HELPER symbols, to make sure that the functions used will be present. This leads to the following linking errors if CONFIG_DRM_DISPLAY_HELPER is set to m:

LD vmlinux.o
MODPOST vmlinux.symvers
MODINFO modules.builtin.modinfo

  GEN     modules.builtin
  LD      .tmp_vmlinux.kallsyms1
  KSYMS   .tmp_vmlinux.kallsyms1.S
  AS      .tmp_vmlinux.kallsyms1.S
  LD      .tmp_vmlinux.kallsyms2
  KSYMS   .tmp_vmlinux.kallsyms2.S
  AS      .tmp_vmlinux.kallsyms2.S
  LD      vmlinux
  SYSMAP  System.map

SORTTAB vmlinux
OBJCOPY arch/arm64/boot/Image
MODPOST modules-only.symvers
ERROR: modpost: "drm_dp_dpcd_write" [drivers/gpu/drm/display/drm_display_helper.ko] undefined!
ERROR: modpost: "drm_dp_read_desc" [drivers/gpu/drm/display/drm_display_helper.ko] undefined!
ERROR: modpost: "drm_dp_dpcd_read" [drivers/gpu/drm/display/drm_display_helper.ko] undefined! make[1]: *** [scripts/Makefile.modpost:134: modules-only.symvers] Error 1 make[1]: *** Deleting file 'modules-only.symvers'
make: *** [Makefile:1749: modules] Error 2

Note: It seems this has been an issue for a long time but was made easier to reproduce after the commit 1e0f66420b13 ("drm/display: Introduce a DRM display-helper module"). Adding a Fixes: tag just to make sure that this fix will be picked for stable once the mentioned change also lands there.

Fixes 1e0f66420b13 ("drm/display: Introduce a DRM display-helper module")

---

 drivers/gpu/drm/display/Kconfig | 4 ++++
 1 file changed, 4 insertions(+)
drivers/gpu/drm/display/Kconfig +4 -0
index f84f1b0cd23f..d7a413a2c6cc 100644
@@ -32,6 +32,8 @@ config DRM_DISPLAY_HDMI_HELPER
 config DRM_DP_AUX_CHARDEV
 	bool "DRM DP AUX Interface"
 	depends on DRM
+	select DRM_DISPLAY_DP_HELPER
+	select DRM_DISPLAY_HELPER
 	help
 	  Choose this option to enable a /dev/drm_dp_auxN node that allows to
 	  read and write values to arbitrary DPCD registers on the DP aux
@@ -40,6 +42,8 @@ config DRM_DP_AUX_CHARDEV
 config DRM_DP_CEC
 	bool "Enable DisplayPort CEC-Tunneling-over-AUX HDMI support"
 	depends on DRM
+	select DRM_DISPLAY_DP_HELPER
+	select DRM_DISPLAY_HELPER
 	select CEC_CORE
 	help
 	  Choose this option if you want to enable HDMI CEC support for
Signature · 1 line
2.35.1
#1 lore raw
Quoted 3 lines · Javier Martinez Canillas

The DRM_DP_AUX_CHARDEV and DRM_DP_CEC boolean Kconfig symbols enable code that use DP helper functions, exported by the display-helper module.

[snip]

drivers/gpu/drm/display/Kconfig config DRM_DISPLAY_HDMI_HELPER · line 36

Quoted 6 lines
drivers/gpu/drm/display/Kconfig +2 -0
@@ -32,6 +32,8 @@ config DRM_DISPLAY_HDMI_HELPER
 config DRM_DP_AUX_CHARDEV
 	bool "DRM DP AUX Interface"
 	depends on DRM
+	select DRM_DISPLAY_DP_HELPER
+	select DRM_DISPLAY_HELPER

Actually, this is wrong since it will prevent DRM_DISPLAY_HELPER to be set as a module (it's tristate while this symbol is bool). I now have a better understanding of the problem and a patch that I believe is the correct one.

I'll post a v2 soon.

Signature · 5 lines
Best regards,

Javier Martinez Canillas
Linux Engineering
Red Hat