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, benh@kernel.crashing.org,
	linux-fbdev-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org
Subject: Re: console.c unblank_screen problem
Date: Wed, 4 Apr 2001 13:09:11 +0200 (MET DST)	[thread overview]
Message-ID: <200104041109.NAA28776@harpo.it.uu.se> (raw)

On Sun, 25 Mar 2001 18:40:03 +0200, Benjamin Herrenschmidt wrote:

>There is a problem with the power management code for console.c
>
>The current code calls do_blank_screen(0); on PM_SUSPEND, and
>unblank_screen() on PM_RESUME.
>
>The problem happens when X is the current display while putting the
>machine to sleep. The do_blank_screen(0) code will do nothing as
>the console is not in KD_TEXT mode.
>However, unblank_screen has no such protection. That means that
>on wakeup, the cursor timer & console blank timers will be re-enabled
>while X is frontmost, causing the blinking cursor to be displayed on
>top of X, and other possible issues.
>
>I hacked the following pacth to work around this. It appear to work
>fine, but since the console code is pretty complex, I'm not sure about
>possible side effects and I'd like some comments before submiting it
>to Linus:

Thanks for this patch. I've been using it on my Dell Latitude laptop
for the last 10 days, and it has been a significant improvement.

Before the patch: After a few days with a 2.4 kernel and RH7.0
(XFree86-4.0.1-1 and XFree86-SVGA-3.3.6-33) the latop would
misbehave at a resume event: when I opened the lid the screen would
unblank and then after less than a second the entire screen would
shift (wrap/rotate) left by about 40% of its width. Restarting X
would only fix this temporarily, as the next resume would have the
same problem. This does not occur with a 2.2 kernel or with the
Accelerated-X server I used before.

With the patch: No problem after 10 days with frequent suspend/resume
cycles. (2.4.2-ac24 + the patch)

[Alan, mind putting this in the next 2.4.3-ac? I've rediffed it
against 2.4.3-ac2.]

/Mikael


--- linux-2.4.3-ac2/drivers/char/console.c.~1~	Wed Apr  4 12:15:28 2001
+++ linux-2.4.3-ac2/drivers/char/console.c	Wed Apr  4 12:29:01 2001
@@ -2713,12 +2713,16 @@
 		printk("unblank_screen: tty %d not allocated ??\n", fg_console+1);
 		return;
 	}
+	currcons = fg_console;
+	if (vcmode != KD_TEXT) {
+		console_blanked = 0;
+		return;
+	}
 	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);

             reply	other threads:[~2001-04-04 11:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-04 11:09 Mikael Pettersson [this message]
2001-04-04 12:18 ` Benjamin Herrenschmidt
  -- strict thread matches above, loose matches on Subject: below --
2001-04-06 15:46 Mikael Pettersson
2001-03-25 16:40 Benjamin Herrenschmidt

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=200104041109.NAA28776@harpo.it.uu.se \
    --to=mikpe@csd.uu.se \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --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®