Skip to content

vt: Simplify console-blanking interface

Thomas Zimmermann linux-fbdev linux-parisc linux-serial lkml sashiko-reviews 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 3 repliesIn review
  2. v27 patches 1 replySuperseded
  3. v12 patches 6 repliesSuperseded

Changes in v3 from the cover letter

- avoid possible regressions by adding back mode_switch v2:
- rewrite series with con_unblank (GregKH)
- drop mode_switch from console implementations

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7vt: Add con_unblank callback to struct conswdrivers/tty/vt/vt.c include/linux/console.h+30 -100 replies
2/7dummycon: Implement struct consw.con_unblankdrivers/video/console/dummycon.c+12 -00 replies
3/7fbcon: Implement struct consw.con_unblankdrivers/video/fbdev/core/fbcon.c+38 -170 replies
4/7newport_con: Implement struct consw.con_unblankdrivers/video/console/newport_con.c+13 -110 replies
5/7sticon: Implement struct consw.con_unblankdrivers/video/console/sticon.c+12 -80 replies
6/7vgacon: Implement struct consw.con_unblankdrivers/video/console/vgacon.c+26 -200 replies
7/7vt: Remove old-style con_blankdrivers/tty/vt/vt.c+8 -233 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/7] vt: Simplify console-blanking interface

Update con_blank from struct consw to use enum vesa_blank_mode according to its intended semantics. Handle unblanking in the separate new callback con_unblank. Update all consoles.

Some background: the vt subsystem calls con_blank with what at first appears to be nonsensical arguments: the blank value and the type of the blank parameter do not match. con_blank mixes up console blank state and monitor DPMS levels for power saving in the same argument. The implementation of con_blank in various consoles suffers from a similar
problem: their interpretation of the given blank value often disagrees with what the value's type suggests.

Patch 1 adds a new helper con_unblank, which handles all unblanking. This allows for changing con_blank to only handle blanking. There's support for both semantics while consoles are being converted.

Patches 2 to 6 implement con_unblank for the individual consoles. With this, con_blank changes to its new semantics. Each console gets a single callback for blanking and a single callback for unblanking.

With all consoles updated, patch 7 removes the old semantics and the mode_switch parameter.

Tested with vgacon on a SiS 6202 VGA and with fbcon on a Matrox G200 VGA device. The latter also ran fbcon via DRM fbdev emulation. It's easy to test this with setterm, like this:

  setterm --blank force          # blank
  setterm --blank poke           # unblank
  setterm --powersave powerdown  # set VESA DPMS level 3
  setterm --blank force          # blank and turn off monitor
  setterm --blank poke           # unblank

Blanking and unblanking still works in all tested cases.

Newport and sticon are built-only, due to a lack of test equipment.

Future directions: console blanking helper currently handle switching a console between text and graphics mode. The mode_switch parameter indicates this to the console. As suggested in earlier reviews, a later series might rework the mode switching entirely.

v3:
- avoid possible regressions by adding back mode_switch v2:
- rewrite series with con_unblank (GregKH)
- drop mode_switch from console implementations

Thomas Zimmermann (7):
vt: Add con_unblank callback to struct consw
dummycon: Implement struct consw.con_unblank
fbcon: Implement struct consw.con_unblank
newport_con: Implement struct consw.con_unblank
sticon: Implement struct consw.con_unblank
vgacon: Implement struct consw.con_unblank
vt: Remove old-style con_blank

 drivers/tty/vt/vt.c                 | 11 +++---
 drivers/video/console/dummycon.c    | 12 +++++++
 drivers/video/console/newport_con.c | 24 +++++++------
 drivers/video/console/sticon.c      | 20 ++++++-----
 drivers/video/console/vgacon.c      | 46 +++++++++++++-----------
 drivers/video/fbdev/core/fbcon.c    | 55 ++++++++++++++++++++---------
 include/linux/console.h             | 10 ++++--
 7 files changed, 114 insertions(+), 64 deletions(-)

base-commit: 5b9ee97c47574138633a1cb70a32d118b6860a43

Signature · 1 line
2.56.0