summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhil Blundell <pb@reciva.com>2004-09-14 23:08:10 +0000
committerPhil Blundell <pb@reciva.com>2004-09-14 23:08:10 +0000
commit0d95bdfbabf4c526f6f54d6f1de8811f4e6d5d5f (patch)
treee55fe3ddc1a316037e64ca06f955ae9702afba5c
parentba3b6fd23be5f1f900fcff57bc586e08bc524e99 (diff)
Only set screen parameters if resolution has changed from current values.
Patch from scoony@noos.fr.
-rw-r--r--hw/kdrive/fbdev/fbdev.c8
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;