Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

fbdev: add events for early fb event support

Add FB_EARLY_EVENT_BLANK and FB_R_EARLY_EVENT_BLANK event mode supports.
first, fb_notifier_call_chain() is called with FB_EARLY_EVENT_BLANK and
fb_blank() of specific fb driver is called and then
fb_notifier_call_chain() is called with FB_EVENT_BLANK again at
fb_blank(). and if fb_blank() was failed then fb_nitifier_call_chain()
would be called with FB_R_EARLY_EVENT_BLANK to revert the previous
effects.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Inki Dae and committed by
Linus Torvalds
bf05929f aa523a82

+19 -6
+15 -6
drivers/video/fbmem.c
··· 1046 1046 int 1047 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 1052 if (blank > FB_BLANK_POWERDOWN) 1052 1053 blank = FB_BLANK_POWERDOWN; 1053 1054 1055 + event.info = info; 1056 + event.data = &blank; 1057 + 1058 + early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event); 1059 + 1054 1060 if (info->fbops->fb_blank) 1055 1061 ret = info->fbops->fb_blank(blank, info); 1056 1062 1057 - if (!ret) { 1058 - struct fb_event event; 1059 - 1060 - event.info = info; 1061 - event.data = &blank; 1063 + if (!ret) 1062 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 1074 return ret;
+4
include/linux/fb.h
··· 554 554 #define FB_EVENT_FB_UNBIND 0x0E 555 555 /* CONSOLE-SPECIFIC: remap all consoles to new fb - for vga switcheroo */ 556 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 562 struct fb_event { 559 563 struct fb_info *info;