video: fbcon: Keep atleast one mode in modelist
Pankaj Dabade [Thu, 12 Feb 2015 10:28:56 +0000 (15:28 +0530)]
Framebuffer console init requires atleast one valid
mode to exist for it to succeed.
Virtual terminals relies on the success of fbcon_init
without really checking the return value of this function.

Bug 200036424

Change-Id: Ia34da6ab3814f667a485d23ef88e1a52f8b5519b
Signed-off-by: Pankaj Dabade <pdabade@nvidia.com>
Reviewed-on: http://git-master/r/707309
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>

drivers/video/tegra/fb.c

index 487ffaf..db0378d 100644 (file)
@@ -589,8 +589,8 @@ void tegra_fb_update_monspecs(struct tegra_fb_info *fb_info,
                 * displayed on 'mode' device.
                 */
                fb_info->info->mode = (struct fb_videomode*) NULL;
-
-               memset(&fb_info->info->var, 0x0, sizeof(fb_info->info->var));
+               fb_add_videomode(&tegra_dc_vga_mode, &fb_info->info->modelist);
+               fb_videomode_to_var(&fb_info->info->var, &tegra_dc_vga_mode);
 
                tegra_dc_set_mode(fb_info->win.dc, &mode);
                mutex_unlock(&fb_info->info->lock);