From: "Antonino A. Daplas" <adaplas@hotpop.com>
To: Andrew Morton <akpm@osdl.org>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Linux Fbdev development list <linux-fbdev-devel@lists.sourceforge.net>
Subject: [PATCH][FBCON]: Mode Switch in fbcon_blank()
Date: Wed, 30 Jun 2004 10:47:57 +0800 [thread overview]
Message-ID: <200406301047.57423.adaplas@hotpop.com> (raw)
Hi Ben,
As we've discussed in another thread, below is a diff that will do a
set_par() as late as possible when there is KD_TEXT<->KD_GRAPHICS
switch. The set_par() will be forced in fbcon_resize() instead.
Not sure if this has repercussions with the other drivers, but this patch
fixed the X nv driver hanging when switching to the console. (I believe
the crash is actually caused by an early set_par() -- while in
fbcon_blank. Removing the set_par in fbcon_blank fixed the hang but
caused cursor sprite and display corruption).
What do you think?
Tony
Signed-off-by: Antonino Daplas <adaplas@pol.net>
diff -Naur linux-2.6.7-mm4-orig/drivers/video/console/fbcon.c linux-2.6.7-mm4/drivers/video/console/fbcon.c
--- linux-2.6.7-mm4-orig/drivers/video/console/fbcon.c 2004-06-30 01:45:21.015306888 +0000
+++ linux-2.6.7-mm4/drivers/video/console/fbcon.c 2004-06-30 01:45:58.306637744 +0000
@@ -1679,7 +1679,8 @@
var.yres = height * fh;
x_diff = info->var.xres - var.xres;
y_diff = info->var.yres - var.yres;
- if (x_diff < 0 || x_diff > fw || (y_diff < 0 || y_diff > fh)) {
+ if (x_diff < 0 || x_diff > fw || (y_diff < 0 || y_diff > fh) ||
+ (info->flags & FBINFO_MISC_MODESWITCH)) {
char mode[40];
DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
@@ -1694,9 +1695,12 @@
return -EINVAL;
DPRINTK("resize now %ix%i\n", var.xres, var.yres);
if (CON_IS_VISIBLE(vc)) {
- var.activate = FB_ACTIVATE_NOW;
+ var.activate = FB_ACTIVATE_NOW |
+ (info->flags & FBINFO_MISC_MODESWITCH) ?
+ FB_ACTIVATE_FORCE : 0;
fb_set_var(info, &var);
}
+ info->flags &= ~FBINFO_MISC_MODESWITCH;
}
updatescrollmode(p, info, vc);
return 0;
@@ -1798,17 +1802,8 @@
struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
struct display *p = &fb_display[vc->vc_num];
- if (mode_switch) {
- struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
- struct fb_var_screeninfo var = info->var;
-
- if (blank) {
- fbcon_cursor(vc, CM_ERASE);
- return 0;
- }
- var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
- fb_set_var(info, &var);
- }
+ if (mode_switch)
+ info->flags |= FBINFO_MISC_MODESWITCH;
fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
diff -Naur linux-2.6.7-mm4-orig/include/linux/fb.h linux-2.6.7-mm4/include/linux/fb.h
--- linux-2.6.7-mm4-orig/include/linux/fb.h 2004-06-30 01:47:22.785794960 +0000
+++ linux-2.6.7-mm4/include/linux/fb.h 2004-06-30 01:46:24.799610200 +0000
@@ -532,6 +532,7 @@
#define FBINFO_MISC_MODECHANGEUSER 0x10000 /* mode change request
from userspace */
+#define FBINFO_MISC_MODESWITCH 0x20000 /* mode switch */
struct fb_info {
int node;
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
next reply other threads:[~2004-06-30 2:53 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-30 2:47 Antonino A. Daplas [this message]
2004-06-30 2:53 ` [PATCH][FBCON]: Mode Switch in fbcon_blank() Benjamin Herrenschmidt
2004-06-30 3:56 ` Telling libSDL that my fbdev can do acclerated fills Richard Smith
2004-06-30 4:38 ` Antonino A. Daplas
2004-06-30 4:45 ` Richard Smith
2004-06-30 6:14 ` Antonino A. Daplas
2004-07-02 10:25 ` [PATCH][FBCON]: Mode Switch in fbcon_blank() Javier Marcet
2004-07-02 15:37 ` Antonino A. Daplas
2004-07-03 0:43 ` Javier Marcet
2004-07-04 0:05 ` [PATCH] radeonfb: mode switch work around David Eger
2004-07-04 0:46 ` David Eger
2004-07-04 1:00 ` Antonino A. Daplas
2004-07-04 2:13 ` David Eger
2004-07-04 2:59 ` Jon Smirl
2004-07-04 8:35 ` Geert Uytterhoeven
2004-07-04 9:35 ` David Eger
2004-07-04 15:47 ` Re: [PATCH][FBCON]: Mode Switch in fbcon_blank() Antonino A. Daplas
2004-07-04 19:32 ` David Eger
2004-07-04 22:35 ` Antonino A. Daplas
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=200406301047.57423.adaplas@hotpop.com \
--to=adaplas@hotpop.com \
--cc=adaplas@pol.net \
--cc=akpm@osdl.org \
--cc=benh@kernel.crashing.org \
--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.