Skip to contentSkip to conversation

fbdev: offb: allow build when DRM_OFDRM=m

PATCH In review Randy Dunlap 4 participants 7 messages Nov 23, 2022 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbdev: offb: allow build when DRM_OFDRM=m

Fix build when CONFIG_FB_OF=y and CONFIG_DRM_OFDRM=m.
When the latter symbol is =m, kconfig downgrades (limits) the 'select's under FB_OF to modular (=m). This causes undefined symbol references:

powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x58): undefined reference to `cfb_fillrect'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x60): undefined reference to `cfb_copyarea'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x68): undefined reference to `cfb_imageblit'

Fix this by allowing FB_OF any time that DRM_OFDRM != y so that the selected FB_CFB_* symbols will become =y instead of =m.

In tristate logic (for DRM_OFDRM), this changes the dependency from

    !DRM_OFDRM	== 2 - 1 == 1 => modular only (or disabled)
to (boolean)
    DRM_OFDRM != y == y, allowing the 'select's to cause the

FB_CFB_* symbols to =y instead of =m.

Fixes c8a17756c425 ("drm/ofdrm: Add ofdrm for Open Firmware framebuffers")
Cc Thomas Zimmermann <[email protected]>
Cc Michal Suchánek <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Helge Deller <[email protected]>
---
 drivers/video/fbdev/Kconfig |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/Kconfig +1 -1
diff -- a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
@@ -455,7 +455,7 @@ config FB_ATARI
 config FB_OF
 	bool "Open Firmware frame buffer device support"
 	depends on (FB = y) && PPC && (!PPC_PSERIES || PCI)
-	depends on !DRM_OFDRM
+	depends on DRM_OFDRM != y
 	select APERTURE_HELPERS
 	select FB_CFB_FILLRECT
 	select FB_CFB_COPYAREA
Acked-by on v1 1/1
#1 lore raw

Am 23.11.22 um 04:16 schrieb Randy Dunlap:

Quoted 17 lines

Fix build when CONFIG_FB_OF=y and CONFIG_DRM_OFDRM=m.
When the latter symbol is =m, kconfig downgrades (limits) the 'select's under FB_OF to modular (=m). This causes undefined symbol references:

powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x58): undefined reference to `cfb_fillrect'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x60): undefined reference to `cfb_copyarea'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x68): undefined reference to `cfb_imageblit'

Fix this by allowing FB_OF any time that DRM_OFDRM != y so that the selected FB_CFB_* symbols will become =y instead of =m.

In tristate logic (for DRM_OFDRM), this changes the dependency from

     !DRM_OFDRM	== 2 - 1 == 1 => modular only (or disabled)
to (boolean)
     DRM_OFDRM != y == y, allowing the 'select's to cause the

FB_CFB_* symbols to =y instead of =m.

Quoted 10 lines
Fixes c8a17756c425 ("drm/ofdrm: Add ofdrm for Open Firmware framebuffers")
Cc Thomas Zimmermann <[email protected]>
Cc Michal Suchánek <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Helge Deller <[email protected]>
Quoted 16 lines
---
  drivers/video/fbdev/Kconfig |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff -- a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig

drivers/video/fbdev/Kconfig +1 -1
@@ -455,7 +455,7 @@ config FB_ATARI
  config FB_OF
  	bool "Open Firmware frame buffer device support"
  	depends on (FB = y) && PPC && (!PPC_PSERIES || PCI)
-	depends on !DRM_OFDRM
+	depends on DRM_OFDRM != y
  	select APERTURE_HELPERS
  	select FB_CFB_FILLRECT
  	select FB_CFB_COPYAREA
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
#2 lore raw
Quoted 30 lines · Thomas Zimmermann

Am 23.11.22 um 04:16 schrieb Randy Dunlap:

Quoted 17 lines

Fix build when CONFIG_FB_OF=y and CONFIG_DRM_OFDRM=m.
When the latter symbol is =m, kconfig downgrades (limits) the 'select's under FB_OF to modular (=m). This causes undefined symbol references:

powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x58): undefined reference to `cfb_fillrect'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x60): undefined reference to `cfb_copyarea'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x68): undefined reference to `cfb_imageblit'

Fix this by allowing FB_OF any time that DRM_OFDRM != y so that the selected FB_CFB_* symbols will become =y instead of =m.

In tristate logic (for DRM_OFDRM), this changes the dependency from

     !DRM_OFDRM	== 2 - 1 == 1 => modular only (or disabled)
to (boolean)
     DRM_OFDRM != y == y, allowing the 'select's to cause the

FB_CFB_* symbols to =y instead of =m.

Quoted 10 lines
Fixes c8a17756c425 ("drm/ofdrm: Add ofdrm for Open Firmware framebuffers")
Cc Thomas Zimmermann <[email protected]>
Cc Michal Suchánek <[email protected]>
Cc Daniel Vetter <[email protected]>
Cc Helge Deller <[email protected]>
Quoted 1 line
Quoted 25 lines
Quoted 17 lines
---
  drivers/video/fbdev/Kconfig |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff -- a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig

