Skip to contentSkip to conversation

drm: rcar-du: Fix build error

PATCH In review Daniel Gomez 4 participants 6 messages May 18, 2020 – May 23, 2020

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

PATCH 1/1 drm: rcar-du: Fix build error

Select DRM_KMS_HELPER dependency.

Build error when DRM_KMS_HELPER is not selected:

drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd48): undefined reference to drm_atomic_helper_bridge_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd50): undefined reference to drm_atomic_helper_bridge_destroy_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd70): undefined reference to drm_atomic_helper_bridge_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xdc8): undefined reference to drm_atomic_helper_connector_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xde0): undefined reference to drm_helper_probe_single_connector_modes' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe08): undefined reference to drm_atomic_helper_connector_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe10): undefined reference to `drm_atomic_helper_connector_destroy_state'

---
 drivers/gpu/drm/rcar-du/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/rcar-du/Kconfig +1 -0
index 0919f1f159a4..f65d1489dc50 100644
@@ -31,6 +31,7 @@ config DRM_RCAR_DW_HDMI
 config DRM_RCAR_LVDS
 	tristate "R-Car DU LVDS Encoder Support"
 	depends on DRM && DRM_BRIDGE && OF
+	select DRM_KMS_HELPER
 	select DRM_PANEL
 	select OF_FLATTREE
 	select OF_OVERLAY
Signature · 1 line
2.26.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Daniel Gomez

Select DRM_KMS_HELPER dependency.

Build error when DRM_KMS_HELPER is not selected:

drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd48): undefined reference to drm_atomic_helper_bridge_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd50): undefined reference to drm_atomic_helper_bridge_destroy_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd70): undefined reference to drm_atomic_helper_bridge_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xdc8): undefined reference to drm_atomic_helper_connector_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xde0): undefined reference to drm_helper_probe_single_connector_modes' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe08): undefined reference to drm_atomic_helper_connector_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe10): undefined reference to `drm_atomic_helper_connector_destroy_state'

Quoted 1 line

Nicely spotted.
AFAICT the only way this ever worked is if people had DRM_FBDEV_EMULATION, which is unset in your case.

I suspect Laurent will pick this in due time.
-Emil

Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel Gomez

Hi Daniel,

Quoted 4 lines · Daniel Gomez

Select DRM_KMS_HELPER dependency.

Build error when DRM_KMS_HELPER is not selected:

Quoted 8 lines

drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd48): undefined reference to drm_atomic_helper_bridge_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd50): undefined reference to drm_atomic_helper_bridge_destroy_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd70): undefined reference to drm_atomic_helper_bridge_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xdc8): undefined reference to drm_atomic_helper_connector_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xde0): undefined reference to drm_helper_probe_single_connector_modes' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe08): undefined reference to drm_atomic_helper_connector_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe10): undefined reference to `drm_atomic_helper_connector_destroy_state'

Looking at the files in rcar_du that utilise drm_atomic_helpers...

git grep -l drm_atomic_helper_ drivers/gpu/drm/rcar-du/
drivers/gpu/drm/rcar-du/rcar_du_crtc.c drivers/gpu/drm/rcar-du/rcar_du_kms.c drivers/gpu/drm/rcar-du/rcar_du_plane.c drivers/gpu/drm/rcar-du/rcar_du_vsp.c drivers/gpu/drm/rcar-du/rcar_du_writeback.c drivers/gpu/drm/rcar-du/rcar_lvds.c

of those, these are configurable:

rcar_du_vsp.c # DRM_RCAR_VSP
rcar_du_writeback.c # DRM_RCAR_WRITEBACK
rcar_lvds.c # DRM_RCAR_LVDS

But VSP and WRITEBACK are already implicitly dependant upon DRM_RCAR_DU because they get built into the DU module.

So indeed, only the RCAR_LVDS is a separate module, using those helpers, so I think a select is a reasonable fix.

