diff options
-rw-r--r-- | hw/kdrive/fbdev/fbdev.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hw/kdrive/fbdev/fbdev.c b/hw/kdrive/fbdev/fbdev.c index aaf121f15..bae235bc9 100644 --- a/hw/kdrive/fbdev/fbdev.c +++ b/hw/kdrive/fbdev/fbdev.c @@ -156,10 +156,13 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv) 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 @@ fbdevScreenInitialize (KdScreenInfo *screen, FbdevScrPriv *scrpriv) 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; |