drivers/video/fbdev/Kconfig +1 -1
@@ -455,7 +455,7 @@ config FB_ATARI
  config FB_OF
  	bool "Open Firmware frame buffer device support"
  	depends on (FB = y) && PPC && (!PPC_PSERIES || PCI)
-	depends on !DRM_OFDRM
+	depends on DRM_OFDRM != y
  	select APERTURE_HELPERS
  	select FB_CFB_FILLRECT
  	select FB_CFB_COPYAREA
Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
#3 lore raw
In reply to Randy Dunlap
Quoted 11 lines · Randy Dunlap

Fix build when CONFIG_FB_OF=y and CONFIG_DRM_OFDRM=m.
When the latter symbol is =m, kconfig downgrades (limits) the 'select's under FB_OF to modular (=m). This causes undefined symbol references:

powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x58):
undefined reference to `cfb_fillrect'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x60):
undefined reference to `cfb_copyarea'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x68):
undefined reference to `cfb_imageblit'

Quoted 9 lines

Fix this by allowing FB_OF any time that DRM_OFDRM != y so that the selected FB_CFB_* symbols will become =y instead of =m.

In tristate logic (for DRM_OFDRM), this changes the dependency from

    !DRM_OFDRM	== 2 - 1 == 1 => modular only (or disabled)
to (boolean)
    DRM_OFDRM != y == y, allowing the 'select's to cause the

FB_CFB_* symbols to =y instead of =m.

Is it actually a useful configuration to have OFDRM=m and FB_OF=y though? I would expect in that case that the OFDRM driver never binds to a device because it's already owned by FB_OF.

drivers/video/fbdev/Kconfig config FB_ATARI · line 459

Quoted 10 lines

diff -- a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig

drivers/video/fbdev/Kconfig +1 -1
@@ -455,7 +455,7 @@ config FB_ATARI
 config FB_OF
 	bool "Open Firmware frame buffer device support"
 	depends on (FB = y) && PPC && (!PPC_PSERIES || PCI)
-	depends on !DRM_OFDRM
+	depends on DRM_OFDRM != y
 	select APERTURE_HELPERS

I would instead make this 'depends on DRM_OFDRM=n', which completely eliminates configs that have both driver enabled.

A nicer change would be to make FB_OF a tristate symbol, which makes it possible to load one of the two modules if both are enabled =m, while only allowing one of them to be =y if the other is completely disabled. It looks like offb was originally written to be usable as a loadable module, but Kconfig has prevented this since at least the start of the git history.

Arnd

#4 lore raw

Hi Arnd,

Quoted 27 lines · Arnd Bergmann
Quoted 11 lines · Randy Dunlap

Fix build when CONFIG_FB_OF=y and CONFIG_DRM_OFDRM=m.
When the latter symbol is =m, kconfig downgrades (limits) the 'select's under FB_OF to modular (=m). This causes undefined symbol references:

powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x58):
undefined reference to `cfb_fillrect'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x60):
undefined reference to `cfb_copyarea'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x68):
undefined reference to `cfb_imageblit'

Quoted 9 lines

Fix this by allowing FB_OF any time that DRM_OFDRM != y so that the selected FB_CFB_* symbols will become =y instead of =m.

In tristate logic (for DRM_OFDRM), this changes the dependency from

    !DRM_OFDRM	== 2 - 1 == 1 => modular only (or disabled)
to (boolean)
    DRM_OFDRM != y == y, allowing the 'select's to cause the

FB_CFB_* symbols to =y instead of =m.

Is it actually a useful configuration to have OFDRM=m and FB_OF=y though? I would expect in that case that the OFDRM driver never binds to a device because it's already owned by FB_OF.

Quoted 13 lines

drivers/video/fbdev/Kconfig config FB_ATARI · line 459

Quoted 10 lines

diff -- a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig

drivers/video/fbdev/Kconfig +1 -1
@@ -455,7 +455,7 @@ config FB_ATARI
 config FB_OF
 	bool "Open Firmware frame buffer device support"
 	depends on (FB = y) && PPC && (!PPC_PSERIES || PCI)
-	depends on !DRM_OFDRM
+	depends on DRM_OFDRM != y
 	select APERTURE_HELPERS

I would instead make this 'depends on DRM_OFDRM=n', which completely eliminates configs that have both driver enabled.

Yep, that works for me. Thanks.

Thomas, Michal, are you OK with that change?

Quoted 7 lines

A nicer change would be to make FB_OF a tristate symbol, which makes it possible to load one of the two modules if both are enabled =m, while only allowing one of them to be =y if the other is completely disabled. It looks like offb was originally written to be usable as a loadable module, but Kconfig has prevented this since at least the start of the git history.

Signature · 1 line
~Randy
#5 lore raw

Hi

