linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: "Ville Syrjälä" <syrjala@sci.fi>,
	"Geert Uytterhoeven" <geert@linux-m68k.org>,
	"Michel Dänzer" <michel@tungstengraphics.com>
Subject: [PATCH] fix fixed-mode framebuffer devices with X 1.4.2
Date: Wed, 3 Sep 2008 21:32:01 +0200	[thread overview]
Message-ID: <200809032132.02276.deller@gmx.de> (raw)

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

                 reply	other threads:[~2008-09-03 19:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200809032132.02276.deller@gmx.de \
    --to=deller@gmx.de \
    --cc=geert@linux-m68k.org \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=michel@tungstengraphics.com \
    --cc=syrjala@sci.fi \
    /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 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).