Skip to contentSkip to conversation

fix fixed-mode framebuffer devices with X 1.4.2

PATCH New Helge Deller 1 participant 1 message Sep 3, 2008 Framebuffer layer

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 fix fixed-mode framebuffer devices with X 1.4.2

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.

CC Geert Uytterhoeven <[email protected]>
CC Ville Syrjälä <[email protected]>
CC Michel Dänzer <[email protected]>

diffstat:

 fbmem.c |   16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/video/fbmem.c +15 -1
index 98843c2..1e9a4ad 100644
@@ -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 [email protected]
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel