linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fix fixed-mode framebuffer devices with X 1.4.2
@ 2008-09-03 19:32 Helge Deller
  0 siblings, 0 replies; only message in thread
From: Helge Deller @ 2008-09-03 19:32 UTC (permalink / raw)
  To: linux-fbdev-devel
  Cc: Ville Syrjälä, Geert Uytterhoeven, Michel Dänzer

This patch fixes the problem with Xorg 1.4.2 not starting when run
on framebuffer drivers which do not support mode-setting.
The corresponding Xorg bug is:
https://bugs.freedesktop.org/show_bug.cgi?id=17153 

The solution is, that we just simply fill in a "emulated" valid
monitor/modeline for fixed mode devices (aka drivers which don't
implement fb_check_var) into the "var" struct during the
register_framebuffer() initialization call. Since we fill in a
valid monitor/modeline, X will not have any problems with it.

The patch has a few benefits:
a) It keeps binary compatability/behaviour for FBIOGET_VSCREENINFO and
   FBIOPUT_VSCREENINFO.
b) In Xorg.conf files, users can simply delete all monitor and display
   sections -> Xorg will autoconfigure itself to the only valid resolution/
   modeline itself on all fixed mode devices.


Signed-off-by: Helge Deller <deller@gmx.de>
CC: Geert Uytterhoeven <geert@linux-m68k.org>
CC: Ville Syrjälä <syrjala@sci.fi>
CC: Michel Dänzer <michel@tungstengraphics.com>

diffstat:
 fbmem.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)


diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 98843c2..1e9a4ad 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -1470,9 +1470,23 @@ register_framebuffer(struct fb_info *fb_info)
 	if (!fb_info->pixmap.blit_y)
 		fb_info->pixmap.blit_y = ~(u32)0;
 
-	if (!fb_info->modelist.prev || !fb_info->modelist.next)
+	if (!fb_info->modelist.prev || !fb_info->modelist.next) {
 		INIT_LIST_HEAD(&fb_info->modelist);
 
+		/* Initialize an emulated modeline for drivers which
+		 * do not support mode setting. */
+		if (!fb_info->fbops->fb_check_var &&
+		     fb_info->var.pixclock == 0) {
+			char modestr[32];
+			snprintf(modestr, sizeof(modestr), "%dx%d-%d",
+				fb_info->var.xres,
+				fb_info->var.yres,
+				fb_info->var.bits_per_pixel);
+			fb_find_mode(&fb_info->var, fb_info, modestr,
+				NULL, 0, NULL, fb_info->var.bits_per_pixel);
+		}
+	}
+
 	fb_var_to_videomode(&mode, &fb_info->var);
 	fb_add_videomode(&mode, &fb_info->modelist);
 	registered_fb[i] = fb_info;

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2008-09-03 19:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-03 19:32 [PATCH] fix fixed-mode framebuffer devices with X 1.4.2 Helge Deller

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).