summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorErik Gilling <konkers@android.com>2010-11-05 15:30:35 -0700
committerErik Gilling <konkers@android.com>2010-11-09 13:54:36 -0800
commitf1ec3093e5ef4f60878214b820150b2c13cd7b27 (patch)
tree4cae62257a976aab598d85c267d1ca108cdd3407 /drivers
parentacfd7740ee58583be0f95a943c770b1fe14be1ad (diff)
video: tegra: fix crash when no HDMI modes are supported
Change-Id: I2e23d018d5acb814e7a088921c26c8f305790442 Signed-off-by: Erik Gilling <konkers@android.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra/fb.c24
1 files changed, 15 insertions, 9 deletions
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);