* 2.6.7-bk16, mode-switch-in-fbcon_blank.patch breaks X on r128
@ 2004-07-04 16:03 Olaf Hering
2004-07-04 16:40 ` Jurriaan
0 siblings, 1 reply; 6+ messages in thread
From: Olaf Hering @ 2004-07-04 16:03 UTC (permalink / raw)
To: Antonino Daplas, linux-kernel; +Cc: linuxppc-dev
This patch, which went into 2.6.7-bk16, breaks X on my ibook with r128
chipset. X starts just fine, but the screen stays black. I can switch to
a textconsole and the console login appears.
I see no errors in dmesg or XFree86.0.log. Its version 4.3.0 from SuSE 8.2.
From: "Antonino A. Daplas" <adaplas@hotpop.com>
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).
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---
25-akpm/drivers/video/console/fbcon.c | 21 ++++++++-------------
25-akpm/include/linux/fb.h | 1 +
2 files changed, 9 insertions(+), 13 deletions(-)
diff -puN drivers/video/console/fbcon.c~mode-switch-in-fbcon_blank drivers/video/console/fbcon.c
--- 25/drivers/video/console/fbcon.c~mode-switch-in-fbcon_blank 2004-06-29 22:32:49.969619360 -0700
+++ 25-akpm/drivers/video/console/fbcon.c 2004-06-29 22:32:49.976618296 -0700
@@ -1663,7 +1663,8 @@ static int fbcon_resize(struct vc_data *
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);
@@ -1678,9 +1679,12 @@ static int fbcon_resize(struct vc_data *
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;
}
p->vrows = var.yres_virtual/fh;
if (var.yres > (fh * (height + 1)))
@@ -1788,17 +1792,8 @@ static int fbcon_blank(struct vc_data *v
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 -puN include/linux/fb.h~mode-switch-in-fbcon_blank include/linux/fb.h
--- 25/include/linux/fb.h~mode-switch-in-fbcon_blank 2004-06-29 22:32:49.970619208 -0700
+++ 25-akpm/include/linux/fb.h 2004-06-29 22:32:49.977618144 -0700
@@ -532,6 +532,7 @@ struct fb_ops {
#define FBINFO_MISC_MODECHANGEUSER 0x10000 /* mode change request
from userspace */
+#define FBINFO_MISC_MODESWITCH 0x20000 /* mode switch */
struct fb_info {
int node;
_
--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÜRNBERG
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 2.6.7-bk16, mode-switch-in-fbcon_blank.patch breaks X on r128
2004-07-04 16:03 2.6.7-bk16, mode-switch-in-fbcon_blank.patch breaks X on r128 Olaf Hering
@ 2004-07-04 16:40 ` Jurriaan
2004-07-04 17:10 ` Olaf Hering
2004-07-04 18:28 ` Olaf Hering
0 siblings, 2 replies; 6+ messages in thread
From: Jurriaan @ 2004-07-04 16:40 UTC (permalink / raw)
To: Olaf Hering; +Cc: Antonino Daplas, linux-kernel, linuxppc-dev
From: Olaf Hering <olh@suse.de>
Date: Sun, Jul 04, 2004 at 06:03:58PM +0200
>
> This patch, which went into 2.6.7-bk16, breaks X on my ibook with r128
> chipset. X starts just fine, but the screen stays black. I can switch to
> a textconsole and the console login appears.
>
> I see no errors in dmesg or XFree86.0.log. Its version 4.3.0 from SuSE 8.2.
>
I also had problems (switching back from X to console rewrote my refresh
rate from 85 to 60 Hz) and this patch was posted in the
linux-fbdev-devel mailinglist which solved my problems.
could you try it and let Antonino A Daplas (adaplas @ pol.net) know if
this worked for you?
diff -Naur linux-2.6.7-mm5-orig/drivers/video/console/fbcon.c linux-2.6.7-mm5/drivers/video/console/fbcon.c
--- linux-2.6.7-mm5-orig/drivers/video/console/fbcon.c 2004-07-04 23:34:29.873322872 +0800
+++ linux-2.6.7-mm5/drivers/video/console/fbcon.c 2004-07-04 23:36:18.169859296 +0800
@@ -1679,8 +1679,7 @@
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) ||
- (info->flags & FBINFO_MISC_MODESWITCH)) {
+ if (x_diff < 0 || x_diff > fw || (y_diff < 0 || y_diff > fh)) {
char mode[40];
DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
@@ -1695,12 +1694,9 @@
return -EINVAL;
DPRINTK("resize now %ix%i\n", var.xres, var.yres);
if (CON_IS_VISIBLE(vc)) {
- var.activate = FB_ACTIVATE_NOW |
- (info->flags & FBINFO_MISC_MODESWITCH) ?
- FB_ACTIVATE_FORCE : 0;
+ var.activate = FB_ACTIVATE_NOW;
fb_set_var(info, &var);
}
- info->flags &= ~FBINFO_MISC_MODESWITCH;
}
updatescrollmode(p, info, vc);
return 0;
@@ -1752,6 +1748,13 @@
}
fbcon_resize(vc, vc->vc_cols, vc->vc_rows);
+
+ if (info->flags & FBINFO_MISC_MODESWITCH &&
+ info->fbops->fb_set_par) {
+ info->fbops->fb_set_par(info);
+ }
+ info->flags &= ~FBINFO_MISC_MODESWITCH;
+
switch (p->scrollmode) {
case SCROLL_WRAP:
scrollback_phys_max = p->vrows - vc->vc_rows;
Good luck,
Jurriaan
--
If you ever need anything please don't hesitate to ask someone else
first.
Nirvana
Debian (Unstable) GNU/Linux 2.6.7-mm5 2x6078 bogomips load 1.17
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 2.6.7-bk16, mode-switch-in-fbcon_blank.patch breaks X on r128
2004-07-04 16:40 ` Jurriaan
@ 2004-07-04 17:10 ` Olaf Hering
2004-07-04 22:38 ` Antonino A. Daplas
2004-07-04 18:28 ` Olaf Hering
1 sibling, 1 reply; 6+ messages in thread
From: Olaf Hering @ 2004-07-04 17:10 UTC (permalink / raw)
To: Jurriaan; +Cc: Antonino Daplas, linux-kernel, linuxppc-dev
On Sun, Jul 04, Jurriaan wrote:
> From: Olaf Hering <olh@suse.de>
> Date: Sun, Jul 04, 2004 at 06:03:58PM +0200
> >
> > This patch, which went into 2.6.7-bk16, breaks X on my ibook with r128
> > chipset. X starts just fine, but the screen stays black. I can switch to
> > a textconsole and the console login appears.
> >
> > I see no errors in dmesg or XFree86.0.log. Its version 4.3.0 from SuSE 8.2.
> >
>
> I also had problems (switching back from X to console rewrote my refresh
> rate from 85 to 60 Hz) and this patch was posted in the
> linux-fbdev-devel mailinglist which solved my problems.
>
> could you try it and let Antonino A Daplas (adaplas @ pol.net) know if
> this worked for you?
No, this will not work, fbcon_resize() is called before fbcon_blank(). I
think the removed code in fbcon_blank() is needed.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 2.6.7-bk16, mode-switch-in-fbcon_blank.patch breaks X on r128
2004-07-04 16:40 ` Jurriaan
2004-07-04 17:10 ` Olaf Hering
@ 2004-07-04 18:28 ` Olaf Hering
1 sibling, 0 replies; 6+ messages in thread
From: Olaf Hering @ 2004-07-04 18:28 UTC (permalink / raw)
To: Jurriaan; +Cc: Antonino Daplas, linux-kernel, linuxppc-dev
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 777 bytes --]
On Sun, Jul 04, Jurriaan wrote:
> From: Olaf Hering <olh@suse.de>
> Date: Sun, Jul 04, 2004 at 06:03:58PM +0200
> >
> > This patch, which went into 2.6.7-bk16, breaks X on my ibook with r128
> > chipset. X starts just fine, but the screen stays black. I can switch to
> > a textconsole and the console login appears.
> >
> > I see no errors in dmesg or XFree86.0.log. Its version 4.3.0 from SuSE 8.2.
> >
>
> I also had problems (switching back from X to console rewrote my refresh
> rate from 85 to 60 Hz) and this patch was posted in the
> linux-fbdev-devel mailinglist which solved my problems.
I think you can debug it better with 'Option "usefbdev" "on"' in our
XF86config. It breaks also atyfb.
--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÜRNBERG
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 2.6.7-bk16, mode-switch-in-fbcon_blank.patch breaks X on r128
2004-07-04 17:10 ` Olaf Hering
@ 2004-07-04 22:38 ` Antonino A. Daplas
2004-07-05 10:02 ` Olaf Hering
0 siblings, 1 reply; 6+ messages in thread
From: Antonino A. Daplas @ 2004-07-04 22:38 UTC (permalink / raw)
To: Olaf Hering, Jurriaan; +Cc: Antonino Daplas, linux-kernel, linuxppc-dev
Hi Olaf, Jurriaan
On Monday 05 July 2004 01:10, Olaf Hering wrote:
> On Sun, Jul 04, Jurriaan wrote:
> > From: Olaf Hering <olh@suse.de>
> > Date: Sun, Jul 04, 2004 at 06:03:58PM +0200
> >
> > > This patch, which went into 2.6.7-bk16, breaks X on my ibook with r128
> > > chipset. X starts just fine, but the screen stays black. I can switch
> > > to a textconsole and the console login appears.
> > >
> > > I see no errors in dmesg or XFree86.0.log. Its version 4.3.0 from SuSE
> > > 8.2.
> >
> > I also had problems (switching back from X to console rewrote my refresh
> > rate from 85 to 60 Hz) and this patch was posted in the
> > linux-fbdev-devel mailinglist which solved my problems.
> >
> > could you try it and let Antonino A Daplas (adaplas @ pol.net) know if
> > this worked for you?
>
> No, this will not work, fbcon_resize() is called before fbcon_blank(). I
> think the removed code in fbcon_blank() is needed.
Yes, thanks. It does seem that some Radeon cards need the set_var() code in
fbcon_blank, such as Olaf's, while others do okay with the set_var() code
in fbcon_switch()->fbcon_resize(), such as Jurriann's. As to why, I'm not sure.
Can you try this patch? It's ugly, but I have no reports of failure yet. It's just
the old code (pre-mm5/pre-bk16) -- do a set_var() code in fbcon_blank() --
combined with the new code (mm5 and bk16), as an option to do the set_var()
in fbcon_switch() -- needed by other cards such as rivafb.
Tony
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Ugly workaround. When switching from KD_GRAPHICS to KD_TEXT, the
event is captured at fbcon_blank() allowing fbcon to reinitialize the hardware.
However, some hardware requires the reinitialization to be done immediately,
others require it to be done later. Others may need it to be done immediately
and later, this is the worst case.
diff -Naur linux-2.6.7-mm5-orig/drivers/video/console/fbcon.c linux-2.6.7-mm5/drivers/video/console/fbcon.c
--- linux-2.6.7-mm5-orig/drivers/video/console/fbcon.c 2004-07-02 15:09:02.132667752 +0000
+++ linux-2.6.7-mm5/drivers/video/console/fbcon.c 2004-07-02 15:12:29.935076984 +0000
@@ -1802,8 +1802,31 @@
struct fb_info *info = registered_fb[(int) con2fb_map[vc->vc_num]];
struct display *p = &fb_display[vc->vc_num];
- if (mode_switch)
- info->flags |= FBINFO_MISC_MODESWITCH;
+ if (mode_switch) {
+ struct fb_var_screeninfo var = info->var;
+
+/*
+ * HACK ALERT: Some hardware will require reinitializion at this stage,
+ * others will require it to be done as late as possible.
+ * For now, we differentiate this with the
+ * FBINFO_MISC_MODESWITCHLATE bitflag. Worst case will be
+ * hardware that requires it here and another one later.
+ * A definitive solution may require fixing X or the VT
+ * system.
+ */
+ if (info->flags & FBINFO_MISC_MODESWITCHLATE)
+ info->flags |= FBINFO_MISC_MODESWITCH;
+
+ if (blank) {
+ fbcon_cursor(vc, CM_ERASE);
+ return 0;
+ }
+
+ if (!(info->flags & FBINFO_MISC_MODESWITCHLATE)) {
+ var.activate = FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
+ fb_set_var(info, &var);
+ }
+ }
fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
diff -Naur linux-2.6.7-mm5-orig/drivers/video/riva/fbdev.c linux-2.6.7-mm5/drivers/video/riva/fbdev.c
--- linux-2.6.7-mm5-orig/drivers/video/riva/fbdev.c 2004-07-02 15:08:39.130164664 +0000
+++ linux-2.6.7-mm5/drivers/video/riva/fbdev.c 2004-07-02 15:12:27.322474160 +0000
@@ -1681,7 +1681,8 @@
| FBINFO_HWACCEL_YPAN
| FBINFO_HWACCEL_COPYAREA
| FBINFO_HWACCEL_FILLRECT
- | FBINFO_HWACCEL_IMAGEBLIT;
+ | FBINFO_HWACCEL_IMAGEBLIT
+ | FBINFO_MISC_MODESWITCHLATE;
info->var = rivafb_default_var;
info->fix.visual = (info->var.bits_per_pixel == 8) ?
FB_VISUAL_PSEUDOCOLOR : FB_VISUAL_DIRECTCOLOR;
diff -Naur linux-2.6.7-mm5-orig/include/linux/fb.h linux-2.6.7-mm5/include/linux/fb.h
--- linux-2.6.7-mm5-orig/include/linux/fb.h 2004-07-02 15:09:17.062398088 +0000
+++ linux-2.6.7-mm5/include/linux/fb.h 2004-07-02 15:12:31.318866616 +0000
@@ -533,6 +533,7 @@
#define FBINFO_MISC_MODECHANGEUSER 0x10000 /* mode change request
from userspace */
#define FBINFO_MISC_MODESWITCH 0x20000 /* mode switch */
+#define FBINFO_MISC_MODESWITCHLATE 0x40000 /* init hardware later */
struct fb_info {
int node;
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: 2.6.7-bk16, mode-switch-in-fbcon_blank.patch breaks X on r128
2004-07-04 22:38 ` Antonino A. Daplas
@ 2004-07-05 10:02 ` Olaf Hering
0 siblings, 0 replies; 6+ messages in thread
From: Olaf Hering @ 2004-07-05 10:02 UTC (permalink / raw)
To: adaplas; +Cc: Jurriaan, linux-kernel, linuxppc-dev
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 594 bytes --]
On Mon, Jul 05, Antonino A. Daplas wrote:
> Signed-off-by: Antonino Daplas <adaplas@pol.net>
>
> Ugly workaround. ??When switching from KD_GRAPHICS to KD_TEXT, the
> event is captured at fbcon_blank() allowing fbcon to reinitialize the hardware.
> However, some hardware requires the reinitialization to be done immediately,
> others require it to be done later. ??Others may need it to be done immediately
> and later, this is the worst case.
This patch fixes it, tested on a ibook g4 with radeon card and
2.6.7-bk17
--
USB is for mice, FireWire is for men!
sUse lINUX ag, nÜRNBERG
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-07-05 10:02 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-04 16:03 2.6.7-bk16, mode-switch-in-fbcon_blank.patch breaks X on r128 Olaf Hering
2004-07-04 16:40 ` Jurriaan
2004-07-04 17:10 ` Olaf Hering
2004-07-04 22:38 ` Antonino A. Daplas
2004-07-05 10:02 ` Olaf Hering
2004-07-04 18:28 ` Olaf Hering
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox