From: Erik Gilling Date: Fri, 5 Nov 2010 22:30:35 +0000 (-0700) Subject: video: tegra: fix crash when no HDMI modes are supported X-Git-Tag: firefly_0821_release~9833^2~117^2~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f1ec3093e5ef4f60878214b820150b2c13cd7b27;p=firefly-linux-kernel-4.4.55.git video: tegra: fix crash when no HDMI modes are supported Change-Id: I2e23d018d5acb814e7a088921c26c8f305790442 Signed-off-by: Erik Gilling --- diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index a4f38c4f15f0..6992e1c06ddf 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -604,15 +604,21 @@ void tegra_fb_update_monspecs(struct tegra_fb_info *fb_info, } } - /* in case the first mode was not matched */ - m = list_first_entry(&fb_info->info->modelist, struct fb_modelist, list); - m->mode.flag |= FB_MODE_IS_FIRST; - - fb_info->info->mode = (struct fb_videomode *) - fb_find_best_display(specs, &fb_info->info->modelist); - - fb_videomode_to_var(&fb_info->info->var, fb_info->info->mode); - tegra_fb_set_par(fb_info->info); + if (list_empty(&fb_info->info->modelist)) { + struct tegra_dc_mode mode; + memset(&fb_info->info->var, 0x0, sizeof(fb_info->info->var)); + memset(&mode, 0x0, sizeof(mode)); + tegra_dc_set_mode(fb_info->win->dc, &mode); + } else { + /* in case the first mode was not matched */ + m = list_first_entry(&fb_info->info->modelist, struct fb_modelist, list); + m->mode.flag |= FB_MODE_IS_FIRST; + fb_info->info->mode = (struct fb_videomode *) + fb_find_best_display(specs, &fb_info->info->modelist); + + fb_videomode_to_var(&fb_info->info->var, fb_info->info->mode); + tegra_fb_set_par(fb_info->info); + } event.info = fb_info->info; fb_notifier_call_chain(FB_EVENT_NEW_MODELIST, &event);