xserver/hw/kdrive/fbdev fbdev.c,1.48,1.49

Phil Blundell <xserver-commit-u7BhqnqprCWvj1b/[email protected]>
Newsgroups gmane.comp.freedesktop.xserver.cvs
Message-ID <[email protected]>
Committed by: pb

Update of /cvs/xserver/xserver/hw/kdrive/fbdev
In directory gabe:/tmp/cvs-serv13372/hw/kdrive/fbdev

Modified Files:
	fbdev.c 
Log Message:
2004-09-14  Phil Blundell  <pb-Y0/[email protected]>

	* hw/kdrive/fbdev/fbdev.c (fbdevScreenInitialize): Only set 
screen
	parameters if resolution has changed from current values.  Patch
	from scoony-6oeLZ/[email protected]



Index: fbdev.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/fbdev/fbdev.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- fbdev.c	26 Jul 2004 17:14:26 -0000	1.48
+++ fbdev.c	14 Sep 2004 23:08:10 -0000	1.49
@@ -156,10 +156,13 @@
     struct fb_var_screeninfo var;
     const KdMonitorTiming *t;
     int k;
+
+    k = ioctl (priv->fd, FBIOGET_VSCREENINFO, &var);
     
     if (!screen->width || !screen->height)
     {
-	if (ioctl (priv->fd, FBIOGET_VSCREENINFO, &var) >= 0) {
+	if (k >= 0) 
+	{
 	    screen->width = var.xres;
 	    screen->height = var.yres;
 	}
@@ -179,7 +182,8 @@
     screen->height = t->vertical;
 
     /* Now try setting the mode */
-    fbdevConvertMonitorTiming (t, &var);
+    if (k < 0 || (t->horizontal != var.xres || t->vertical != var.yres))
+        fbdevConvertMonitorTiming (t, &var);
 
     var.activate = FB_ACTIVATE_NOW;
     var.bits_per_pixel = screen->fb[0].depth;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.