]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: dc: accept CSC on window update
authorJon Mayo <jmayo@nvidia.com>
Fri, 13 Jun 2014 00:02:10 +0000 (17:02 -0700)
committerEmad Mir <emir@nvidia.com>
Wed, 25 Jun 2014 18:21:09 +0000 (11:21 -0700)
This patch permits changing of the current CSC coefficients. It cannot be used
with interlaced mode.

Adds fields to skip window CSC programming if nothing has changed.

Bug 1522546

Change-Id: If8fc6a5d634e4b300ef0de6a5913188fe1f1efb0
Signed-off-by: Jon Mayo <jmayo@nvidia.com>
Reviewed-on: http://git-master/r/422885
(cherry picked from commit 4aa22cd32362f0d91ef030bc0942c303714141cf)
Reviewed-on: http://git-master/r/425986
GVS: Gerrit_Virtual_Submit
Reviewed-by: Michael Frydrych <mfrydrych@nvidia.com>
Tested-by: Michael Frydrych <mfrydrych@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
arch/arm/mach-tegra/include/mach/dc.h
drivers/video/tegra/dc/ext/dev.c
drivers/video/tegra/dc/window.c
include/video/tegra_dc_ext.h

index f4bba0cef1edb51cfffa6e96a3f104f2e5ba5107..7306fdacca29585a5f613e4feaca91a8ba19bb5c 100644 (file)
@@ -691,6 +691,7 @@ struct tegra_dc_win {
        unsigned                z;
 
        struct tegra_dc_csc     csc;
+       bool                    csc_dirty;
 
        int                     dirty;
        int                     underflows;
index ed894b2053f03252f98feedf44588a51925030b4..788d6c33d2a254086181ee758dfcdec072763f53 100644 (file)
@@ -538,6 +538,19 @@ static void tegra_dc_ext_flip_worker(struct work_struct *work)
                        }
                }
 
+               if (data->win[i].attr.flags
+                       & TEGRA_DC_EXT_FLIP_FLAG_UPDATE_CSC) {
+                       win->csc.yof = data->win[i].attr.csc.yof;
+                       win->csc.kyrgb = data->win[i].attr.csc.kyrgb;
+                       win->csc.kur = data->win[i].attr.csc.kur;
+                       win->csc.kug = data->win[i].attr.csc.kug;
+                       win->csc.kub = data->win[i].attr.csc.kub;
+                       win->csc.kvr = data->win[i].attr.csc.kvr;
+                       win->csc.kvg = data->win[i].attr.csc.kvg;
+                       win->csc.kvb = data->win[i].attr.csc.kvb;
+                       win->csc_dirty = true;
+               }
+
                if (!skip_flip)
                        tegra_dc_ext_set_windowattr(ext, win, &data->win[i]);
 
index a3d5d4dea4d9fef8e3e36ee305dc1ca5f8cce969..ef8dd918a9372a7bc95281338052a54267abcc9e 100644 (file)
@@ -885,6 +885,11 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n,
                                win_options |= INTERLACE_ENABLE;
                }
 #endif
+               if (dc_win->csc_dirty) {
+                       tegra_dc_set_csc(dc, &dc_win->csc);
+                       dc_win->csc_dirty = false;
+               }
+
                tegra_dc_writel(dc, win_options, DC_WIN_WIN_OPTIONS);
 
                dc_win->dirty = no_vsync ? 0 : 1;
index 72e6329b02e7292ababdf28ce356cc48768455a0..78e344d5ad6f73c92d694a51dfda87e13baec9db 100644 (file)
@@ -92,6 +92,7 @@
 #define TEGRA_DC_EXT_FLIP_FLAG_BLOCKLINEAR     (1 << 5)
 #define TEGRA_DC_EXT_FLIP_FLAG_SCAN_COLUMN     (1 << 6)
 #define TEGRA_DC_EXT_FLIP_FLAG_INTERLACE       (1 << 7)
+#define TEGRA_DC_EXT_FLIP_FLAG_UPDATE_CSC      (1 << 9)
 
 struct tegra_timespec {
        __s32   tv_sec; /* seconds */
@@ -138,11 +139,24 @@ struct tegra_dc_ext_flip_windowattr {
        /* log2(blockheight) for blocklinear format */
        __u8    block_height_log2;
        __u8    pad1[2];
-       __u32   offset2;
-       __u32   offset_u2;
-       __u32   offset_v2;
-       /* Leave some wiggle room for future expansion */
-       __u32   pad2[1];
+       union { /* fields for mutually exclusive options */
+               struct { /* TEGRA_DC_EXT_FLIP_FLAG_INTERLACE */
+                       __u32   offset2;
+                       __u32   offset_u2;
+                       __u32   offset_v2;
+                       __u32   pad2[1];
+               };
+               struct { /* TEGRA_DC_EXT_FLIP_FLAG_UPDATE_CSC */
+                       __u16 yof;      /* s.7.0 */
+                       __u16 kyrgb;    /*   2.8 */
+                       __u16 kur;      /* s.2.8 */
+                       __u16 kvr;      /* s.2.8 */
+                       __u16 kug;      /* s.1.8 */
+                       __u16 kvg;      /* s.1.8 */
+                       __u16 kub;      /* s.2.8 */
+                       __u16 kvb;      /* s.2.8 */
+               } csc;
+       };
 };
 
 #define TEGRA_DC_EXT_FLIP_N_WINDOWS    3