Thread (28 messages) 28 messages, 5 authors, 2004-11-06

Re: [PATCH] fbdev: workaround for broken X servers

From: Ville Syrjälä <syrjala@sci.fi>
Date: 2004-11-03 03:26:18

On Wed, Nov 03, 2004 at 01:13:39PM +1100, Benjamin Herrenschmidt wrote:
quoted hunk ↗ jump to hunk
Hi !

XFree (and X.org) has both always been broken in their conversion of the DPMS
blanking mode when passing to the kernel ioctl FBIOBLANK (in fbdev mode).

This patch makes sure that at least the value passed by userland stays in the
legal range, which has the side effect that an X DPMS POWERDOWN request will
result as an fbdev VESA_POWERDOWN request at the fbdev level now, instead of
an out-of-range value.

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>

Index: linux-work/drivers/video/fbmem.c
===================================================================
--- linux-work.orig/drivers/video/fbmem.c	2004-10-26 13:15:55.000000000 +1000
+++ linux-work/drivers/video/fbmem.c	2004-11-03 13:10:41.324932256 +1100
@@ -748,6 +748,10 @@
 	u16 *black = NULL;
 	int err = 0;
 	
+	/* Workaround for broken X servers */
+	if (blank > VESA_POWERDOWN)
+		blank = VESA_POWERDOWN;
+
 	if (info->fbops->fb_blank && !info->fbops->fb_blank(blank, info))
 		return 0;
 
This goes against documented behaviour (see fb.h). Also drivers/char/vt.c 
seems to agree with fb.h, as do at least atyfb and matroxfb. I also used 
the vesa level+1 convention in DirectFB. So AFAICS this patch would 
confuse console power management, XFree86/X.Org, DirectFB and some fb 
drivers.

-- 
Ville Syrjälä
syrjala@sci.fi
http://www.sci.fi/~syrjala/


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_idU88&alloc_id065&op=click
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help