How to automatically disable LCD in Linux

Source: Internet
Author: User
Host environment: GentooLinux11.2 kernel version: LinuxKernel3.2.1 under normal circumstances, Linux will disable the screen by default after a period of time, the default is 10 minutes. Here you may think it is a screen saver or power management function set by Gnome or KDE or other desktop environments, even if you are uneasy...

Host environment: Gentoo Linux 11.2
Kernel version: Linux Kernel 3.2.1
Under normal circumstances, Linux will disable the screen by default after a period of time. the default value is 10 minutes. Here, you may think it is a screen saver or power management function set in the Gnome or KDE desktop environment, even if the desktop environment screen is not installed, it will be automatically disabled.
Next we will analyze the cause.
According to the information on the Internet, this is set by the vt driver.
Enter the drivers folder under the kernel source code directory, and then execute
Grep blankinterval./*-R

Search for the variable in the file.

The search result is as follows:
./Tty/vt. c: static void blank_screen_t (unsigned long dummy );
./Tty/vt. c: static DEFINE_TIMER (lele_timer, blk_screen_t, 0, 0 );
./Tty/vt. c: static void blank_screen_t (unsigned long dummy)
Open the file and modify the location of approximately 180 rows.
Static int vesa_blank_mode;/* 0: none 1: suspendV 2: suspendH 3: powerdown */
Static int vesa_off_interval;
// Static int blankinterval = 10*60;
Static int blankinterval = 0;
Core_param (consoleblank, blankinterval, int, 0444 );
In this way, it is set to 0 by default during initialization, so that Chaoyang can set it through the user program.
 
Of course there are other solutions, which are summarized as follows:
1. modify the LCD driver and change the function for disabling the LCD controller to null (not recommended)
2. modify the blank_screen_t () function in vt. c to leave it empty (recommended when the system does not need to disable the display function)
3. modify the balancer interval in vt. c to 0 (the system may need to disable the display function, and it is recommended that the display function be disabled normally after the system is powered on)
4. modify the user program and add the code for setting the balancer interval (recommended)


From Yan Ming's blog

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.