linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: "Michel Dänzer" <michel@tungstengraphics.com>
Cc: Linux Frame Buffer Device Development
	<linux-fbdev-devel@lists.sourceforge.net>,
	Ville Syrj?l? <syrjala@sci.fi>,
	Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH] Add fb_check_var() for fixed mode device.
Date: Sat, 30 Aug 2008 10:58:59 +0200	[thread overview]
Message-ID: <48B90BD3.4020702@gmx.de> (raw)
In-Reply-To: <1220019790.4421.297.camel@thor.sulgenrain.local>

[-- Attachment #1: Type: text/plain, Size: 2256 bytes --]

Michel Dänzer wrote:
> On Fri, 2008-08-29 at 16:14 +0200, Geert Uytterhoeven wrote:
>> On Fri, 29 Aug 2008, Michel Dnzer wrote:
>>> On Fri, 2008-08-29 at 14:16 +0200, Geert Uytterhoeven wrote:
>>>> | X.Org X Server 1.4.2
>>> [...]
>>>
>>>> | (EE) FBDEV(0): FBIOPUT_VSCREENINFO succeeded but modified mode
>>> [...]
>>>
>>>> Hence Xorg is broken on all embedded devices with a frame buffer driver
>>>> that supports a single fixed video mode only?
>>> No. As discussed before, you're probably missing
>>>
>>> http://cgit.freedesktop.org/xorg/xserver/commit/?id=c095da04fe7c73b6503ef5b93549b13796c51b22
>>>
>>> which is in the upcoming xserver 1.5 release.
>> Ah, upcoming. That's not current/previous/... ;-)
> 
> Yeah, it might have been nice to backport this to the 1.4 branch, but
> it's kind of too late now. Of course, you can always bug your
> distributor to backport it. :)

The attached patch is a completely different approach to solve the 
issue. I've tested it, and it works even with the buggy version of X 
(1.4.2).

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

The patch has a few benefits:
a) We still keep binary compatability/behavior 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 devices (I really like this!!!)

Thus, the patch basically changes the fixed mode drivers to have some 
monitor timings by default. As an example, before I got:
root@c3000:~# fbset -i
mode "1024x768"
     geometry 1024 768 1024 768 8
     timings 0 0 0 0 0 0 0
     rgba 8/0,8/0,8/0,0/0
endmode

Now I see:
root@c3000:~# fbset -i
mode "1024x768-60"
     # D: 65.003 MHz, H: 48.365 kHz, V: 60.006 Hz
     geometry 1024 768 1024 768 8
     timings 15384 168 8 29 3 144 6
     rgba 8/0,8/0,8/0,0/0
endmode

Opinions ?

Signed-off-by: Helge Deller <deller@gmx.de>



[-- Attachment #2: fb_check_var_fix.patch --]
[-- Type: text/x-patch, Size: 1005 bytes --]

diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index 98843c2..72b3113 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);
 
+		/* For drivers which does not support mode setting
+		 * initialize an emulated modeline */
+		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;

[-- Attachment #3: Type: text/plain, Size: 363 bytes --]

-------------------------------------------------------------------------
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=/

[-- Attachment #4: Type: text/plain, Size: 182 bytes --]

_______________________________________________
Linux-fbdev-devel mailing list
Linux-fbdev-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel

  reply	other threads:[~2008-08-30  8:59 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-27  5:09 [PATCH] Do set var even if no fb_check_var() provided Takashi Yoshii
2008-08-27  7:08 ` Geert Uytterhoeven
2008-08-27 21:49   ` Helge Deller
2008-08-28  6:53     ` Michel Dänzer
2008-08-28 21:43       ` Helge Deller
2008-08-28 22:08         ` Michel Dänzer
2008-08-28 22:16           ` Helge Deller
2008-08-28 22:18             ` Michel Dänzer
2008-08-28 22:23               ` Helge Deller
2008-08-28 22:30                 ` Michel Dänzer
2008-08-28 22:35                   ` Helge Deller
2008-08-28 22:47                     ` Michel Dänzer
2008-08-28  7:45     ` Ville Syrjälä
2008-08-28 21:45       ` Helge Deller
2008-08-29  5:15       ` [PATCH] Add fb_check_var() for fixed mode device Takashi Yoshii
2008-08-29  7:07         ` Michel Dänzer
2008-08-29  7:48           ` Takashi Yoshii
2008-08-29  7:10         ` Geert Uytterhoeven
2008-09-04  1:56           ` Takashi Yoshii
2008-08-29  8:49         ` Michel Dänzer
2008-08-29 12:16           ` Geert Uytterhoeven
2008-08-29 13:51             ` Michel Dänzer
2008-08-29 14:14               ` Geert Uytterhoeven
2008-08-29 14:23                 ` Michel Dänzer
2008-08-30  8:58                   ` Helge Deller [this message]
2008-09-02 19:11                     ` Helge Deller
2008-09-03 10:11                       ` Michel Dänzer
2008-09-03 19:24                         ` Helge Deller
2008-09-04  7:21                       ` Takashi Yoshii
2008-08-29 17:38             ` Ville Syrjälä
2008-08-29  2:06   ` [PATCH] Do set var even if no fb_check_var() provided Takashi Yoshii
2008-08-29  7:03     ` Geert Uytterhoeven
2008-09-04  7:38       ` Takashi Yoshii

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=48B90BD3.4020702@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).