video: tegra: provide blank that clears screen
Jon Mayo [Wed, 21 Sep 2011 01:06:49 +0000 (18:06 -0700)]
Only clear the display when ioctl FBIOBLANK is FB_BLANK_NORMAL is used
This indicates that display should still be powered on and is useful
when HDMI audio needs to remain active but no content is displayed on
screen.

bug 857117
bug 868916

Reviewed-on: http://git-master/r/53608
(cherry picked from commit 234a39002a5a4daa364271ed357de14cff06f6a9)

Change-Id: I5a3c3bf5180100e0d1a410bd11ddb60d22562276
Reviewed-on: http://git-master/r/56299
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>

Rebase-Id: R349ae85c159dfd3d1be279964d341ba402fc54ca

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

index 6b53b03..277c38d 100644 (file)
@@ -460,6 +460,8 @@ struct tegra_dc *tegra_dc_get_dc(unsigned idx);
 struct tegra_dc_win *tegra_dc_get_window(struct tegra_dc *dc, unsigned win);
 bool tegra_dc_get_connected(struct tegra_dc *);
 
+void tegra_dc_blank(struct tegra_dc *dc);
+
 void tegra_dc_enable(struct tegra_dc *dc);
 void tegra_dc_disable(struct tegra_dc *dc);
 
index 347226a..865944e 100644 (file)
@@ -2375,6 +2375,21 @@ bool tegra_dc_stats_get(struct tegra_dc *dc)
        return true;
 }
 
+/* make the screen blank by disabling all windows */
+void tegra_dc_blank(struct tegra_dc *dc)
+{
+       struct tegra_dc_win *dcwins[DC_N_WINDOWS];
+       unsigned i;
+
+       for (i = 0; i < DC_N_WINDOWS; i++) {
+               dcwins[i] = tegra_dc_get_window(dc, i);
+               dcwins[i]->flags &= ~TEGRA_WIN_FLAG_ENABLED;
+       }
+
+       tegra_dc_update_windows(dcwins, DC_N_WINDOWS);
+       tegra_dc_sync_windows(dcwins, DC_N_WINDOWS);
+}
+
 static void _tegra_dc_disable(struct tegra_dc *dc)
 {
        _tegra_dc_controller_disable(dc);
index b170bcd..72176b7 100644 (file)
@@ -182,10 +182,14 @@ static int tegra_fb_blank(int blank, struct fb_info *info)
                return 0;
 
        case FB_BLANK_NORMAL:
+               dev_dbg(&tegra_fb->ndev->dev, "blank - normal\n");
+               tegra_dc_blank(tegra_fb->win->dc);
+               return 0;
+
        case FB_BLANK_VSYNC_SUSPEND:
        case FB_BLANK_HSYNC_SUSPEND:
        case FB_BLANK_POWERDOWN:
-               dev_dbg(&tegra_fb->ndev->dev, "blank\n");
+               dev_dbg(&tegra_fb->ndev->dev, "blank - powerdown\n");
                tegra_dc_disable(tegra_fb->win->dc);
                return 0;