public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Erik Andersen <andersen@codepoet.org>
To: "Richard B. Johnson" <root@chaos.analogic.com>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: Turning off automatic screen clanking
Date: Wed, 30 Jul 2003 00:14:55 -0600	[thread overview]
Message-ID: <20030730061454.GA19808@codepoet.org> (raw)


Here ya go...  This rips out the screen blanking code by the
roots since the kind and gentle approach didn't seem to be what
you were looking for.  :-)

--- linux/drivers/char/console.c.orig
+++ linux/drivers/char/console.c
@@ -144,7 +144,6 @@
 static int con_open(struct tty_struct *, struct file *);
 static void vc_init(unsigned int console, unsigned int rows,
 		    unsigned int cols, int do_clear);
-static void blank_screen(unsigned long dummy);
 static void gotoxy(int currcons, int new_x, int new_y);
 static void save_cur(int currcons);
 static void reset_terminal(int currcons, int do_clear);
@@ -152,7 +151,6 @@
 static void set_vesa_blanking(unsigned long arg);
 static void set_cursor(int currcons);
 static void hide_cursor(int currcons);
-static void unblank_screen_t(unsigned long dummy);
 static void console_callback(void *ignored);
 
 static int printable;		/* Is console ready for printing? */
@@ -205,8 +203,6 @@
  */
 int (*console_blank_hook)(int);
 
-static struct timer_list console_timer;
-
 /*
  *	Low-Level Functions
  */
@@ -2488,12 +2484,6 @@
 	if (tty_register_driver(&console_driver))
 		panic("Couldn't register console driver\n");
 
-	init_timer(&console_timer);
-	console_timer.function = blank_screen;
-	if (blankinterval) {
-		mod_timer(&console_timer, jiffies + blankinterval);
-	}
-
 	/*
 	 * kmalloc is not running yet - we use the bootmem allocator.
 	 */
@@ -2629,39 +2619,6 @@
 				    console_driver.minor_start + i);
 }
 
-/*
- * This is called by a timer handler
- */
-static void vesa_powerdown(void)
-{
-    struct vc_data *c = vc_cons[fg_console].d;
-    /*
-     *  Power down if currently suspended (1 or 2),
-     *  suspend if currently blanked (0),
-     *  else do nothing (i.e. already powered down (3)).
-     *  Called only if powerdown features are allowed.
-     */
-    switch (vesa_blank_mode) {
-	case VESA_NO_BLANKING:
-	    c->vc_sw->con_blank(c, VESA_VSYNC_SUSPEND+1);
-	    break;
-	case VESA_VSYNC_SUSPEND:
-	case VESA_HSYNC_SUSPEND:
-	    c->vc_sw->con_blank(c, VESA_POWERDOWN+1);
-	    break;
-    }
-}
-
-/*
- * This is a timer handler
- */
-static void vesa_powerdown_screen(unsigned long dummy)
-{
-	console_timer.function = unblank_screen_t;
-
-	vesa_powerdown();
-}
-
 static void timer_do_blank_screen(int entering_gfx, int from_timer_handler)
 {
 	int currcons = fg_console;
@@ -2687,17 +2644,6 @@
 	}
 
 	hide_cursor(currcons);
-	if (!from_timer_handler)
-		del_timer_sync(&console_timer);
-	if (vesa_off_interval) {
-		console_timer.function = vesa_powerdown_screen;
-		mod_timer(&console_timer, jiffies + vesa_off_interval);
-	} else {
-		if (!from_timer_handler)
-			del_timer_sync(&console_timer);
-		console_timer.function = unblank_screen_t;
-	}
-
 	save_screen(currcons);
 	/* In case we need to reset origin, blanking hook returns 1 */
 	i = sw->con_blank(vc_cons[currcons].d, 1);
@@ -2717,14 +2663,6 @@
 }
 
 /*
- * This is a timer handler
- */
-static void unblank_screen_t(unsigned long dummy)
-{
-	unblank_screen();
-}
-
-/*
  * Called by timer as well as from vt_console_driver
  */
 void unblank_screen(void)
@@ -2742,11 +2680,6 @@
 	if (vcmode != KD_TEXT)
 		return; /* but leave console_blanked != 0 */
 
-	console_timer.function = blank_screen;
-	if (blankinterval) {
-		mod_timer(&console_timer, jiffies + blankinterval);
-	}
-
 	console_blanked = 0;
 	if (console_blank_hook)
 		console_blank_hook(0);
