summaryrefslogtreecommitdiff
path: root/hw/kdrive
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2008-04-22 18:07:46 +0100
committerRoss Burton <ross@burtonini.com>2008-04-22 18:07:46 +0100
commite77f65768efbf05cdf363a2f41f036f74eaa45de (patch)
tree1ae2a78a290382bcf84724a8c228e5f71c8d439a /hw/kdrive
parentc4fd1121531b0cba1a3e90fa747871d784365c7e (diff)
Reuse the existing framebuffer mode in kdrive/fbdev
When starting up kdrive/fbdev, if the current framebuffer mode is sensible use that unless told otherwise. Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'hw/kdrive')
-rw-r--r--hw/kdrive/fbdev/fbdev.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c
index 177be0bdc..7721e608a 100644
--- a/hw/kdrive/fbdev/fbdev.c
+++ b/hw/kdrive/fbdev/fbdev.c
@@ -179,16 +179,24 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
screen->rate = 103; /* FIXME: should get proper value from fb driver */
}
if (!screen->fb[0].depth)
- screen->fb[0].depth = 16;
-
- t = KdFindMode (screen, fbdevModeSupported);
- screen->rate = t->rate;
- screen->width = t->horizontal;
- screen->height = t->vertical;
+ {
+ if (k >= 0)
+ screen->fb[0].depth = var.bits_per_pixel;
+ else
+ screen->fb[0].depth = 16;
+ }
- /* Now try setting the mode */
- if (k < 0 || (t->horizontal != var.xres || t->vertical != var.yres))
- fbdevConvertMonitorTiming (t, &var);
+ 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);
+ }
var.activate = FB_ACTIVATE_NOW;
var.bits_per_pixel = screen->fb[0].depth;