Skip to contentSkip to conversation

drm/drm_panel: fix export of drm_panel_of_backlight, try #3

PATCH In review Arnd Bergmann 3 participants 7 messages Jan 7, 2020 – Jan 12, 2020

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

PATCH 1/1 drm/drm_panel: fix export of drm_panel_of_backlight, try #3

Making this IS_REACHABLE() was still wrong, as that just determines whether the lower-level backlight code would be reachable from the panel driver. However, with CONFIG_DRM=y and CONFIG_BACKLIGHT_CLASS_DEVICE=m, the drm_panel_of_backlight is left out of drm_panel.o but the condition tells the driver that it is there, leading to multiple link errors such as

ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sitronix-st7701.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sharp-ls043t1le01.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-seiko-43wvf1g.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-ronbo-rb070d30.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-rocktech-jh057n00900.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.ko] undefined!

Change the condition to check for whether the function was actually part of the drm module. This version of the patch survived a few hundred randconfig builds, so I have a good feeling this might be the last one for the export.

Fixes 4a34a9dcec94 ("drm/drm_panel: Fix EXPORT of drm_panel_of_backlight() one more time")
Fixes 907aa265fde6 ("drm/drm_panel: fix EXPORT of drm_panel_of_backlight")
Fixes 152dbdeab1b2 ("drm/panel: add backlight support")
---
 include/drm/drm_panel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/drm/drm_panel.h +2 -1
index 121f7aabccd1..6193cb555acc 100644
@@ -198,7 +198,8 @@ static inline struct drm_panel *of_drm_find_panel(const struct device_node *np)
 }
 #endif
 
-#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if IS_ENABLED(CONFIG_DRM_PANEL) && (IS_BUILTIN(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
+	(IS_MODULE(CONFIG_DRM) && IS_MODULE(CONFIG_BACKLIGHT_CLASS_DEVICE)))
 int drm_panel_of_backlight(struct drm_panel *panel);
 #else
 static inline int drm_panel_of_backlight(struct drm_panel *panel)
Signature · 6 lines
2.20.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 14 lines · Arnd Bergmann

Making this IS_REACHABLE() was still wrong, as that just determines whether the lower-level backlight code would be reachable from the panel driver. However, with CONFIG_DRM=y and CONFIG_BACKLIGHT_CLASS_DEVICE=m, the drm_panel_of_backlight is left out of drm_panel.o but the condition tells the driver that it is there, leading to multiple link errors such as

ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sitronix-st7701.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sharp-ls043t1le01.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-seiko-43wvf1g.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-ronbo-rb070d30.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-rocktech-jh057n00900.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.ko] undefined!

Quoted 4 lines

Change the condition to check for whether the function was actually part of the drm module. This version of the patch survived a few hundred randconfig builds, so I have a good feeling this might be the last one for the export.

Broken record, this will still be wrong, even if it builds and links. No backlight support for panel despite expectations.

See http://mid.mail-archive.com/[email protected]

All of this is just another hack until the backlight config usage is fixed for good. Do we really want to make this the example to copy paste wherever we hit the issue next?

I'm not naking, but I'm not acking either.

BR,
Jani.

Quoted 23 lines
Fixes 4a34a9dcec94 ("drm/drm_panel: Fix EXPORT of drm_panel_of_backlight() one more time")
Fixes 907aa265fde6 ("drm/drm_panel: fix EXPORT of drm_panel_of_backlight")
Fixes 152dbdeab1b2 ("drm/panel: add backlight support")
---
 include/drm/drm_panel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/drm/drm_panel.h +2 -1
index 121f7aabccd1..6193cb555acc 100644
@@ -198,7 +198,8 @@ static inline struct drm_panel *of_drm_find_panel(const struct device_node *np)
 }
 #endif
 
