video: tegra: fb: Keep old mode list l4t/l4t-r19.1 daily-2014.03.25.0_l4t/l4t-r19.1 tegra-l4t-r19.1
Pankaj Dabade [Thu, 20 Mar 2014 08:47:27 +0000 (13:47 +0530)]
Keeping the old mode list and framebuffer console is storing a
video mode pointer pointing to one of the modes in modelist.
Adding enable function to enable DC when hotplug succeeds.

bug 1481759

Change-Id: I8164c0d318edc3cbc6f61481eda8c90daabe14a5
Signed-off-by: Pankaj Dabade <pdabade@nvidia.com>
Reviewed-on: http://git-master/r/382507
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

drivers/video/tegra/dc/hdmi_state_machine.c
drivers/video/tegra/fb.c

index 3860f00..e11c8d7 100644 (file)
@@ -146,6 +146,12 @@ static void hdmi_state_machine_handle_hpd_l(int cur_hpd)
        hdmi_state_machine_set_state_l(tgt_state, timeout);
 }
 
+/* Enable DC when hotplug succeeds */
+static void handle_enable_l(struct tegra_dc_hdmi_data *hdmi)
+{
+       tegra_dc_enable(hdmi->dc);
+}
+
 /************************************************************
  *
  * internal state handlers and dispatch table
@@ -255,7 +261,7 @@ static void handle_check_edid_l(struct tegra_dc_hdmi_data *hdmi)
 
        /* Need to unpowergate DC if it was powergated. Updating monitorspecs
         * triggers pan_display which tries updating windows */
-       if (!tegra_dc_is_powered(hdmi->dc))
+       if (hdmi->dc->enabled && !tegra_dc_is_powered(hdmi->dc))
                tegra_dc_unpowergate_locked(hdmi->dc);
 
        tegra_fb_update_monspecs(hdmi->dc->fb, &specs,
@@ -270,7 +276,7 @@ static void handle_check_edid_l(struct tegra_dc_hdmi_data *hdmi)
 #endif
        hdmi->dc->connected = true;
        tegra_dc_ext_process_hotplug(hdmi->dc->ndev->id);
-       hdmi_state_machine_set_state_l(HDMI_STATE_DONE_ENABLED, -1);
+       hdmi_state_machine_set_state_l(HDMI_STATE_DONE_ENABLED, 0);
 
        return;
 
@@ -390,7 +396,7 @@ static const dispatch_func_t state_machine_dispatch[] = {
        handle_check_plug_state_l,      /* STATE_CHECK_PLUG_STATE */
        handle_check_edid_l,            /* STATE_CHECK_EDID */
        NULL,                           /* STATE_DONE_DISABLED */
-       NULL,                           /* STATE_DONE_ENABLED */
+       handle_enable_l,                /* STATE_DONE_ENABLED */
        handle_wait_for_hpd_reassert_l, /* STATE_DONE_WAIT_FOR_HPD_REASSERT */
        handle_recheck_edid_l,          /* STATE_DONE_RECHECK_EDID */
 };
index 36e79dd..7c13f26 100644 (file)
@@ -552,8 +552,6 @@ 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,