I would also ask whether DRM_RCAR_LVDS should depend upon DRM_RCAR_DU though as well.

There is no linkage requirement, as it's a standalone bridge driver from what I can see, but I don't think it serves much purpose without the DU?

Anyway, even if it's just for compile testing maybe, the select here should be fine.

Quoted 11 lines
---
 drivers/gpu/drm/rcar-du/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/rcar-du/Kconfig +0 -0
index 0919f1f159a4..f65d1489dc50 100644

drivers/gpu/drm/rcar-du/Kconfig config DRM_RCAR_DW_HDMI · line 37

Quoted 7 lines
drivers/gpu/drm/rcar-du/Kconfig +1 -0
@@ -31,6 +31,7 @@ config DRM_RCAR_DW_HDMI
 config DRM_RCAR_LVDS
 	tristate "R-Car DU LVDS Encoder Support"
 	depends on DRM && DRM_BRIDGE && OF
+	select DRM_KMS_HELPER
 	select DRM_PANEL
 	select OF_FLATTREE
 	select OF_OVERLAY

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author
#3 lore raw

Hi Kieran and Emil,

Quoted 36 lines · Kieran Bingham

Hi Daniel,

Quoted 4 lines · Daniel Gomez

Select DRM_KMS_HELPER dependency.

Build error when DRM_KMS_HELPER is not selected:

Quoted 8 lines

drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd48): undefined reference to drm_atomic_helper_bridge_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd50): undefined reference to drm_atomic_helper_bridge_destroy_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd70): undefined reference to drm_atomic_helper_bridge_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xdc8): undefined reference to drm_atomic_helper_connector_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xde0): undefined reference to drm_helper_probe_single_connector_modes' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe08): undefined reference to drm_atomic_helper_connector_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe10): undefined reference to `drm_atomic_helper_connector_destroy_state'

Looking at the files in rcar_du that utilise drm_atomic_helpers...

git grep -l drm_atomic_helper_ drivers/gpu/drm/rcar-du/
drivers/gpu/drm/rcar-du/rcar_du_crtc.c drivers/gpu/drm/rcar-du/rcar_du_kms.c drivers/gpu/drm/rcar-du/rcar_du_plane.c drivers/gpu/drm/rcar-du/rcar_du_vsp.c drivers/gpu/drm/rcar-du/rcar_du_writeback.c drivers/gpu/drm/rcar-du/rcar_lvds.c

of those, these are configurable:

 rcar_du_vsp.c          # DRM_RCAR_VSP
 rcar_du_writeback.c    # DRM_RCAR_WRITEBACK
 rcar_lvds.c            # DRM_RCAR_LVDS

But VSP and WRITEBACK are already implicitly dependant upon DRM_RCAR_DU because they get built into the DU module.

Quoted 8 lines

So indeed, only the RCAR_LVDS is a separate module, using those helpers, so I think a select is a reasonable fix.

I would also ask whether DRM_RCAR_LVDS should depend upon DRM_RCAR_DU though as well.

There is no linkage requirement, as it's a standalone bridge driver from what I can see, but I don't think it serves much purpose without the DU?

I have actually spotted when using arch/arm/configs/multi_v7_defconfig where DRM_RCAR_DU is built as module. But when I was reviewing it I was able to compile RCAR_LVDS=y with DRM_RCAR_DU=n. Also, according to
https://patchwork.kernel.org/patch/10159063/, the LVDS encoders used to be described as part of the DU but not after the patch. So, I assume it can be used without the DU but not completely sure.

Quoted 25 lines

Anyway, even if it's just for compile testing maybe, the select here should be fine.

Quoted 18 lines
---
 drivers/gpu/drm/rcar-du/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/rcar-du/Kconfig +1 -0
index 0919f1f159a4..f65d1489dc50 100644
@@ -31,6 +31,7 @@ config DRM_RCAR_DW_HDMI
 config DRM_RCAR_LVDS
      tristate "R-Car DU LVDS Encoder Support"
      depends on DRM && DRM_BRIDGE && OF
