linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Turning off automatic screen clanking
@ 2003-07-29 13:02 Andries.Brouwer
  2003-07-29 13:53 ` Richard B. Johnson
  0 siblings, 1 reply; 46+ messages in thread
From: Andries.Brouwer @ 2003-07-29 13:02 UTC (permalink / raw)
  To: clepple, root; +Cc: linux-kernel

    Yes. This is f*ing absurb. A default that kills the screen and the
    requirement to send some @!_$%!@$ sequences to turn it off. This
    is absolute crap, absolutely positively, with no possible justification
    whatsoever. If I made an ioctl, it will probably be rejected.........

What language. What about the below (not compiled, not tested)?

diff -u --recursive --new-file -X /linux/dontdiff a/drivers/char/vt.c b/drivers/char/vt.c
--- a/drivers/char/vt.c	Mon Jun 23 04:43:32 2003
+++ b/drivers/char/vt.c	Tue Jul 29 15:36:58 2003
@@ -2294,6 +2294,12 @@
 		case TIOCL_BLANKEDSCREEN:
 			ret = console_blanked;
 			break;
+		case TIOCL_SETBLANKINTERVAL:
+			if (get_user(data, (char *)arg+1))
+				ret = -EFAULT;
+			else
+				blankinterval = ((unsigned)data)*60*HZ;
+			break;
 		default:
 			ret = -EINVAL;
 			break;
diff -u --recursive --new-file -X /linux/dontdiff a/include/linux/tiocl.h b/include/linux/tiocl.h
--- a/include/linux/tiocl.h	Sun Jun 15 01:41:07 2003
+++ b/include/linux/tiocl.h	Tue Jul 29 15:34:39 2003
@@ -34,5 +34,6 @@
 #define TIOCL_SCROLLCONSOLE	13	/* scroll console */
 #define TIOCL_BLANKSCREEN	14	/* keep screen blank even if a key is pressed */
 #define TIOCL_BLANKEDSCREEN	15	/* return which vt was blanked */
+#define TIOCL_SETBLANKINTERVAL	16	/* in minutes; 0: don't blank */
 
 #endif /* _LINUX_TIOCL_H */

^ permalink raw reply	[flat|nested] 46+ messages in thread
[parent not found: <eFZJ.6X7.29@gated-at.bofh.it>]
* Re: Turning off automatic screen clanking
@ 2003-07-31 20:08 Petr Vandrovec
  0 siblings, 0 replies; 46+ messages in thread
From: Petr Vandrovec @ 2003-07-31 20:08 UTC (permalink / raw)
  To: Timothy Miller; +Cc: Linux kernel

On 31 Jul 03 at 15:55, Timothy Miller wrote:
> So, if there's no point to having screen-blanking, why is it in there to 
> begin with?  To protect OLD monitors from burnin?

For example. My 8 years old EIZO F764M must not be powered down/powersaved
for more than few seconds, otherwise it takes about two days to get 
convergence back right (monitor "fixes" itself, it is just unusable until
it does so as there is about 0.5cm distance between red and green and
green and blue components...).
 
> Is screen-blanking there just to make people feel better who think they 
> need screen-blanking?  As I understand, it doesn't do any 
> power-management stuff anyhow.

setterm -powersave powerdown. I used it until monitor told me that it was
bad idea.
                                                    Petr Vandrovec
                                                    


^ permalink raw reply	[flat|nested] 46+ messages in thread
* Re: Turning off automatic screen clanking
@ 2003-07-30  6:14 Erik Andersen
  2003-07-30 13:07 ` Richard B. Johnson
  0 siblings, 1 reply; 46+ messages in thread
From: Erik Andersen @ 2003-07-30  6:14 UTC (permalink / raw)
  To: Richard B. Johnson; +Cc: linux-kernel


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--

^ permalink raw reply	[flat|nested] 46+ messages in thread
* Re: Turning off automatic screen clanking
@ 2003-07-29 13:56 Andries.Brouwer
  0 siblings, 0 replies; 46+ messages in thread
From: Andries.Brouwer @ 2003-07-29 13:56 UTC (permalink / raw)
  To: Andries.Brouwer, root; +Cc: clepple, linux-kernel

> I think you need to call poke_blanked_console() after setting

There is already an unblank subioctl of TIOCLINUX.

^ permalink raw reply	[flat|nested] 46+ messages in thread
* Turning off automatic screen clanking
@ 2003-07-28 20:00 Richard B. Johnson
  2003-07-28 20:01 ` Ben Collins
                   ` (3 more replies)
  0 siblings, 4 replies; 46+ messages in thread
From: Richard B. Johnson @ 2003-07-28 20:00 UTC (permalink / raw)
  To: Linux kernel


I have experimentally determined that I can turn off
the automatic screen blanking with the following escape
sequence.

const char blk[]={27, '[', '9', ';', '0', ']', 0};
main()
{
    printf(blk);
}

I need to know what the appropriate ioctl() is to do this
directly without using escape sequences. I have searched
the 2.4.20 sources and can't find any documentation for
anything that remotely even looks like it turns off the
automatic blanking. The code appears to be truly magic.

This is important for some imbeded systems because there
isn't any input available, and the screen output gets shut
off and can't be turned on except by re-booting.

Cheers,
Dick Johnson
Penguin : Linux version 2.4.20 on an i686 machine (797.90 BogoMips).
            Note 96.31% of all statistics are fiction.


^ permalink raw reply	[flat|nested] 46+ messages in thread

end of thread, other threads:[~2003-08-05 18:40 UTC | newest]

Thread overview: 46+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-29 13:02 Turning off automatic screen clanking Andries.Brouwer
2003-07-29 13:53 ` Richard B. Johnson
     [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-30  6:14 Erik Andersen
2003-07-30 13:07 ` Richard B. Johnson
2003-07-31 19:15   ` Norberto BENSA
2003-07-31 21:50     ` Zwane Mwaikambo
2003-07-29 13:56 Andries.Brouwer
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).