Skip to contentSkip to conversation

vidconsole: refactoring and support for wider fonts

PATCH Superseded Dzmitry Sankouski 2 participants 3 messages Feb 20, 2023 – Feb 21, 2023 Framebuffer layer

v5 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v5 cover vidconsole: refactoring and support for wider fonts

Version 5 contain minor changes:
- move common functions to console-core.c file
- remove static keyword from shared functions

In version 4, only first patch sent, because review fixes to this would add large rebase & patch formatting overhead. When it'll receive reviewed tag, I'll resent entire rebased series.

Modern mobile phones typically have high pixel density. Bootmenu is hardly readable on those with 8x16 font.

This patch series aims to add wider fonts for devices with high ppi.

Add 16x32, 12x22 fonts from linux, and allow font size configuration.

There was significant changes in version 2:
- fix video tests failures
- add runtime font size configuration
- add test for 12x22 font

In version 3,
'video console: add select font logic to vidconsole uclass driver' patch was removed in favor of already merged patch 'video: Add font functions to the vidconsole API'

Dzmitry Sankouski (1):
video console: refactoring and optimization

 drivers/video/Makefile              |   6 +
 drivers/video/console_core.c        | 141 +++++++++++++
 drivers/video/console_normal.c      | 150 ++++----------
 drivers/video/console_rotate.c      | 308 ++++------------------------
 drivers/video/vidconsole_internal.h |  95 +++++++++
 5 files changed, 324 insertions(+), 376 deletions(-)
 create mode 100644 drivers/video/console_core.c
 create mode 100644 drivers/video/vidconsole_internal.h
Signature · 1 line
2.30.2
#1 lore raw

PATCH v5 1/1 video console: refactoring and optimization

- move common code to vidconsole_internal.h and console_core.c
- unite probe functions
- get rid of code duplications in switch across bpp values
- extract common pixel fill logic in two functions one per horizontal and vertical filling
- rearrange statements in put_xy* methods in unified way
- replace types - uint*_t to u*

---
Changes for v2: none
Changes for v3: none
Changes for v4:
- move common code to vidconsole_internal.h
- unite probe functions
Changes for v5:
- move common functions to console-core.c file
- remove static keyword from shared functions

 drivers/video/Makefile              |   6 +
 drivers/video/console_core.c        | 141 +++++++++++++
 drivers/video/console_normal.c      | 150 ++++----------
 drivers/video/console_rotate.c      | 308 ++++------------------------
 drivers/video/vidconsole_internal.h |  95 +++++++++
 5 files changed, 324 insertions(+), 376 deletions(-)
 create mode 100644 drivers/video/console_core.c
 create mode 100644 drivers/video/vidconsole_internal.h
drivers/video/Makefile +6 -0
index cdb7d9a54d..cb3f373645 100644
@@ -9,6 +9,12 @@ obj-$(CONFIG_BACKLIGHT_GPIO) += backlight_gpio.o
 obj-$(CONFIG_BACKLIGHT_PWM) += pwm_backlight.o
 obj-$(CONFIG_CONSOLE_NORMAL) += console_normal.o
 obj-$(CONFIG_CONSOLE_ROTATION) += console_rotate.o
+ifdef CONFIG_CONSOLE_NORMAL
+obj-y += console_core.o
+else ifdef CONFIG_CONSOLE_ROTATION
+obj-y += console_core.o
+endif
+obj-$(CONFIG_CONSOLE_ROTATION) += console_core.o
 obj-$(CONFIG_CONSOLE_TRUETYPE) += console_truetype.o fonts/
 obj-$(CONFIG_DISPLAY) += display-uclass.o
 obj-$(CONFIG_VIDEO_MIPI_DSI) += dsi-host-uclass.o
drivers/video/console_core.c new file +141 -0

141 lines not on this page · raw message

drivers/video/console_normal.c +38 -112

202 lines not on this page · raw message

drivers/video/console_rotate.c +44 -264

427 lines not on this page · raw message

drivers/video/vidconsole_internal.h new file +95 -0

95 lines not on this page · raw message

Signature · 1 line
2.30.2
Reviewed-by on v5 1/1
#2 lore raw

Re: [PATCH v5 1/1] video console: refactoring and optimization

Quoted 20 lines · Dzmitry Sankouski

- move common code to vidconsole_internal.h and console_core.c
- unite probe functions
- get rid of code duplications in switch across bpp values
- extract common pixel fill logic in two functions one per horizontal and vertical filling
- rearrange statements in put_xy* methods in unified way
- replace types - uint*_t to u*

---
Changes for v2: none
Changes for v3: none
Changes for v4:
- move common code to vidconsole_internal.h
- unite probe functions
Changes for v5:
- move common functions to console-core.c file
- remove static keyword from shared functions

Quoted 8 lines
 drivers/video/Makefile              |   6 +
 drivers/video/console_core.c        | 141 +++++++++++++
 drivers/video/console_normal.c      | 150 ++++----------
 drivers/video/console_rotate.c      | 308 ++++------------------------
 drivers/video/vidconsole_internal.h |  95 +++++++++
 5 files changed, 324 insertions(+), 376 deletions(-)
 create mode 100644 drivers/video/console_core.c
 create mode 100644 drivers/video/vidconsole_internal.h