summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/xorg-xserver/xserver-kdrive-1.3.0.0/fbdev_use_current.patch
blob: dc957cc8259d85c27975d76dfe23c4bde7fb1a70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
---
 hw/kdrive/fbdev/fbdev.c |   24 ++++++++++++++++--------
 1 file changed, 16 insertions(+), 8 deletions(-)

Index: xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.c
===================================================================
--- xorg-server-1.3.0.0.orig/hw/kdrive/fbdev/fbdev.c	2008-01-11 14:40:16.000000000 +0000
+++ xorg-server-1.3.0.0/hw/kdrive/fbdev/fbdev.c	2008-01-11 14:40:59.000000000 +0000
@@ -182,16 +182,24 @@ fbdevScreenInitialize (KdScreenInfo *scr
 	screen->rate = 103; /* FIXME: should get proper value from fb driver */
     }
     if (!screen->fb[0].depth)
-	screen->fb[0].depth = 16;
+    {
+	if (k >= 0) 
+	    screen->fb[0].depth = var.bits_per_pixel;
+	else
+	    screen->fb[0].depth = 16;
+    }
 
-    t = KdFindMode (screen, fbdevModeSupported);
-    screen->rate = t->rate;
-    screen->width = t->horizontal;
-    screen->height = t->vertical;
+    if ((screen->width != var.xres) || (screen->height != var.yres))
+    {
+      t = KdFindMode (screen, fbdevModeSupported);
+      screen->rate = t->rate;
+      screen->width = t->horizontal;
+      screen->height = t->vertical;
 
-    /* Now try setting the mode */
-    if (k < 0 || (t->horizontal != var.xres || t->vertical != var.yres))
-        fbdevConvertMonitorTiming (t, &var);
+      /* Now try setting the mode */
+      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;