Merge commit 'main-jb-2012.08.03-B4' into t114-0806
[linux-2.6.git] / drivers / video / tegra / dc / mode.c
index 49cc5f5..be90969 100644 (file)
@@ -247,10 +247,23 @@ int tegra_dc_program_mode(struct tegra_dc *dc, struct tegra_dc_mode *mode)
        return 0;
 }
 
+static int panel_sync_rate;
+
+int tegra_dc_get_panel_sync_rate(void)
+{
+       return panel_sync_rate;
+}
+EXPORT_SYMBOL(tegra_dc_get_panel_sync_rate);
+
 int tegra_dc_set_mode(struct tegra_dc *dc, const struct tegra_dc_mode *mode)
 {
        memcpy(&dc->mode, mode, sizeof(dc->mode));
 
+       if (dc->out->type == TEGRA_DC_OUT_RGB)
+               panel_sync_rate = tegra_dc_calc_refresh(mode);
+       else if (dc->out->type == TEGRA_DC_OUT_DSI)
+               panel_sync_rate = dc->out->dsi->rated_refresh_rate * 1000;
+
        print_mode(dc, mode, __func__);
 
        return 0;