[PATCH] vgacon: Update CRTC start address when turning scrollback off

From: Yu Peng

Date: Mon Nov 23 2026 - 21:49:52 EST


Commit 174657478cd8 ("vgacon: inline vc_scrolldelta_helper() into
vgacon_scrolldelta()") moved the early return for !lines into
vgacon_scrolldelta(), skipping vga_set_mem_top(c). This leaves the VGA
CRTC start address stuck at the old scrollback offset after
vgacon_restore_screen().

Call vga_set_mem_top(c) before returning when !lines.

Fixes: 174657478cd8 ("vgacon: inline vc_scrolldelta_helper() into vgacon_scrolldelta()")
Assisted-by: LLM
Signed-off-by: Yu Peng <pengyu@xxxxxxxxxx>
---
drivers/video/console/vgacon.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 09f7c376b4689..a6b0223ca596d 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -147,6 +147,7 @@ static void vgacon_scrolldelta(struct vc_data *c, int lines)
/* Turn scrollback off */
if (!lines) {
c->vc_visible_origin = c->vc_origin;
+ vga_set_mem_top(c);
return;
}

--
2.43.0