+     select DRM_KMS_HELPER
      select DRM_PANEL
      select OF_FLATTREE
      select OF_OVERLAY
Reviewed-by on v1 1/1
#4 lore raw
In reply to Daniel Gomez

Hi Daniel,

Thank you for the patch.

Quoted 12 lines · Daniel Gomez

Select DRM_KMS_HELPER dependency.

Build error when DRM_KMS_HELPER is not selected:

drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd48): undefined reference to drm_atomic_helper_bridge_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd50): undefined reference to drm_atomic_helper_bridge_destroy_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd70): undefined reference to drm_atomic_helper_bridge_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xdc8): undefined reference to drm_atomic_helper_connector_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xde0): undefined reference to drm_helper_probe_single_connector_modes' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe08): undefined reference to drm_atomic_helper_connector_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe10): undefined reference to `drm_atomic_helper_connector_destroy_state'

Quoted 1 line

and taken in my tree for v5.9. If you think it should get in v5.8 as a fix, I can do so as well, could you then provide a Fixes: tag ?

Quoted 16 lines
---
 drivers/gpu/drm/rcar-du/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/rcar-du/Kconfig +1 -0
index 0919f1f159a4..f65d1489dc50 100644
@@ -31,6 +31,7 @@ config DRM_RCAR_DW_HDMI
 config DRM_RCAR_LVDS
 	tristate "R-Car DU LVDS Encoder Support"
 	depends on DRM && DRM_BRIDGE && OF
+	select DRM_KMS_HELPER
 	select DRM_PANEL
 	select OF_FLATTREE
 	select OF_OVERLAY
Signature · 7 lines
Regards,

Laurent Pinchart
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author
#5 lore raw

Hi Laurent,

Quoted 18 lines · Laurent Pinchart

Hi Daniel,

Thank you for the patch.

Quoted 12 lines · Daniel Gomez

Select DRM_KMS_HELPER dependency.

Build error when DRM_KMS_HELPER is not selected:

drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd48): undefined reference to drm_atomic_helper_bridge_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd50): undefined reference to drm_atomic_helper_bridge_destroy_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xd70): undefined reference to drm_atomic_helper_bridge_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xdc8): undefined reference to drm_atomic_helper_connector_reset' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xde0): undefined reference to drm_helper_probe_single_connector_modes' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe08): undefined reference to drm_atomic_helper_connector_duplicate_state' drivers/gpu/drm/rcar-du/rcar_lvds.o:(.rodata+0xe10): undefined reference to `drm_atomic_helper_connector_destroy_state'

Fixes c6a27fa41fab ("drm: rcar-du: Convert LVDS encoder code to bridge driver")
Quoted 6 lines
Quoted 1 line

and taken in my tree for v5.9. If you think it should get in v5.8 as a fix, I can do so as well, could you then provide a Fixes: tag ?

That would be fine. You can find above the fixes tag. Thanks!

Quoted 21 lines
Quoted 10 lines
---
 drivers/gpu/drm/rcar-du/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/rcar-du/Kconfig +0 -0
index 0919f1f159a4..f65d1489dc50 100644

drivers/gpu/drm/rcar-du/Kconfig config DRM_RCAR_DW_HDMI · line 37

Quoted 7 lines
drivers/gpu/drm/rcar-du/Kconfig +1 -0
@@ -31,6 +31,7 @@ config DRM_RCAR_DW_HDMI
 config DRM_RCAR_LVDS
      tristate "R-Car DU LVDS Encoder Support"
      depends on DRM && DRM_BRIDGE && OF
+     select DRM_KMS_HELPER
      select DRM_PANEL
      select OF_FLATTREE
      select OF_OVERLAY

--
Regards,

Quoted 1 line

Laurent Pinchart

Daniel