-#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if IS_ENABLED(CONFIG_DRM_PANEL) && (IS_BUILTIN(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
+	(IS_MODULE(CONFIG_DRM) && IS_MODULE(CONFIG_BACKLIGHT_CLASS_DEVICE)))
 int drm_panel_of_backlight(struct drm_panel *panel);
 #else
 static inline int drm_panel_of_backlight(struct drm_panel *panel)
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
#2 lore raw

Hi Jani.

Quoted 23 lines · Jani Nikula
Quoted 14 lines · Arnd Bergmann

Making this IS_REACHABLE() was still wrong, as that just determines whether the lower-level backlight code would be reachable from the panel driver. However, with CONFIG_DRM=y and CONFIG_BACKLIGHT_CLASS_DEVICE=m, the drm_panel_of_backlight is left out of drm_panel.o but the condition tells the driver that it is there, leading to multiple link errors such as

ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sitronix-st7701.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sharp-ls043t1le01.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-seiko-43wvf1g.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-ronbo-rb070d30.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-rocktech-jh057n00900.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.ko] undefined!

Quoted 4 lines

Change the condition to check for whether the function was actually part of the drm module. This version of the patch survived a few hundred randconfig builds, so I have a good feeling this might be the last one for the export.

Broken record, this will still be wrong, even if it builds and links. No backlight support for panel despite expectations.

Quoted 7 lines

See http://mid.mail-archive.com/[email protected]

All of this is just another hack until the backlight config usage is fixed for good. Do we really want to make this the example to copy paste wherever we hit the issue next?

I'm not naking, but I'm not acking either.

I will try to take a look at your old BACKLIGHT_CLASS_DEVICE patch this weekend. I think we need that one fixed - and then we can have this mess with "drm_panel_of_backlight" fixed in the right way.

Sigh...

Sam

#3 lore raw
Quoted 30 lines · Sam Ravnborg
Quoted 29 lines · Jani Nikula
Quoted 14 lines · Arnd Bergmann

Making this IS_REACHABLE() was still wrong, as that just determines whether the lower-level backlight code would be reachable from the panel driver. However, with CONFIG_DRM=y and CONFIG_BACKLIGHT_CLASS_DEVICE=m, the drm_panel_of_backlight is left out of drm_panel.o but the condition tells the driver that it is there, leading to multiple link errors such as

ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sitronix-st7701.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sharp-ls043t1le01.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-seiko-43wvf1g.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-ronbo-rb070d30.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-rocktech-jh057n00900.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.ko] undefined!

Quoted 4 lines

Change the condition to check for whether the function was actually part of the drm module. This version of the patch survived a few hundred randconfig builds, so I have a good feeling this might be the last one for the export.

Broken record, this will still be wrong, even if it builds and links. No backlight support for panel despite expectations.

See http://mid.mail-archive.com/[email protected]

All of this is just another hack until the backlight config usage is fixed for good. Do we really want to make this the example to copy paste wherever we hit the issue next?

Quoted 5 lines
Quoted 1 line

I'm not naking, but I'm not acking either.

I will try to take a look at your old BACKLIGHT_CLASS_DEVICE patch this weekend. I think we need that one fixed - and then we can have this mess with "drm_panel_of_backlight" fixed in the right way.

I had also attempted to fix the larger mess around 'select' statements in DRM/FB around BACKLIGHT_CLASS_DEVICE several times in the past, and even at some point sent a patch that was acked but never merged and later broke because of other changes.

If there is a new approach, I'm happy to add patches to my randconfig builder and see if there are regressions in some corner cases.

Arnd

#4 lore raw

Hi Arnd.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

All of this is just another hack until the backlight config usage is fixed for good. Do we really want to make this the example to copy paste wherever we hit the issue next?

I'm not naking, but I'm not acking either.

Quoted 8 lines
Quoted 3 lines

I will try to take a look at your old BACKLIGHT_CLASS_DEVICE patch this weekend. I think we need that one fixed - and then we can have this mess with "drm_panel_of_backlight" fixed in the right way.

