diff options
-rw-r--r-- | drivers/video/fbmem.c | 21 | ||||
-rw-r--r-- | include/linux/fb.h | 4 |
2 files changed, 19 insertions, 6 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c index c6ce416ab58..0dff12a1dae 100644 --- a/drivers/video/fbmem.c +++ b/drivers/video/fbmem.c | |||
@@ -1046,20 +1046,29 @@ fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) | |||
1046 | int | 1046 | int |
1047 | fb_blank(struct fb_info *info, int blank) | 1047 | fb_blank(struct fb_info *info, int blank) |
1048 | { | 1048 | { |
1049 | int ret = -EINVAL; | 1049 | struct fb_event event; |
1050 | int ret = -EINVAL, early_ret; | ||
1050 | 1051 | ||
1051 | if (blank > FB_BLANK_POWERDOWN) | 1052 | if (blank > FB_BLANK_POWERDOWN) |
1052 | blank = FB_BLANK_POWERDOWN; | 1053 | blank = FB_BLANK_POWERDOWN; |
1053 | 1054 | ||
1055 | event.info = info; | ||
1056 | event.data = ␣ | ||
1057 | |||
1058 | early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event); | ||
1059 | |||
1054 | if (info->fbops->fb_blank) | 1060 | if (info->fbops->fb_blank) |
1055 | ret = info->fbops->fb_blank(blank, info); | 1061 | ret = info->fbops->fb_blank(blank, info); |
1056 | 1062 | ||
1057 | if (!ret) { | 1063 | if (!ret) |
1058 | struct fb_event event; | ||
1059 | |||
1060 | event.info = info; | ||
1061 | event.data = ␣ | ||
1062 | fb_notifier_call_chain(FB_EVENT_BLANK, &event); | 1064 | fb_notifier_call_chain(FB_EVENT_BLANK, &event); |
1065 | else { | ||
1066 | /* | ||
1067 | * if fb_blank is failed then revert effects of | ||
1068 | * the early blank event. | ||
1069 | */ | ||
1070 | if (!early_ret) | ||
1071 | fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event); | ||
1063 | } | 1072 | } |
1064 | 1073 | ||
1065 | return ret; | 1074 | return ret; |
diff --git a/include/linux/fb.h b/include/linux/fb.h index d31cb682e17..a3229d7ab9f 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -554,6 +554,10 @@ struct fb_cursor_user { | |||
554 | #define FB_EVENT_FB_UNBIND 0x0E | 554 | #define FB_EVENT_FB_UNBIND 0x0E |
555 | /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga switcheroo */ | 555 | /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga switcheroo */ |
556 | #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F | 556 | #define FB_EVENT_REMAP_ALL_CONSOLE 0x0F |
557 | /* A hardware display blank early change occured */ | ||
558 | #define FB_EARLY_EVENT_BLANK 0x10 | ||
559 | /* A hardware display blank revert early change occured */ | ||
560 | #define FB_R_EARLY_EVENT_BLANK 0x11 | ||
557 | 561 | ||
558 | struct fb_event { | 562 | struct fb_event { |
559 | struct fb_info *info; | 563 | struct fb_info *info; |