Re: [PATCH 1/2] vt: Use boolean as parameter to do_blank_screen() and do_unblank_screen()

From: Thomas Zimmermann

Date: Mon Oct 12 2026 - 08:42:09 EST


Hi

Am 12.10.26 um 13:30 schrieb Greg KH:
On Mon, Oct 12, 2026 at 11:27:38AM +0200, Thomas Zimmermann wrote:
The parameters to do_blank_screen() and do_unblank_screen() signal
whether the call is part of a switch between text and graphics mode.
Convert to boolean. No functional changes.

Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
---
drivers/tty/vt/vt.c | 20 ++++++++++----------
drivers/tty/vt/vt_ioctl.c | 12 ++++++------
drivers/video/fbdev/core/fbcon.c | 4 ++--
include/linux/vt_kern.h | 5 +++--
4 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index 57edf37495a8..9e7b4419b422 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -3374,7 +3374,7 @@ static void console_callback(struct work_struct *ignored)
scrollback_delta = 0;
}
if (blank_timer_expired) {
- do_blank_screen(0);
+ do_blank_screen(false);
Same type of comment here, this bool doesn't really tell what is
happening at all (not your fault, 0/1 doesn't either.)

I'm all for this patch but shouldn't this be fixed up to be 2 different
named functions entirely?

Can you elaborate?  Do you mean there should be a separate helper and callback for switching between KD_TEXT and KD_GRAPHICS?

Looking through the *_blank_screen() helpers and the console implementations, I think we'd mostly duplicate code. Mode-switching and blanking are tightly coupled.  Semantics get a bit cleaner with the change you proposed to patch 1, I think.

Or, we'd have to untangle all of it. The result would likely look something like this:

vt_set_mode(kd_mode)
{
    if (kd_mode == GRAPHICS)
        do_blank_screen() /* blank before going to graphics */

    consw->con_setmode(kd_mode)

    if (kd_mode != GRAPHICS)
        do_unblank_screen() /* unblank after coming back from graphics */
}

Best regards
Thomas



thanks,

greg k-h

--
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com
GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)