aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>2007-02-12 03:55:21 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-12 12:48:44 -0500
commitdcfe2666ffd6316b764801db82092bc62db56e6f (patch)
treefc70384ab89cc3afb864174977197fbf36299f11
parent9791d763de8cca82b42a7a579e031db78e8011ff (diff)
[PATCH] fb_videomode_to_var: reset virtual screen parameters
fb_videomode_to_var(): reset the virtual screen parameters when converting from an fb_videomode to an fb_var_screeninfo. Without this the old virtual screen parameters are kept. Hence you cannot switch to a video mode with a lower resolution on frame buffer devices that don't support virtual screens and panning, as values are not supposed to be rounded down when they don't fit. I also reordered the assignments to match the order of the individual members. Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Cc: James Simmons <jsimmons@infradead.org> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--drivers/video/modedb.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index 61fc6cd25fc1..5162eab95539 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -716,13 +716,17 @@ void fb_videomode_to_var(struct fb_var_screeninfo *var,
716{ 716{
717 var->xres = mode->xres; 717 var->xres = mode->xres;
718 var->yres = mode->yres; 718 var->yres = mode->yres;
719 var->xres_virtual = mode->xres;
720 var->yres_virtual = mode->yres;
721 var->xoffset = 0;
722 var->yoffset = 0;
719 var->pixclock = mode->pixclock; 723 var->pixclock = mode->pixclock;
720 var->left_margin = mode->left_margin; 724 var->left_margin = mode->left_margin;
721 var->hsync_len = mode->hsync_len;
722 var->vsync_len = mode->vsync_len;
723 var->right_margin = mode->right_margin; 725 var->right_margin = mode->right_margin;
724 var->upper_margin = mode->upper_margin; 726 var->upper_margin = mode->upper_margin;
725 var->lower_margin = mode->lower_margin; 727 var->lower_margin = mode->lower_margin;
728 var->hsync_len = mode->hsync_len;
729 var->vsync_len = mode->vsync_len;
726 var->sync = mode->sync; 730 var->sync = mode->sync;
727 var->vmode = mode->vmode & FB_VMODE_MASK; 731 var->vmode = mode->vmode & FB_VMODE_MASK;
728} 732}