tty: vt: stop using -1 for blank mode in consw::con_blank()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Mon, 22 Jan 2024 11:03:45 +0000 (12:03 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 02:08:54 +0000 (18:08 -0800)
-1 is the same as VESA_VSYNC_SUSPEND in all con_blank() implementations.
So we can remove this special case from vgacon now too.

Despite con_blank() of fbcon looks complicated, the "if
(!fbcon_is_inactive(vc, info))" branch is not taken as we set
"ops->graphics = 1;" few lines above. So what matters there (as in all
other blank implementations except vgacon) is if 'blank' is zero or not.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-32-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/vt/vt.c
drivers/video/console/vgacon.c

index fd868046f586fe8aad18d3da1056eacf14369f18..13be125a06aafdc612d8b9372ece4f14d8292a35 100644 (file)
@@ -4347,7 +4347,7 @@ void do_blank_screen(int entering_gfx)
        if (entering_gfx) {
                hide_cursor(vc);
                save_screen(vc);
-               vc->vc_sw->con_blank(vc, -1, 1);
+               vc->vc_sw->con_blank(vc, 1, 1);
                console_blanked = fg_console + 1;
                blank_state = blank_off;
                set_origin(vc);
index f89eb53c0b79e186a294ca3f7d2276f397a1d809..804b6a180b604c1937515b3220846585f87466f2 100644 (file)
@@ -814,7 +814,6 @@ static int vgacon_blank(struct vc_data *c, int blank, int mode_switch)
                /* Tell console.c that it has to restore the screen itself */
                return 1;
        case 1:         /* Normal blanking */
-       case -1:        /* Obsolete */
                if (!mode_switch && vga_video_type == VIDEO_TYPE_VGAC) {
                        vga_pal_blank(&vgastate);
                        vga_palette_blanked = true;