backlight/fbcon: Add FB_EVENT_CONBLANK
The backlight class wants notification whenever the console is blanked but doesn't get this when hardware blanking fails and software blanking is used. Changing FB_EVENT_BLANK to report both would be a behaviour change which could confuse the console layer so add a new event for software blanking and have the backlight class listen for both. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
This commit is contained in:
parent
34f18a71d9
commit
994efacdf9
3 changed files with 11 additions and 2 deletions
|
@ -28,7 +28,7 @@ static int fb_notifier_callback(struct notifier_block *self,
|
||||||
struct fb_event *evdata = data;
|
struct fb_event *evdata = data;
|
||||||
|
|
||||||
/* If we aren't interested in this event, skip it immediately ... */
|
/* If we aren't interested in this event, skip it immediately ... */
|
||||||
if (event != FB_EVENT_BLANK)
|
if (event != FB_EVENT_BLANK && event != FB_EVENT_CONBLANK)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
bd = container_of(self, struct backlight_device, fb_notif);
|
bd = container_of(self, struct backlight_device, fb_notif);
|
||||||
|
|
|
@ -2233,6 +2233,8 @@ static int fbcon_switch(struct vc_data *vc)
|
||||||
static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info,
|
static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info,
|
||||||
int blank)
|
int blank)
|
||||||
{
|
{
|
||||||
|
struct fb_event event;
|
||||||
|
|
||||||
if (blank) {
|
if (blank) {
|
||||||
unsigned short charmask = vc->vc_hi_font_mask ?
|
unsigned short charmask = vc->vc_hi_font_mask ?
|
||||||
0x1ff : 0xff;
|
0x1ff : 0xff;
|
||||||
|
@ -2243,6 +2245,11 @@ static void fbcon_generic_blank(struct vc_data *vc, struct fb_info *info,
|
||||||
fbcon_clear(vc, 0, 0, vc->vc_rows, vc->vc_cols);
|
fbcon_clear(vc, 0, 0, vc->vc_rows, vc->vc_cols);
|
||||||
vc->vc_video_erase_char = oldc;
|
vc->vc_video_erase_char = oldc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
event.info = info;
|
||||||
|
event.data = ␣
|
||||||
|
fb_notifier_call_chain(FB_EVENT_CONBLANK, &event);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
|
static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
|
||||||
|
|
|
@ -516,13 +516,15 @@ struct fb_cursor_user {
|
||||||
#define FB_EVENT_GET_CONSOLE_MAP 0x07
|
#define FB_EVENT_GET_CONSOLE_MAP 0x07
|
||||||
/* CONSOLE-SPECIFIC: set console to framebuffer mapping */
|
/* CONSOLE-SPECIFIC: set console to framebuffer mapping */
|
||||||
#define FB_EVENT_SET_CONSOLE_MAP 0x08
|
#define FB_EVENT_SET_CONSOLE_MAP 0x08
|
||||||
/* A display blank is requested */
|
/* A hardware display blank change occured */
|
||||||
#define FB_EVENT_BLANK 0x09
|
#define FB_EVENT_BLANK 0x09
|
||||||
/* Private modelist is to be replaced */
|
/* Private modelist is to be replaced */
|
||||||
#define FB_EVENT_NEW_MODELIST 0x0A
|
#define FB_EVENT_NEW_MODELIST 0x0A
|
||||||
/* The resolution of the passed in fb_info about to change and
|
/* The resolution of the passed in fb_info about to change and
|
||||||
all vc's should be changed */
|
all vc's should be changed */
|
||||||
#define FB_EVENT_MODE_CHANGE_ALL 0x0B
|
#define FB_EVENT_MODE_CHANGE_ALL 0x0B
|
||||||
|
/* A software display blank change occured */
|
||||||
|
#define FB_EVENT_CONBLANK 0x0C
|
||||||
|
|
||||||
struct fb_event {
|
struct fb_event {
|
||||||
struct fb_info *info;
|
struct fb_info *info;
|
||||||
|
|
Loading…
Reference in a new issue