I had also attempted to fix the larger mess around 'select' statements in DRM/FB around BACKLIGHT_CLASS_DEVICE several times in the past, and even at some point sent a patch that was acked but never merged and later broke because of other changes.

Any chance you have the patch around or can dig up a pointer? My google foo did not turn up anything.

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

#5 lore raw
Quoted 13 lines · Sam Ravnborg

Hi Arnd.

Quoted 10 lines
Quoted 9 lines
Quoted 5 lines

All of this is just another hack until the backlight config usage is fixed for good. Do we really want to make this the example to copy paste wherever we hit the issue next?

I'm not naking, but I'm not acking either.

I will try to take a look at your old BACKLIGHT_CLASS_DEVICE patch this weekend. I think we need that one fixed - and then we can have this mess with "drm_panel_of_backlight" fixed in the right way.

Quoted 7 lines
Quoted 4 lines

I had also attempted to fix the larger mess around 'select' statements in DRM/FB around BACKLIGHT_CLASS_DEVICE several times in the past, and even at some point sent a patch that was acked but never merged and later broke because of other changes.

Any chance you have the patch around or can dig up a pointer? My google foo did not turn up anything.

I found it now:
https://lore.kernel.org/lkml/[email protected]/

Arnd

#6 lore raw
In reply to Arnd Bergmann

Hi Arnd.

Quoted 19 lines · Arnd Bergmann

Making this IS_REACHABLE() was still wrong, as that just determines whether the lower-level backlight code would be reachable from the panel driver. However, with CONFIG_DRM=y and CONFIG_BACKLIGHT_CLASS_DEVICE=m, the drm_panel_of_backlight is left out of drm_panel.o but the condition tells the driver that it is there, leading to multiple link errors such as

ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sitronix-st7701.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-sharp-ls043t1le01.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-seiko-43wvf1g.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-ronbo-rb070d30.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-rocktech-jh057n00900.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-panasonic-vvx10f034n00.ko] undefined!
ERROR: "drm_panel_of_backlight" [drivers/gpu/drm/panel/panel-osd-osd101t2587-53ts.ko] undefined!

Change the condition to check for whether the function was actually part of the drm module. This version of the patch survived a few hundred randconfig builds, so I have a good feeling this might be the last one for the export.

Quoted 4 lines
Fixes 4a34a9dcec94 ("drm/drm_panel: Fix EXPORT of drm_panel_of_backlight() one more time")
Fixes 907aa265fde6 ("drm/drm_panel: fix EXPORT of drm_panel_of_backlight")
Fixes 152dbdeab1b2 ("drm/panel: add backlight support")

I spent some hours this weekend trying to improve the Kconfig logic around BACKLIGHT_CLASS_DEVICE and ACPI_VIDEO.

I did manage to change something but I did not manage to make something that is a real improvement to the current situation.
So everything abandoned.

As we need this fixed I have applied your patch to drm-misc-next. Thanks,

Sam

Quoted 20 lines
---
 include/drm/drm_panel.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
include/drm/drm_panel.h +2 -1
index 121f7aabccd1..6193cb555acc 100644
@@ -198,7 +198,8 @@ static inline struct drm_panel *of_drm_find_panel(const struct device_node *np)
 }
 #endif
 
-#if IS_REACHABLE(CONFIG_BACKLIGHT_CLASS_DEVICE)
+#if IS_ENABLED(CONFIG_DRM_PANEL) && (IS_BUILTIN(CONFIG_BACKLIGHT_CLASS_DEVICE) || \
+	(IS_MODULE(CONFIG_DRM) && IS_MODULE(CONFIG_BACKLIGHT_CLASS_DEVICE)))
 int drm_panel_of_backlight(struct drm_panel *panel);
 #else
 static inline int drm_panel_of_backlight(struct drm_panel *panel)
Signature · 1 line
2.20.0

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