From mboxrd@z Thu Jan 1 00:00:00 1970 From: Geert Uytterhoeven Subject: [PATCH 4/9] fb_videomode_to_var: reset virtual screen parameters Date: Thu, 25 Jan 2007 18:49:52 +0100 (CET) Message-ID: References: Reply-To: linux-fbdev-devel@lists.sourceforge.net Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sc8-sf-mx2-b.sourceforge.net ([10.3.1.92] helo=mail.sourceforge.net) by sc8-sf-list1-new.sourceforge.net with esmtp (Exim 4.43) id 1HA8ji-0007iK-AU for linux-fbdev-devel@lists.sourceforge.net; Thu, 25 Jan 2007 09:50:10 -0800 Received: from [80.88.33.193] (helo=vervifontaine.sonycom.com) by mail.sourceforge.net with esmtp (Exim 4.44) id 1HA8jg-0000HV-Ty for linux-fbdev-devel@lists.sourceforge.net; Thu, 25 Jan 2007 09:50:10 -0800 In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-fbdev-devel-bounces@lists.sourceforge.net Errors-To: linux-fbdev-devel-bounces@lists.sourceforge.net To: James Simmons , Paul Mackerras Cc: Linux/PPC Development , Linux Frame Buffer Device Development 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 --- drivers/video/modedb.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) --- ps3-linux.orig/drivers/video/modedb.c +++ ps3-linux/drivers/video/modedb.c @@ -716,13 +716,17 @@ void fb_videomode_to_var(struct fb_var_s { var->xres = mode->xres; 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->left_margin = mode->left_margin; - var->hsync_len = mode->hsync_len; - var->vsync_len = mode->vsync_len; var->right_margin = mode->right_margin; var->upper_margin = mode->upper_margin; var->lower_margin = mode->lower_margin; + var->hsync_len = mode->hsync_len; + var->vsync_len = mode->vsync_len; var->sync = mode->sync; var->vmode = mode->vmode & FB_VMODE_MASK; } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE) Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1 Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vervifontaine.sonycom.com (unknown [80.88.33.193]) by ozlabs.org (Postfix) with ESMTP id 1B429DDEBA for ; Fri, 26 Jan 2007 04:49:54 +1100 (EST) Date: Thu, 25 Jan 2007 18:49:52 +0100 (CET) From: Geert Uytterhoeven Sender: geert@sonytel.be To: James Simmons , Paul Mackerras Subject: [PATCH 4/9] fb_videomode_to_var: reset virtual screen parameters In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Linux/PPC Development , Linux Frame Buffer Device Development List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 --- drivers/video/modedb.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) --- ps3-linux.orig/drivers/video/modedb.c +++ ps3-linux/drivers/video/modedb.c @@ -716,13 +716,17 @@ void fb_videomode_to_var(struct fb_var_s { var->xres = mode->xres; 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->left_margin = mode->left_margin; - var->hsync_len = mode->hsync_len; - var->vsync_len = mode->vsync_len; var->right_margin = mode->right_margin; var->upper_margin = mode->upper_margin; var->lower_margin = mode->lower_margin; + var->hsync_len = mode->hsync_len; + var->vsync_len = mode->vsync_len; var->sync = mode->sync; var->vmode = mode->vmode & FB_VMODE_MASK; } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- Sony Network and Software Technology Center Europe (NSCE) Geert.Uytterhoeven@sonycom.com ------- The Corporate Village, Da Vincilaan 7-D1 Voice +32-2-7008453 Fax +32-2-7008622 ---------------- B-1935 Zaventem, Belgium