Am 23.11.22 um 11:02 schrieb Randy Dunlap:

Quoted 44 lines

Hi Arnd,

Quoted 27 lines · Arnd Bergmann
Quoted 11 lines · Randy Dunlap

Fix build when CONFIG_FB_OF=y and CONFIG_DRM_OFDRM=m.
When the latter symbol is =m, kconfig downgrades (limits) the 'select's under FB_OF to modular (=m). This causes undefined symbol references:

powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x58):
undefined reference to `cfb_fillrect'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x60):
undefined reference to `cfb_copyarea'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x68):
undefined reference to `cfb_imageblit'

Quoted 9 lines

Fix this by allowing FB_OF any time that DRM_OFDRM != y so that the selected FB_CFB_* symbols will become =y instead of =m.

In tristate logic (for DRM_OFDRM), this changes the dependency from

     !DRM_OFDRM	== 2 - 1 == 1 => modular only (or disabled)
to (boolean)
     DRM_OFDRM != y == y, allowing the 'select's to cause the

FB_CFB_* symbols to =y instead of =m.

Is it actually a useful configuration to have OFDRM=m and FB_OF=y though? I would expect in that case that the OFDRM driver never binds to a device because it's already owned by FB_OF.

Quoted 13 lines

drivers/video/fbdev/Kconfig config FB_ATARI · line 459

Quoted 10 lines

diff -- a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig

drivers/video/fbdev/Kconfig +1 -1
@@ -455,7 +455,7 @@ config FB_ATARI
  config FB_OF
  	bool "Open Firmware frame buffer device support"
  	depends on (FB = y) && PPC && (!PPC_PSERIES || PCI)
-	depends on !DRM_OFDRM
+	depends on DRM_OFDRM != y
  	select APERTURE_HELPERS

I would instead make this 'depends on DRM_OFDRM=n', which completely eliminates configs that have both driver enabled.

Quoted 3 lines

Yep, that works for me. Thanks.

Thomas, Michal, are you OK with that change?

Yes.

Quoted 9 lines
Quoted 8 lines

A nicer change would be to make FB_OF a tristate symbol, which makes it possible to load one of the two modules if both are enabled =m, while only allowing one of them to be =y if the other is completely disabled. It looks like offb was originally written to be usable as a loadable module, but Kconfig has prevented this since at least the start of the git history.

Signature · 6 lines
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Ivo Totev
#6 lore raw
In reply to Randy Dunlap
Quoted 44 lines · Randy Dunlap

Hi Arnd,

Quoted 27 lines · Arnd Bergmann
Quoted 11 lines · Randy Dunlap

Fix build when CONFIG_FB_OF=y and CONFIG_DRM_OFDRM=m.
When the latter symbol is =m, kconfig downgrades (limits) the 'select's under FB_OF to modular (=m). This causes undefined symbol references:

powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x58):
undefined reference to `cfb_fillrect'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x60):
undefined reference to `cfb_copyarea'
powerpc64-linux-ld: drivers/video/fbdev/offb.o:(.data.rel.ro+0x68):
undefined reference to `cfb_imageblit'

Quoted 9 lines

Fix this by allowing FB_OF any time that DRM_OFDRM != y so that the selected FB_CFB_* symbols will become =y instead of =m.

In tristate logic (for DRM_OFDRM), this changes the dependency from

    !DRM_OFDRM	== 2 - 1 == 1 => modular only (or disabled)
to (boolean)
    DRM_OFDRM != y == y, allowing the 'select's to cause the

FB_CFB_* symbols to =y instead of =m.

Is it actually a useful configuration to have OFDRM=m and FB_OF=y though? I would expect in that case that the OFDRM driver never binds to a device because it's already owned by FB_OF.

Quoted 13 lines

drivers/video/fbdev/Kconfig config FB_ATARI · line 459

Quoted 10 lines

diff -- a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig

drivers/video/fbdev/Kconfig +1 -1
@@ -455,7 +455,7 @@ config FB_ATARI
 config FB_OF
 	bool "Open Firmware frame buffer device support"
 	depends on (FB = y) && PPC && (!PPC_PSERIES || PCI)
-	depends on !DRM_OFDRM
+	depends on DRM_OFDRM != y
 	select APERTURE_HELPERS

I would instead make this 'depends on DRM_OFDRM=n', which completely eliminates configs that have both driver enabled.

Quoted 11 lines

Yep, that works for me. Thanks.

Thomas, Michal, are you OK with that change?

Quoted 7 lines

A nicer change would be to make FB_OF a tristate symbol, which makes it possible to load one of the two modules if both are enabled =m, while only allowing one of them to be =y if the other is completely disabled. It looks like offb was originally written to be usable as a loadable module, but Kconfig has prevented this since at least the start of the git history.

ISTM that a distro would prefer to have both DFM_OFDRM and FB_OF as tristate symbols that could both be built as loadable modules, as Arnd describes above.
I'll look into that.

Signature · 1 line
~Randy