video: tegra: Check DC connected status
Pankaj Dabade [Tue, 25 Mar 2014 11:34:58 +0000 (16:34 +0530)]
1. Prevent any operations from user-space and tty when no HDMI
device is connected. DC will stay powergated till hotplugged.
2. Virtual Terminal requests blank after blank timeout. If HDMI
isn't connected we shouldn't allow this operation.

bug 1487112
bug 1481748

Change-Id: I0bd97e62ca059513044bc49b8d8c045610268016
Signed-off-by: Pankaj Dabade <pdabade@nvidia.com>
Reviewed-on: http://git-master/r/391152
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Tested-by: Matthew Pedro <mapedro@nvidia.com>

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

index f260745..4030c55 100644 (file)
@@ -2508,6 +2508,12 @@ void tegra_dc_blank(struct tegra_dc *dc)
        struct tegra_dc_win *dcwins[DC_N_WINDOWS];
        unsigned i;
 
+/* virtual terminal triggers blank after blank timeout.
+    If HDMI is not connected, dc is powergated.
+    This check prevents operations on powergated DC. */
+       if (!dc->connected)
+               return;
+
        for (i = 0; i < DC_N_WINDOWS; i++) {
                dcwins[i] = tegra_dc_get_window(dc, i);
                if (!dcwins[i])
index 7c13f26..259a911 100644 (file)
@@ -355,6 +355,11 @@ static int tegra_fb_pan_display(struct fb_var_screeninfo *var,
                return 0;
 #endif
 
+       /* To prevent any call to update and sync window
+           when HDMI is not connected. */
+       if (!tegra_fb->win->dc->connected)
+               return 0;
+
        if (!tegra_fb->win->cur_handle) {
                flush_start = info->screen_base +
                (var->yoffset * info->fix.line_length);