From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Knut Petersen <Knut_Petersen@t-online.de>
Cc: linux-fbdev-devel@lists.sourceforge.net
Subject: Re: Detect switching to X?
Date: Mon, 28 Nov 2005 16:50:33 +0800 [thread overview]
Message-ID: <438AC4D9.9040603@gmail.com> (raw)
In-Reply-To: <438ABBF3.20104@t-online.de>
Knut Petersen wrote:
> Hi Tony,
>
> Today framebuffer drivers are limited by the fact that they need to
> leave the graphics
> engine in a state that current and older (but still used) X drivers can
> handle. That
> unreasonable limitation should be removed, and it can be removed by
> those optional
> fb_save_state() and fb_restore_state() hooks.
>
Try this patch.
fb_save_state() will be called when going from KD_GRAPHICS to KD_TEXT. The
driver has the opportunity here to save the current state of the hardware
before it's touched by fbdev.
fb_restore_state() will be called when going from KD_TEXT to KD_GRAPHICS
mode. The driver has the opportunity to set the hardware back to something
recognizable by the graphics application.
The state saving and restoration methods are up to driver author. It can
range from a simple hack, a single register save and restore to a full
blown total hardware state save and restore.
Tony
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
index 1a8f0ea..9678045 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -2181,11 +2181,14 @@ static int fbcon_blank(struct vc_data *v
ops->graphics = 1;
if (!blank) {
+ if (info->fbops->fb_save_state)
+ info->fbops->fb_save_state(info);
var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
fb_set_var(info, &var);
ops->graphics = 0;
ops->var = info->var;
- }
+ } else if (info->fbops->fb_restore_state)
+ info->fbops->fb_restore_state(info);
}
if (!fbcon_is_inactive(vc, info)) {
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 58e6c21..7d6d970 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -617,6 +617,12 @@ struct fb_ops {
/* perform fb specific mmap */
int (*fb_mmap)(struct fb_info *info, struct file *file, struct vm_area_struct *vma);
+
+ /* save current hardware state */
+ void (*fb_save_state)(struct fb_info *info);
+
+ /* restore saved state */
+ void (*fb_restore_state)(struct fb_info *info);
};
#ifdef CONFIG_FB_TILEBLITTING
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
next prev parent reply other threads:[~2005-11-28 8:51 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-27 6:12 Detect switching to X? Knut Petersen
2005-11-27 22:38 ` Antonino A. Daplas
2005-11-28 5:54 ` Knut Petersen
2005-11-28 7:31 ` Antonino A. Daplas
2005-11-28 8:12 ` Knut Petersen
2005-11-28 8:27 ` Antonino A. Daplas
2005-11-28 8:50 ` Antonino A. Daplas [this message]
2005-11-28 13:46 ` Knut Petersen
2005-11-28 14:25 ` Antonino A. Daplas
2005-11-28 15:12 ` Knut Petersen
2005-11-28 15:39 ` Antonino A. Daplas
2005-11-28 22:17 ` Knut Petersen
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=438AC4D9.9040603@gmail.com \
--to=adaplas@gmail.com \
--cc=Knut_Petersen@t-online.de \
--cc=linux-fbdev-devel@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.