From 0d95bdfbabf4c526f6f54d6f1de8811f4e6d5d5f Mon Sep 17 00:00:00 2001 From: Phil Blundell Date: Tue, 14 Sep 2004 23:08:10 +0000 Subject: [PATCH] Only set screen parameters if resolution has changed from current values. Patch from scoony@noos.fr. --- hw/kdrive/fbdev/fbdev.c | 8 ++++++-- 1 file 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;