i810fb: Restore xres and yres option parameters
PATCH 2/4 i810fb: Restore xres and yres option parameters
If i810fb successfully probed for the EDID, it will disregard the boot option parameters 'xres' and 'yres'. Fix this regression.
Excellent testing done by Manuel Lauss <[email protected]>.
Signed-off-by Antonino Daplas <[email protected]>
--- i810_main.c | 52 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 35 insertions(+), 17 deletions(-)
drivers/video/i810/i810_main.c +35 -17
@@ -95,18 +95,18 @@ static struct pci_driver i810fb_driver =static char *mode_option__devinitdata =NULL ;static int vram__devinitdata =4 ;static int bpp__devinitdata =8 ; -static int mtrr__devinitdata =0 ; -static int accel__devinitdata =0 ; -static int hsync1__devinitdata =0 ; -static int hsync2__devinitdata =0 ; -static int vsync1__devinitdata =0 ; -static int vsync2__devinitdata =0 ; -static int xres__devinitdata =640 ; -static int yres__devinitdata =480 ; -static int vyres__devinitdata =0 ; -static int sync__devinitdata =0 ; -static int ext_vga__devinitdata =0 ; -static int dcolor__devinitdata =0 ; +static int mtrr__devinitdata ; +static int accel__devinitdata ; +static int hsync1__devinitdata ; +static int hsync2__devinitdata ; +static int vsync1__devinitdata ; +static int vsync2__devinitdata ; +static int xres__devinitdata ; +static int yres__devinitdata ; +static int vyres__devinitdata ; +static int sync__devinitdata ; +static int ext_vga__devinitdata ; +static int dcolor__devinitdata ;/*------------------------------------------------------------*/
@@ -1725,12 +1725,21 @@ static void __devinit i810_init_defaultsif (bpp <8 ) bpp =8 ; + par->i810fb_ops = i810fb_ops; + +if (xres) + info->var.xres = xres; +else + info->var.xres =640 ; + +if (yres) + info->var.yres = yres; +else + info->var.yres =480 ; +if (!vyres) - vyres = (vram <<20 )/(xres*bpp >>3 ); + vyres = (vram <<20 )/(info->var.xres*bpp >>3 ); - par->i810fb_ops = i810fb_ops; - info->var.xres = xres; - info->var.yres = yres; info->var.yres_virtual = vyres; info->var.bits_per_pixel = bpp;
@@ -1862,7 +1871,16 @@ static void __devinit i810fb_find_init_mfb_videomode_to_modelist (specs->modedb, specs->modedb_len, &info->modelist);if (specs->modedb !=NULL ) { -if (specs->misc &FB_MISC_1ST_DETAIL ) { +if (xres && yres) { +struct fb_videomode *m; + +if ((m =fb_find_best_mode (&var, &info->modelist))) { + mode = *m; + found =1 ; + } + } + +if (!found && specs->misc &FB_MISC_1ST_DETAIL ) {for (i =0 ; i < specs->modedb_len; i++) {if (specs->modedb[i].flag &FB_MODE_IS_FIRST ) { mode = specs->modedb[i];
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf