Bug 4767 - RFE: console_blank_hook that can call userspace program
Summary: RFE: console_blank_hook that can call userspace program
Status: REJECTED WILL_NOT_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: Console/Framebuffers (show other bugs)
Hardware: i386 Linux
: P2 normal
Assignee: Antonino Daplas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-20 03:36 UTC by Eugene Pavlovsky
Modified: 2005-07-31 22:43 UTC (History)
0 users

See Also:
Kernel Version: 2.6.12
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
implemented this functionality in a kernel module (2.75 KB, application/octet-stream)
2005-06-29 06:46 UTC, Eugene Pavlovsky
Details

Description Eugene Pavlovsky 2005-06-20 03:36:33 UTC
I think it'd be very good to have a console_blank_hook handler that would call a
userspace program/script/generate hotplug event whatever. Currently, the console
can only be blanked using APM, so no options exist for people using ACPI. I've
got a Radeon graphics chip on my laptop, and the LCD backlight can be controlled
(on/off) using radeontool. If there was a userspace callback interface to
console blanking, I would just make a callback script that calls "radeontool
light off" on blank and "radeontool light on" on unblank - really easy. I think
this userspace console_blank_hook handler is very simple to put into kernel, but
I'm not a kernel developer myself, so wouldn't risk sending any patches (that
call system("some_script")), because I probably won't make things as they should
be in the kernel.
Comment 1 Eugene Pavlovsky 2005-06-29 06:46:27 UTC
Created attachment 5238 [details]
implemented this functionality in a kernel module

I've actually checked the kernel sources on how this can be done and
implemented the proposed functionality in a kernel module. The module attaches
a console blank hook function that uses kernel's call_usermodehelper() to
execute /sbin/user_vc_blank (defined at compile-time) to blank/unblank the
console. I've written a sample script (which I use on my laptop) that uses
radeontool to turn the LCD backlight off/on. Maybe this functionality should be
moved to the kernel. On the other hand, as it still needs userspace utilities,
maybe it's better off as a module. Anyway, please give it a thought, or at
least made this module available.
Comment 2 Antonino Daplas 2005-07-31 22:42:46 UTC
Present this to lkml and linux-fbdev-devel list, if you want this functionality.

Note You need to log in before you can comment on or make changes to this bug.