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>
This commit is contained in:
Ross Burton 2008-04-22 18:07:46 +01:00
parent c4fd112153
commit e77f65768e

View File

@ -179,8 +179,15 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
screen->rate = 103; /* FIXME: should get proper value from fb driver */
}
if (!screen->fb[0].depth)
{
if (k >= 0)
screen->fb[0].depth = var.bits_per_pixel;
else
screen->fb[0].depth = 16;
}
if ((screen->width != var.xres) || (screen->height != var.yres))
{
t = KdFindMode (screen, fbdevModeSupported);
screen->rate = t->rate;
screen->width = t->horizontal;
@ -189,6 +196,7 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv)
/* 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;