video: tegra: Support dither settings
Chao Jiang [Fri, 14 Jan 2011 03:08:34 +0000 (12:08 +0900)]
Support dither settings in display control structure by writing color
control registers.

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

Rebase-Id: R24ecffdf5186c8886b44afb90f2096a0c1ae2a2f

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

index 75ce437..f778aeb 100644 (file)
@@ -66,6 +66,12 @@ enum {
        TEGRA_DC_OUT_PIN_POL_HIGH,
 };
 
+enum {
+       TEGRA_DC_DISABLE_DITHER = 1,
+       TEGRA_DC_ORDERED_DITHER,
+       TEGRA_DC_ERRDIFF_DITHER,
+};
+
 struct tegra_dc_out {
        int                     type;
        unsigned                flags;
@@ -80,6 +86,7 @@ struct tegra_dc_out {
        unsigned                order;
        unsigned                align;
        unsigned                depth;
+       unsigned                dither;
 
        unsigned                height; /* mm */
        unsigned                width; /* mm */
index 457cac1..ce5eea2 100644 (file)
@@ -1055,6 +1055,18 @@ static void tegra_dc_set_color_control(struct tegra_dc *dc)
                break;
        }
 
+       switch (dc->out->dither) {
+       case TEGRA_DC_DISABLE_DITHER:
+               color_control |= DITHER_CONTROL_DISABLE;
+               break;
+       case TEGRA_DC_ORDERED_DITHER:
+               color_control |= DITHER_CONTROL_ORDERED;
+               break;
+       case TEGRA_DC_ERRDIFF_DITHER:
+               color_control |= DITHER_CONTROL_ERRDIFF;
+               break;
+       }
+
        tegra_dc_writel(dc, color_control, DC_DISP_DISP_COLOR_CONTROL);
 }