70 lines
2.2 KiB
Diff
70 lines
2.2 KiB
Diff
|
From: Ondrej Jirman <megous@megous.com>
|
||
|
Date: Sun, 17 Oct 2021 12:46:01 +0200
|
||
|
Subject: [PATCH 10/36] video: fbdev: Add events for early fb event support
|
||
|
|
||
|
This patch adds 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>
|
||
|
---
|
||
|
drivers/video/fbdev/core/fbmem.c | 12 +++++++++++-
|
||
|
include/linux/fb.h | 5 +++++
|
||
|
2 files changed, 16 insertions(+), 1 deletion(-)
|
||
|
|
||
|
diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
|
||
|
index 0fa7ede..71d9d4a 100644
|
||
|
--- a/drivers/video/fbdev/core/fbmem.c
|
||
|
+++ b/drivers/video/fbdev/core/fbmem.c
|
||
|
@@ -1067,7 +1067,7 @@ int
|
||
|
fb_blank(struct fb_info *info, int blank)
|
||
|
{
|
||
|
struct fb_event event;
|
||
|
- int ret = -EINVAL;
|
||
|
+ int ret = -EINVAL, early_ret;
|
||
|
|
||
|
if (blank > FB_BLANK_POWERDOWN)
|
||
|
blank = FB_BLANK_POWERDOWN;
|
||
|
@@ -1075,11 +1075,21 @@ fb_blank(struct fb_info *info, int blank)
|
||
|
event.info = info;
|
||
|
event.data = ␣
|
||
|
|
||
|
+ early_ret = fb_notifier_call_chain(FB_EARLY_EVENT_BLANK, &event);
|
||
|
+
|
||
|
if (info->fbops->fb_blank)
|
||
|
ret = info->fbops->fb_blank(blank, info);
|
||
|
|
||
|
if (!ret)
|
||
|
fb_notifier_call_chain(FB_EVENT_BLANK, &event);
|
||
|
+ else {
|
||
|
+ /*
|
||
|
+ * if fb_blank is failed then revert effects of
|
||
|
+ * the early blank event.
|
||
|
+ */
|
||
|
+ if (!early_ret)
|
||
|
+ fb_notifier_call_chain(FB_R_EARLY_EVENT_BLANK, &event);
|
||
|
+ }
|
||
|
|
||
|
return ret;
|
||
|
}
|
||
|
diff --git a/include/linux/fb.h b/include/linux/fb.h
|
||
|
index 3da9584..5ac24d0 100644
|
||
|
--- a/include/linux/fb.h
|
||
|
+++ b/include/linux/fb.h
|
||
|
@@ -137,6 +137,11 @@ struct fb_cursor_user {
|
||
|
/* A display blank is requested */
|
||
|
#define FB_EVENT_BLANK 0x09
|
||
|
|
||
|
+/* A hardware display blank early change occured */
|
||
|
+#define FB_EARLY_EVENT_BLANK 0x10
|
||
|
+/* A hardware display blank revert early change occured */
|
||
|
+#define FB_R_EARLY_EVENT_BLANK 0x11
|
||
|
+
|
||
|
struct fb_event {
|
||
|
struct fb_info *info;
|
||
|
void *data;
|