Commit f0c7d2b7 authored by Francisco Jerez's avatar Francisco Jerez Committed by Linus Torvalds
Browse files

vgacon: prevent vgacon_deinit from touching the hardware for inactive consoles.

fbcon makes the (reasonable) assumption that it only needs to program the
hardware once, when fbcon_init() is called for the foreground console.

This doesn't always play well with vgacon because vgacon_deinit() is only
doing its job when the last console it owns is closed (when switching from
vgacon to fbcon, that's usually *after* fbcon_init() has set the new

Depending on the hardware this can cause the wrong framebuffer location to
be scanned out (e.g.  reproduced on nv05 with the nouveau framebuffer
Signed-off-by: default avatarFrancisco Jerez <>
Cc: "H. Peter Anvin" <>
Cc: Alan Cox <>
Cc: Krzysztof Helt <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 2ddce3fd
......@@ -589,12 +589,14 @@ static void vgacon_init(struct vc_data *c, int init)
static void vgacon_deinit(struct vc_data *c)
/* When closing the last console, reset video origin */
if (!--vgacon_uni_pagedir[1]) {
/* When closing the active console, reset video origin */
if (CON_IS_VISIBLE(c)) {
c->vc_visible_origin = vga_vram_base;
if (!--vgacon_uni_pagedir[1])
c->vc_uni_pagedir_loc = &c->vc_uni_pagedir;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment