Skip to content

fbcon,fonts: Refactor framebuffer console rotation

Thomas Zimmermann dri-devel linux-fbdev linux-serial lkml stable 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 1 replyIn review
  2. v110 patches 7 repliesApplied

Changes in v2 from the cover letter

- fix sparse truncated-bits warning
- improve font sorting in Makefile
- fix typos

[1] https://lore.kernel.org/linux-fbdev/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10fbcon: Avoid OOB font access if console rotation failsdrivers/video/fbdev/core/fbcon_rotate.c+4 -10 replies
2/10vt: Implement helpers for struct vc_font in source filedrivers/tty/vt/vt.c include/linux/console_struct.h+37 -280 replies
3/10lib/fonts: Provide helpers for calculating glyph pitch and sizedrivers/tty/vt/vt.c drivers/video/fbdev/core/fbcon_ccw.c drivers/video/fbdev/core/fbcon_cw.c +4 more+61 -210 replies
4/10lib/fonts: Clean up Makefilelib/fonts/Makefile+17 -180 replies
5/10lib/fonts: Implement glyph rotationdrivers/video/fbdev/core/fbcon_ccw.c drivers/video/fbdev/core/fbcon_cw.c drivers/video/fbdev/core/fbcon_rotate.c +4 more+167 -831 reply
6/10lib/fonts: Refactor glyph-pattern helperslib/fonts/font_rotate.c+27 -180 replies
7/10lib/fonts: Refactor glyph-rotation helperslib/fonts/font_rotate.c+49 -360 replies
8/10lib/fonts: Implement font rotationdrivers/video/fbdev/core/fbcon.h drivers/video/fbdev/core/fbcon_rotate.c include/linux/font.h +1 more+126 -600 replies
9/10fbcon: Fill cursor mask in helper functiondrivers/video/fbdev/core/bitblit.c drivers/video/fbdev/core/fbcon.c drivers/video/fbdev/core/fbcon.h +3 more+78 -1510 replies
10/10fbcon: Put font-rotation state into separate structdrivers/video/fbdev/core/fbcon.c drivers/video/fbdev/core/fbcon.h drivers/video/fbdev/core/fbcon_ccw.c +3 more+41 -320 replies

Reviews trailers per patch

1 of 10 patches has a Reviewed-by or Acked-by.

PatchGreg Kroah-Hartman
1/10
2/10A-b
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/10] fbcon,fonts: Refactor framebuffer console rotation

Refactor the framebuffer console rotation into individual components for glyphs, fonts and the overall fbcon state. Right now this is mixed up in fbcon_rotate.{c,h}. Also build cursor rotation on top of the new interfaces.

Start with an OOB fix in patch 1. If buffer allocation fails, fbcon currently uses a too-small glyph buffer for output. Avoid that.

Patches 2 to 4 make a number of small improvements to the font library and its callers.

Patches 5 to 8 refactor the font rotation. Fbcon rotation rotates each individual glyph in a font buffer and uses the rotated buffer's glyphs for output. The result looks like the console buffer has been rotated as a whole. Split this into helpers that rotate individual glyphs and a helper that rotates the font buffer of these. Then reimplement fbcon rotation on top. Document the public font helpers.

Patch 9 rebuilds cursor rotation on top of the new glyph helpers. The fbcon cursor is itself a glyph that has to be rotated in sync with the font.

Patch 10 moves all state of fbcon rotation into a single place and makes it a build-time conditional.

Tested with fbcon under bochs on Qemu.

Built upon the fbcon changes at [1].

v2:
- fix sparse truncated-bits warning
- improve font sorting in Makefile
- fix typos

[1] https://lore.kernel.org/linux-fbdev/[email protected]/

Thomas Zimmermann (10):
fbcon: Avoid OOB font access if console rotation fails
vt: Implement helpers for struct vc_font in source file lib/fonts: Provide helpers for calculating glyph pitch and size lib/fonts: Clean up Makefile
lib/fonts: Implement glyph rotation
lib/fonts: Refactor glyph-pattern helpers
lib/fonts: Refactor glyph-rotation helpers
lib/fonts: Implement font rotation
fbcon: Fill cursor mask in helper function
fbcon: Put font-rotation state into separate struct

 drivers/tty/vt/vt.c                     |  34 +++
 drivers/video/fbdev/core/bitblit.c      |  35 +--
 drivers/video/fbdev/core/fbcon.c        |  48 ++++-
 drivers/video/fbdev/core/fbcon.h        |  14 +-
 drivers/video/fbdev/core/fbcon_ccw.c    |  70 ++----
 drivers/video/fbdev/core/fbcon_cw.c     |  70 ++----
 drivers/video/fbdev/core/fbcon_rotate.c |  88 ++------
 drivers/video/fbdev/core/fbcon_rotate.h |  71 ------
 drivers/video/fbdev/core/fbcon_ud.c     |  67 ++----
 include/linux/console_struct.h          |  30 +--
 include/linux/font.h                    |  51 +++++
 lib/fonts/Makefile                      |  36 ++--
 lib/fonts/font_rotate.c                 | 275 ++++++++++++++++++++++++
 lib/fonts/fonts.c                       |   2 +-
 14 files changed, 525 insertions(+), 366 deletions(-)
 create mode 100644 lib/fonts/font_rotate.c
Signature · 1 line
2.53.0