mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mikael Pettersson <mikpe@csd.uu.se>
To: alan@lxorguk.ukuu.org.uk
Cc: benh@kernel.crashing.org, linux-kernel@vger.kernel.org
Subject: [PATCH] 2.4.3-ac9 console unblank at resume fix
Date: Wed, 18 Apr 2001 15:39:25 +0200 (MET DST)	[thread overview]
Message-ID: <200104181339.PAA27353@harpo.it.uu.se> (raw)

Alan,

I think I've finally eliminated the X screen corruption my laptop
has been seeing at resume from suspend events.

The fix in -ac3 eliminated the corruption but left the console
blank if I exited X. The fix in -ac4 didn't actually work --
the corruptions resurfaced later. (Sorry about that.) I've tested
a lot of variations of it, but all had the same problem.

The new fix goes back to the original (exit early if not in text
mode), with one crucial change: console_blanked is NOT reset to zero.
This appears to have the desired effect: while X is running we
don't mess with the hardware, and the first unblank after X has
exited does the right thing. Works fine over here (so far..).
Patch below for -ac9, please apply.

[To recap: Dell Latitude, 2.4 kernel, XFree86-SVGA-3.3.6, APM,
no frame buffer device. After a few (1-3) days of use with
frequent suspend/resume cycles, the X screen would partially
wrap around after a resume. Restarting X would fix this temporarily,
but the next resume would see the same problem. Reboot, and I'd get
another few days before it happened again. 2.2 kernel was fine.]

/Mikael

--- linux-2.4.3-ac9/drivers/char/console.c.~1~	Wed Apr 18 13:50:00 2001
+++ linux-2.4.3-ac9/drivers/char/console.c	Wed Apr 18 13:50:24 2001
@@ -2713,23 +2713,21 @@
 		printk("unblank_screen: tty %d not allocated ??\n", fg_console+1);
 		return;
 	}
+	currcons = fg_console;
+	if (vcmode != KD_TEXT)
+		return; /* but leave console_blanked != 0 */
 	console_timer.function = blank_screen;
 	if (blankinterval) {
 		mod_timer(&console_timer, jiffies + blankinterval);
 	}
-	currcons = fg_console;
+
 	console_blanked = 0;
 	if (console_blank_hook)
 		console_blank_hook(0);
 	set_palette(currcons);
-	if (sw->con_blank(vc_cons[currcons].d, 0)) {
-		if (vcmode != KD_TEXT)
-			return;
+	if (sw->con_blank(vc_cons[currcons].d, 0))
 		/* Low-level driver cannot restore -> do it ourselves */
 		update_screen(fg_console);
-	}
-	if (vcmode != KD_TEXT)
-		return;
 	set_cursor(fg_console);
 }
 

                 reply	other threads:[~2001-04-18 13:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200104181339.PAA27353@harpo.it.uu.se \
    --to=mikpe@csd.uu.se \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®