@@ -2757,25 +2690,10 @@
 	set_cursor(fg_console);
 }
 
-/*
- * This is both a user-level callable and a timer handler
- */
-static void blank_screen(unsigned long dummy)
-{
-	timer_do_blank_screen(0, 1);
-}
-
 void poke_blanked_console(void)
 {
-	del_timer(&console_timer);
 	if (!vt_cons[fg_console] || vt_cons[fg_console]->vc_mode == KD_GRAPHICS)
 		return;
-	if (console_blanked) {
-		console_timer.function = unblank_screen_t;
-		mod_timer(&console_timer, jiffies);	/* Now */
-	} else if (blankinterval) {
-		mod_timer(&console_timer, jiffies + blankinterval);
-	}
 }
 
 /*
@@ -3001,7 +2919,7 @@
 		unblank_screen();
 		break;
 	case PM_SUSPEND:
-		do_blank_screen(0);
+		unblank_screen();
 		break;
 	}
 	return 0;

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

             reply	other threads:[~2003-07-30  6:14 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-30  6:14 Erik Andersen [this message]
2003-07-30 13:07 ` Turning off automatic screen clanking Richard B. Johnson
2003-07-31 19:15   ` Norberto BENSA
2003-07-31 21:50     ` Zwane Mwaikambo
     [not found] <eFZJ.6X7.29@gated-at.bofh.it>
     [not found] ` <eH5i.7XC.15@gated-at.bofh.it>
     [not found]   ` <eNaA.4vE.1@gated-at.bofh.it>
     [not found]     ` <eRHk.85K.5@gated-at.bofh.it>
     [not found]       ` <fmBF.48z.41@gated-at.bofh.it>
     [not found]         ` <fotH.5J2.17@gated-at.bofh.it>
     [not found]           ` <frB6.8gE.7@gated-at.bofh.it>
2003-08-03 10:40             ` Julien Oster
2003-08-04  0:56               ` Ian Hastie
2003-08-05 18:52               ` Timothy Miller
  -- strict thread matches above, loose matches on Subject: below --
2003-07-31 20:08 Petr Vandrovec
2003-07-29 13:56 Andries.Brouwer
2003-07-29 13:02 Andries.Brouwer
2003-07-29 13:53 ` Richard B. Johnson
2003-07-28 20:00 Richard B. Johnson
2003-07-28 20:01 ` Ben Collins
2003-07-28 20:08 ` Frank v Waveren
2003-07-28 20:25   ` Richard B. Johnson
2003-07-28 20:45     ` Charles Lepple
2003-07-29 11:06       ` Richard B. Johnson
2003-07-29 16:51         ` James Simmons
2003-07-29 17:01           ` Andries Brouwer
2003-07-29 17:54           ` Richard B. Johnson
2003-07-29 18:31             ` Alan Cox
2003-07-30  0:17             ` Zwane Mwaikambo
2003-07-30  1:25               ` Jamie Lokier
2003-07-30  1:37                 ` Zwane Mwaikambo
2003-07-30  7:14                   ` Alex Riesen
2003-07-30  8:00                     ` David Lang
2003-07-31 14:33                   ` Timothy Miller
2003-07-31 14:57                     ` Zwane Mwaikambo
2003-07-31 15:20                       ` Jamie Lokier
2003-07-31 21:41                         ` Zwane Mwaikambo
2003-08-01 15:25                           ` Jamie Lokier
2003-08-01 17:11                             ` Zwane Mwaikambo
2003-07-30  1:40                 ` Petr Vandrovec
2003-07-30  2:35                   ` Petr Vandrovec
2003-07-30  5:22               ` Ville Herva
2003-07-30  5:44                 ` Gene Heskett
2003-07-31 14:36                 ` Timothy Miller
2003-07-31 16:20                   ` Herbert Pötzl
2003-07-31 16:56                     ` Mike Dresser
2003-07-31 19:55                     ` Timothy Miller
2003-07-31 23:35                       ` Ian Hastie
2003-07-30  6:03               ` jw schultz
2003-07-30  2:16             ` Miles Bader
2003-07-30  5:45               ` jw schultz
2003-07-28 20:19 ` Samuel Thibault
2003-07-28 20:27 ` Andries Brouwer

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=20030730061454.GA19808@codepoet.org \
    --to=andersen@codepoet.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=root@chaos.analogic.com \
    /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