video: tegra: dc: handle tegra_dc_sync_windows error
Bibek Basu [Mon, 17 Aug 2015 11:18:59 +0000 (16:18 +0530)]
In case tegra_dc_sync_windows is interrupted by signal,
return the error to caller application

Bug 200090492

Change-Id: Id69fbe38d0abe0b3e71eb5a413db241ebcf0a0ae
Signed-off-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-on: http://git-master/r/784754
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/dc.c
drivers/video/tegra/dc/ext/dev.c

index 2ec6843..00ae4cb 100644 (file)
@@ -812,7 +812,7 @@ bool tegra_dc_has_vsync(struct tegra_dc *dc);
 void tegra_dc_vsync_enable(struct tegra_dc *dc);
 void tegra_dc_vsync_disable(struct tegra_dc *dc);
 int tegra_dc_wait_for_vsync(struct tegra_dc *dc);
-void tegra_dc_blank(struct tegra_dc *dc, unsigned windows);
+int tegra_dc_blank(struct tegra_dc *dc, unsigned windows);
 int tegra_dc_restore(struct tegra_dc *dc);
 
 void tegra_dc_enable(struct tegra_dc *dc);
index 872bff4..588ef13 100644 (file)
@@ -2660,17 +2660,18 @@ bool tegra_dc_stats_get(struct tegra_dc *dc)
 }
 
 /* blank selected windows by disabling them */
-void tegra_dc_blank(struct tegra_dc *dc, unsigned windows)
+int tegra_dc_blank(struct tegra_dc *dc, unsigned windows)
 {
        struct tegra_dc_win *dcwins[DC_N_WINDOWS];
        unsigned i;
        unsigned long int blank_windows;
        int nr_win = 0;
+       int ret = 0;
 
        blank_windows = windows & dc->valid_windows;
 
        if (!blank_windows)
-               return;
+               return ret;
 
        for_each_set_bit(i, &blank_windows, DC_N_WINDOWS) {
                dcwins[nr_win] = tegra_dc_get_window(dc, i);
@@ -2680,8 +2681,14 @@ void tegra_dc_blank(struct tegra_dc *dc, unsigned windows)
        }
 
        tegra_dc_update_windows(dcwins, nr_win, NULL);
-       tegra_dc_sync_windows(dcwins, nr_win);
+       ret = tegra_dc_sync_windows(dcwins, nr_win);
+       if (ret <= 0) {
+               dev_dbg(&dc->ndev->dev, "Error %d\n", ret);
+               return ret;
+       }
+
        tegra_dc_program_bandwidth(dc, true);
+       return ret;
 }
 
 int tegra_dc_restore(struct tegra_dc *dc)
index 0560a8b..38dc4a9 100644 (file)
@@ -1210,7 +1210,9 @@ static long tegra_dc_ioctl(struct file *filp, unsigned int cmd,
        case TEGRA_DC_EXT_PUT_WINDOW:
                ret = tegra_dc_ext_put_window(user, arg);
                if (!ret) {
-                       tegra_dc_blank(user->ext->dc, BIT(arg));
+                       ret = tegra_dc_blank(user->ext->dc, BIT(arg));
+                       if (ret < 0)
+                               return ret;
                        tegra_dc_ext_unpin_window(&user->ext->win[arg]);
                }
                return ret;