Merge branch 'android-tegra' into android-tegra-moto
authorErik Gilling <konkers@android.com>
Thu, 21 Oct 2010 01:28:16 +0000 (18:28 -0700)
committerErik Gilling <konkers@android.com>
Thu, 21 Oct 2010 01:28:16 +0000 (18:28 -0700)
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/hdmi.c
drivers/video/tegra/fb.c

index bea8080b7d1525c90ab3fcf1be35abf94a71c5e5..ac8497fe9061075b33405e9dc9f3201f234197a2 100644 (file)
@@ -818,8 +818,11 @@ static void tegra_dc_init(struct tegra_dc *dc)
                tegra_dc_program_mode(dc, &dc->mode);
 }
 
-static void _tegra_dc_enable(struct tegra_dc *dc)
+static bool _tegra_dc_enable(struct tegra_dc *dc)
 {
+       if (dc->mode.pclk == 0)
+               return false;
+
        tegra_dc_io_start(dc);
 
        if (dc->out && dc->out->enable)
@@ -837,16 +840,16 @@ static void _tegra_dc_enable(struct tegra_dc *dc)
 
        /* force a full blending update */
        dc->blend.z[0] = -1;
+
+       return true;
 }
 
 void tegra_dc_enable(struct tegra_dc *dc)
 {
        mutex_lock(&dc->lock);
 
-       if (!dc->enabled) {
-               _tegra_dc_enable(dc);
-               dc->enabled = true;
-       }
+       if (!dc->enabled)
+               dc->enabled = _tegra_dc_enable(dc);
 
        mutex_unlock(&dc->lock);
 }
index 4be656e351256b19628a87509aa0b8aeb7ae0203..58ad135b90cc8a672a6de86d8eca2654dff9c165 100644 (file)
@@ -465,8 +465,10 @@ static void tegra_dc_hdmi_detect_worker(struct work_struct *work)
                container_of(to_delayed_work(work), struct tegra_dc_hdmi_data, work);
        struct tegra_dc *dc = hdmi->dc;
 
-       if (!tegra_dc_hdmi_detect(dc))
+       if (!tegra_dc_hdmi_detect(dc)) {
                tegra_dc_disable(dc);
+               tegra_fb_update_monspecs(dc->fb, NULL, NULL);
+       }
 }
 
 static irqreturn_t tegra_dc_hdmi_irq(int irq, void *ptr)
index 6d826d03aef903025b2fdccc95f16d018762a0c4..ef4e4c3e370852f2619bf50a192286d922b7b9cd 100644 (file)
@@ -553,11 +553,21 @@ void tegra_fb_update_monspecs(struct tegra_fb_info *fb_info,
        mutex_lock(&fb_info->info->lock);
        fb_destroy_modedb(fb_info->info->monspecs.modedb);
 
+       fb_destroy_modelist(&fb_info->info->modelist);
+
+       if (specs == NULL) {
+               struct tegra_dc_mode mode;
+               memset(&fb_info->info->monspecs, 0x0,
+                      sizeof(fb_info->info->monspecs));
+               memset(&mode, 0x0, sizeof(mode));
+               tegra_dc_set_mode(fb_info->win->dc, &mode);
+               mutex_unlock(&fb_info->info->lock);
+               return;
+       }
+
        memcpy(&fb_info->info->monspecs, specs,
               sizeof(fb_info->info->monspecs));
 
-       fb_destroy_modelist(&fb_info->info->modelist);
-
        for (i = 0; i < specs->modedb_len; i++) {
                if (mode_filter) {
                        if (mode_filter(&specs->modedb[i]))