From: David Herrmann <dh.herrmann@googlemail.com>
To: linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, florianschandinat@gmx.de,
linux-fbdev@vger.kernel.org, gregkh@linuxfoundation.org,
alan@lxorguk.ukuu.org.uk, bonbons@linux-vserver.org,
David Herrmann <dh.herrmann@googlemail.com>
Subject: [PATCH v2 08/11] fblog: cache framebuffer BLANK and SUSPEND states
Date: Sun, 08 Jul 2012 21:56:51 +0000 [thread overview]
Message-ID: <1341784614-2797-9-git-send-email-dh.herrmann@googlemail.com> (raw)
In-Reply-To: <1341784614-2797-1-git-send-email-dh.herrmann@googlemail.com>
We must cache these states so we will never draw to the framebuffer while
it is suspended or blanked.
Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
---
drivers/video/console/fblog.c | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)
diff --git a/drivers/video/console/fblog.c b/drivers/video/console/fblog.c
index b490dba..fd1f3d6 100644
--- a/drivers/video/console/fblog.c
+++ b/drivers/video/console/fblog.c
@@ -31,6 +31,8 @@
enum fblog_flags {
FBLOG_KILLED,
FBLOG_OPEN,
+ FBLOG_SUSPENDED,
+ FBLOG_BLANKED,
};
struct fblog_fb {
@@ -255,6 +257,7 @@ static int fblog_event(struct notifier_block *self, unsigned long action,
struct fb_event *event = data;
struct fb_info *info = event->info;
struct fblog_fb *fb;
+ int *blank;
switch(action) {
case FB_EVENT_FB_REGISTERED:
@@ -280,6 +283,44 @@ static int fblog_event(struct notifier_block *self, unsigned long action,
if (fb)
fblog_close(fb, true, true);
break;
+ case FB_EVENT_SUSPEND:
+ /* This is called when the low-level display driver suspends the
+ * video system. We should not access the video system while it
+ * is suspended. This is called with the console lock held. */
+ mutex_lock(&fblog_registration_lock);
+ fb = fblog_fbs[info->node];
+ mutex_unlock(&fblog_registration_lock);
+
+ if (fb)
+ set_bit(FBLOG_SUSPENDED, &fb->flags);
+ break;
+ case FB_EVENT_RESUME:
+ /* This is called when the low-level display driver resumes
+ * operating. It is called with the console lock held. */
+ mutex_lock(&fblog_registration_lock);
+ fb = fblog_fbs[info->node];
+ mutex_unlock(&fblog_registration_lock);
+
+ if (fb)
+ clear_bit(FBLOG_SUSPENDED, &fb->flags);
+ break;
+ case FB_EVENT_BLANK:
+ /* This gets called _after_ the framebuffer was successfully
+ * blanked. The console-lock is always held while fb_blank is
+ * called and during this callback. */
+ mutex_lock(&fblog_registration_lock);
+ fb = fblog_fbs[info->node];
+ mutex_unlock(&fblog_registration_lock);
+
+ if (!fb)
+ break;
+
+ blank = (int*)event->data;
+ if (*blank = FB_BLANK_UNBLANK)
+ clear_bit(FBLOG_BLANKED, &fb->flags);
+ else
+ set_bit(FBLOG_BLANKED, &fb->flags);
+ break;
}
return 0;
--
1.7.11.1
next prev parent reply other threads:[~2012-07-08 21:56 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-08 21:56 [PATCH v2 00/11] fblog: framebuffer kernel log driver David Herrmann
2012-07-08 21:56 ` [PATCH v2 01/11] fbcon: move update_attr() into separate source file David Herrmann
2012-07-08 21:56 ` [PATCH v2 02/11] fbcon: move bit_putcs() " David Herrmann
2012-07-08 21:56 ` [PATCH v2 03/11] fblog: new framebuffer kernel log dummy driver David Herrmann
2012-07-08 21:56 ` [PATCH v2 04/11] fbdev: export get_fb_info()/put_fb_info() David Herrmann
2012-07-09 7:34 ` Geert Uytterhoeven
2012-07-09 17:34 ` David Herrmann
2012-07-08 21:56 ` [PATCH v2 05/11] fblog: register one fblog object per framebuffer David Herrmann
2012-07-08 22:13 ` Joe Perches
2012-07-09 17:55 ` David Herrmann
2012-07-08 21:56 ` [PATCH v2 06/11] fblog: open fb on registration David Herrmann
2012-07-08 21:56 ` [PATCH v2 07/11] fblog: allow selecting fbs via sysfs David Herrmann
2012-07-08 21:56 ` David Herrmann [this message]
2012-07-08 21:56 ` [PATCH v2 09/11] fblog: register console driver David Herrmann
2012-07-08 22:09 ` Joe Perches
2012-07-09 18:25 ` David Herrmann
2012-07-08 21:56 ` [PATCH v2 10/11] fblog: draw console to framebuffers David Herrmann
2012-07-08 21:56 ` [PATCH v2 11/11] MAINTAINERS: add fblog entry David Herrmann
2012-07-09 7:33 ` Geert Uytterhoeven
2012-07-09 18:38 ` David Herrmann
2012-07-17 12:57 ` Geert Uytterhoeven
2012-07-17 13:15 ` David Herrmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1341784614-2797-9-git-send-email-dh.herrmann@googlemail.com \
--to=dh.herrmann@googlemail.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=bonbons@linux-vserver.org \
--cc=florianschandinat@gmx.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).