瀏覽代碼

[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>
Geert Uytterhoeven 18 年之前
父節點
當前提交
dcfe2666ff
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      drivers/video/modedb.c

+ 6 - 2
drivers/video/modedb.c

@@ -716,13 +716,17 @@ void fb_videomode_to_var(struct fb_var_screeninfo *var,
 {
 {
 	var->xres = mode->xres;
 	var->xres = mode->xres;
 	var->yres = mode->yres;
 	var->yres = mode->yres;
+	var->xres_virtual = mode->xres;
+	var->yres_virtual = mode->yres;
+	var->xoffset = 0;
+	var->yoffset = 0;
 	var->pixclock = mode->pixclock;
 	var->pixclock = mode->pixclock;
 	var->left_margin = mode->left_margin;
 	var->left_margin = mode->left_margin;
-	var->hsync_len = mode->hsync_len;
-	var->vsync_len = mode->vsync_len;
 	var->right_margin = mode->right_margin;
 	var->right_margin = mode->right_margin;
 	var->upper_margin = mode->upper_margin;
 	var->upper_margin = mode->upper_margin;
 	var->lower_margin = mode->lower_margin;
 	var->lower_margin = mode->lower_margin;
+	var->hsync_len = mode->hsync_len;
+	var->vsync_len = mode->vsync_len;
 	var->sync = mode->sync;
 	var->sync = mode->sync;
 	var->vmode = mode->vmode & FB_VMODE_MASK;
 	var->vmode = mode->vmode & FB_VMODE_MASK;
 }
 }