Skip to contentSkip to conversation

powerpc: Use shared font data

PATCH Superseded [email protected] 2 participants 5 messages Aug 7, 2023 – Aug 8, 2023 PowerPC

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 powerpc: Use shared font data

From: "Dr. David Alan Gilbert" <[email protected]>

PowerPC has a 'btext' font used for the console which is almost identical to the shared font_sun8x16, so use it rather than duplicating the data.

They were actually identical until about a decade ago when
commit bcfbeecea11c ("drivers: console: font_: Change a glyph from
"broken bar" to "vertical line"")

which changed the | in the shared font to be a solid bar rather than a broken bar. That's the only difference.

This was originally spotted by PMD which noticed that sparc does the same thing with the same data, and they also share a bunch of functions to manipulate the data. I've previously posted a near identical patch for sparc.

One difference I notice in PowerPC is that there are a bunch of compile options for the .c files for the early code to avoid a bunch of security compilation features; it's not clear to me if this is a problem for this font data.

Tested very lightly with a boot without FS in qemu.

v2
Added 'select FONT_SUPPORT' (to stop modconfig causing the font to be
linked into a module rather than the main kernel)
Added 'select FONTS' to satisfy requirements in lib/fonts

---
 arch/powerpc/Kconfig.debug  |   3 +
 arch/powerpc/kernel/btext.c | 360 +-----------------------------------
 2 files changed, 9 insertions(+), 354 deletions(-)
arch/powerpc/Kconfig.debug +3 -0
index 2a54fadbeaf51..521c4baf30e88 100644
@@ -147,6 +147,9 @@ config BDI_SWITCH
 config BOOTX_TEXT
 	bool "Support for early boot text console (BootX or OpenFirmware only)"
 	depends on PPC_BOOK3S
+	select FONT_SUN8x16
+	select FONT_SUPPORT
+	select FONTS
 	help
 	  Say Y here to see progress messages from the boot firmware in text
 	  mode. Requires either BootX or Open Firmware.
arch/powerpc/kernel/btext.c +6 -354

399 lines not on this page · raw message

Signature · 1 line
2.41.0
#1 lore raw

Hi--

Quoted 40 lines · On 8/6/23 18:07, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

PowerPC has a 'btext' font used for the console which is almost identical to the shared font_sun8x16, so use it rather than duplicating the data.

They were actually identical until about a decade ago when
commit bcfbeecea11c ("drivers: console: font_: Change a glyph from
"broken bar" to "vertical line"")

which changed the | in the shared font to be a solid bar rather than a broken bar. That's the only difference.

This was originally spotted by PMD which noticed that sparc does the same thing with the same data, and they also share a bunch of functions to manipulate the data. I've previously posted a near identical patch for sparc.

One difference I notice in PowerPC is that there are a bunch of compile options for the .c files for the early code to avoid a bunch of security compilation features; it's not clear to me if this is a problem for this font data.

Tested very lightly with a boot without FS in qemu.

v2
Added 'select FONT_SUPPORT' (to stop modconfig causing the font to be
linked into a module rather than the main kernel)
Added 'select FONTS' to satisfy requirements in lib/fonts

---
 arch/powerpc/Kconfig.debug  |   3 +
 arch/powerpc/kernel/btext.c | 360 +-----------------------------------
 2 files changed, 9 insertions(+), 354 deletions(-)
arch/powerpc/Kconfig.debug +0 -0
index 2a54fadbeaf51..521c4baf30e88 100644

arch/powerpc/Kconfig.debug config BDI_SWITCH · line 155

Quoted 9 lines
arch/powerpc/Kconfig.debug +3 -0
@@ -147,6 +147,9 @@ config BDI_SWITCH
 config BOOTX_TEXT
 	bool "Support for early boot text console (BootX or OpenFirmware only)"
 	depends on PPC_BOOK3S
+	select FONT_SUN8x16
+	select FONT_SUPPORT
+	select FONTS
 	help
 	  Say Y here to see progress messages from the boot firmware in text
 	  mode. Requires either BootX or Open Firmware.

kconfig tells me:

WARNING: unmet direct dependencies detected for FONTS
Depends on [n]: FONT_SUPPORT [=y] && (FRAMEBUFFER_CONSOLE [=n] || STI_CONSOLE [=n]) Selected by [y]:
- BOOTX_TEXT [=y] && PPC_BOOK3S [=y]

WARNING: unmet direct dependencies detected for FONT_SUN8x16
Depends on [n]: FONT_SUPPORT [=y] && FRAMEBUFFER_CONSOLE [=n] && (!SPARC && FONTS [=y] || SPARC) Selected by [y]:
- BOOTX_TEXT [=y] && PPC_BOOK3S [=y]

because FONTS depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE and neither of those is set.

Signature · 1 line
~Randy
#2 lore raw
Quoted 60 lines · * Randy Dunlap ([email protected]) wrote:

Hi--

Quoted 40 lines · On 8/6/23 18:07, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

PowerPC has a 'btext' font used for the console which is almost identical to the shared font_sun8x16, so use it rather than duplicating the data.

They were actually identical until about a decade ago when
commit bcfbeecea11c ("drivers: console: font_: Change a glyph from
"broken bar" to "vertical line"")

which changed the | in the shared font to be a solid bar rather than a broken bar. That's the only difference.

This was originally spotted by PMD which noticed that sparc does the same thing with the same data, and they also share a bunch of functions to manipulate the data. I've previously posted a near identical patch for sparc.

One difference I notice in PowerPC is that there are a bunch of compile options for the .c files for the early code to avoid a bunch of security compilation features; it's not clear to me if this is a problem for this font data.

Tested very lightly with a boot without FS in qemu.

v2
Added 'select FONT_SUPPORT' (to stop modconfig causing the font to be
linked into a module rather than the main kernel)
Added 'select FONTS' to satisfy requirements in lib/fonts

---
 arch/powerpc/Kconfig.debug  |   3 +
 arch/powerpc/kernel/btext.c | 360 +-----------------------------------
 2 files changed, 9 insertions(+), 354 deletions(-)
arch/powerpc/Kconfig.debug +0 -0
index 2a54fadbeaf51..521c4baf30e88 100644

arch/powerpc/Kconfig.debug config BDI_SWITCH · line 155

Quoted 9 lines
arch/powerpc/Kconfig.debug +3 -0
@@ -147,6 +147,9 @@ config BDI_SWITCH
 config BOOTX_TEXT
 	bool "Support for early boot text console (BootX or OpenFirmware only)"
 	depends on PPC_BOOK3S
+	select FONT_SUN8x16
+	select FONT_SUPPORT
+	select FONTS
 	help
 	  Say Y here to see progress messages from the boot firmware in text
 	  mode. Requires either BootX or Open Firmware.

kconfig tells me:

WARNING: unmet direct dependencies detected for FONTS
Depends on [n]: FONT_SUPPORT [=y] && (FRAMEBUFFER_CONSOLE [=n] || STI_CONSOLE [=n]) Selected by [y]:
- BOOTX_TEXT [=y] && PPC_BOOK3S [=y]

Quoted 6 lines

WARNING: unmet direct dependencies detected for FONT_SUN8x16
Depends on [n]: FONT_SUPPORT [=y] && FRAMEBUFFER_CONSOLE [=n] && (!SPARC && FONTS [=y] || SPARC) Selected by [y]:
- BOOTX_TEXT [=y] && PPC_BOOK3S [=y]

because FONTS depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE and neither of those is set.

I'm not getting the warnings in the v2, with a few configs; what command are using?

I'm tempted to change the FONT_SUN8x16 dependency line to have SPARC||BOOTX_TEXT or SPARC||POWERPC and drop the 'select FONTS' I added.

Dave

Quoted 3 lines
Signature · 2 lines
-- 
~Randy
Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/
#3 lore raw
Quoted 66 lines · Dr. David Alan Gilbert
Quoted 65 lines · * Randy Dunlap ([email protected]) wrote:

Hi--

Quoted 40 lines · On 8/6/23 18:07, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

PowerPC has a 'btext' font used for the console which is almost identical to the shared font_sun8x16, so use it rather than duplicating the data.

They were actually identical until about a decade ago when
commit bcfbeecea11c ("drivers: console: font_: Change a glyph from
"broken bar" to "vertical line"")

which changed the | in the shared font to be a solid bar rather than a broken bar. That's the only difference.

This was originally spotted by PMD which noticed that sparc does the same thing with the same data, and they also share a bunch of functions to manipulate the data. I've previously posted a near identical patch for sparc.

One difference I notice in PowerPC is that there are a bunch of compile options for the .c files for the early code to avoid a bunch of security compilation features; it's not clear to me if this is a problem for this font data.

Tested very lightly with a boot without FS in qemu.

v2
Added 'select FONT_SUPPORT' (to stop modconfig causing the font to be
linked into a module rather than the main kernel)
Added 'select FONTS' to satisfy requirements in lib/fonts

---
 arch/powerpc/Kconfig.debug  |   3 +
 arch/powerpc/kernel/btext.c | 360 +-----------------------------------
 2 files changed, 9 insertions(+), 354 deletions(-)
arch/powerpc/Kconfig.debug +0 -0
index 2a54fadbeaf51..521c4baf30e88 100644

arch/powerpc/Kconfig.debug config BDI_SWITCH · line 155

Quoted 9 lines
arch/powerpc/Kconfig.debug +3 -0
@@ -147,6 +147,9 @@ config BDI_SWITCH
 config BOOTX_TEXT
 	bool "Support for early boot text console (BootX or OpenFirmware only)"
 	depends on PPC_BOOK3S
+	select FONT_SUN8x16
+	select FONT_SUPPORT
+	select FONTS
 	help
 	  Say Y here to see progress messages from the boot firmware in text
 	  mode. Requires either BootX or Open Firmware.

kconfig tells me:

WARNING: unmet direct dependencies detected for FONTS
Depends on [n]: FONT_SUPPORT [=y] && (FRAMEBUFFER_CONSOLE [=n] || STI_CONSOLE [=n]) Selected by [y]:
- BOOTX_TEXT [=y] && PPC_BOOK3S [=y]

WARNING: unmet direct dependencies detected for FONT_SUN8x16
Depends on [n]: FONT_SUPPORT [=y] && FRAMEBUFFER_CONSOLE [=n] && (!SPARC && FONTS [=y] || SPARC) Selected by [y]:
- BOOTX_TEXT [=y] && PPC_BOOK3S [=y]

Quoted 5 lines
Quoted 1 line

because FONTS depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE and neither of those is set.

I'm not getting the warnings in the v2, with a few configs; what command are using?

My 'make' build target is either pp32_randconfig or ppc64_randconfig. I see kconfig warnings in > 50% of the randconfigs. (small sample size, around 20)

Quoted 9 lines

I'm tempted to change the FONT_SUN8x16 dependency line to have SPARC||BOOTX_TEXT or SPARC||POWERPC and drop the 'select FONTS' I added.

Dave

Quoted 3 lines
Signature · 2 lines
-- 
~Randy
Signature · 1 line
~Randy
#4 lore raw
Quoted 71 lines · * Randy Dunlap ([email protected]) wrote:
Quoted 68 lines · Dr. David Alan Gilbert
Quoted 66 lines · * Randy Dunlap ([email protected]) wrote:

Hi--

Quoted 40 lines · On 8/6/23 18:07, [email protected] wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

PowerPC has a 'btext' font used for the console which is almost identical to the shared font_sun8x16, so use it rather than duplicating the data.

They were actually identical until about a decade ago when
commit bcfbeecea11c ("drivers: console: font_: Change a glyph from
"broken bar" to "vertical line"")

which changed the | in the shared font to be a solid bar rather than a broken bar. That's the only difference.

This was originally spotted by PMD which noticed that sparc does the same thing with the same data, and they also share a bunch of functions to manipulate the data. I've previously posted a near identical patch for sparc.

One difference I notice in PowerPC is that there are a bunch of compile options for the .c files for the early code to avoid a bunch of security compilation features; it's not clear to me if this is a problem for this font data.

Tested very lightly with a boot without FS in qemu.

v2
Added 'select FONT_SUPPORT' (to stop modconfig causing the font to be
linked into a module rather than the main kernel)
Added 'select FONTS' to satisfy requirements in lib/fonts

---
 arch/powerpc/Kconfig.debug  |   3 +
 arch/powerpc/kernel/btext.c | 360 +-----------------------------------
 2 files changed, 9 insertions(+), 354 deletions(-)
arch/powerpc/Kconfig.debug +0 -0
index 2a54fadbeaf51..521c4baf30e88 100644

arch/powerpc/Kconfig.debug config BDI_SWITCH · line 155

Quoted 9 lines
arch/powerpc/Kconfig.debug +3 -0
@@ -147,6 +147,9 @@ config BDI_SWITCH
 config BOOTX_TEXT
 	bool "Support for early boot text console (BootX or OpenFirmware only)"
 	depends on PPC_BOOK3S
+	select FONT_SUN8x16
+	select FONT_SUPPORT
+	select FONTS
 	help
 	  Say Y here to see progress messages from the boot firmware in text
 	  mode. Requires either BootX or Open Firmware.

kconfig tells me:

WARNING: unmet direct dependencies detected for FONTS
Depends on [n]: FONT_SUPPORT [=y] && (FRAMEBUFFER_CONSOLE [=n] || STI_CONSOLE [=n]) Selected by [y]:
- BOOTX_TEXT [=y] && PPC_BOOK3S [=y]

WARNING: unmet direct dependencies detected for FONT_SUN8x16
Depends on [n]: FONT_SUPPORT [=y] && FRAMEBUFFER_CONSOLE [=n] && (!SPARC && FONTS [=y] || SPARC) Selected by [y]:
- BOOTX_TEXT [=y] && PPC_BOOK3S [=y]

because FONTS depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE and neither of those is set.

Quoted 7 lines
Quoted 3 lines

I'm not getting the warnings in the v2, with a few configs; what command are using?

My 'make' build target is either pp32_randconfig or ppc64_randconfig. I see kconfig warnings in > 50% of the randconfigs. (small sample size, around 20)

Thanks, that triggers it for me; I'll have a discussion with it....

Dave

Quoted 13 lines
Quoted 10 lines

I'm tempted to change the FONT_SUN8x16 dependency line to have SPARC||BOOTX_TEXT or SPARC||POWERPC and drop the 'select FONTS' I added.

Dave

Quoted 3 lines
Signature · 2 lines
-- 
~Randy
Signature · 1 line
~Randy
Signature · 4 lines
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/