video: tegra: add support for tiled surfaces
Michael I. Gold [Thu, 31 Mar 2011 02:07:07 +0000 (19:07 -0700)]
Change-Id: I82497fc756552740836eaa2f608fecaea409cfeb
Signed-off-by: Michael I. Gold <gold@nvidia.com>

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

index 8ca6f3d..daaeb3b 100644 (file)
@@ -124,6 +124,7 @@ struct tegra_dc_win {
 #define TEGRA_WIN_FLAG_BLEND_COVERAGE  (1 << 2)
 #define TEGRA_WIN_FLAG_INVERT_H                (1 << 3)
 #define TEGRA_WIN_FLAG_INVERT_V                (1 << 4)
+#define TEGRA_WIN_FLAG_TILED           (1 << 5)
 
 #define TEGRA_WIN_BLEND_FLAGS_MASK \
        (TEGRA_WIN_FLAG_BLEND_PREMULT | TEGRA_WIN_FLAG_BLEND_COVERAGE)
index e846be9..53f52df 100644 (file)
@@ -585,6 +585,17 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n)
                tegra_dc_writel(dc, h_offset, DC_WINBUF_ADDR_H_OFFSET);
                tegra_dc_writel(dc, v_offset, DC_WINBUF_ADDR_V_OFFSET);
 
+               if (win->flags & TEGRA_WIN_FLAG_TILED)
+                       tegra_dc_writel(dc,
+                                       DC_WIN_BUFFER_ADDR_MODE_TILE |
+                                       DC_WIN_BUFFER_ADDR_MODE_TILE_UV,
+                                       DC_WIN_BUFFER_ADDR_MODE);
+               else
+                       tegra_dc_writel(dc,
+                                       DC_WIN_BUFFER_ADDR_MODE_LINEAR |
+                                       DC_WIN_BUFFER_ADDR_MODE_LINEAR_UV,
+                                       DC_WIN_BUFFER_ADDR_MODE);
+
                val = WIN_ENABLE;
                if (yuvp)
                        val |= CSC_ENABLE;
index 43d0fa5..df1333e 100644 (file)
 #define DC_WIN_BUF_STRIDE                      0x70b
 #define DC_WIN_UV_BUF_STRIDE                   0x70c
 #define DC_WIN_BUFFER_ADDR_MODE                        0x70d
+#define  DC_WIN_BUFFER_ADDR_MODE_LINEAR                (0 << 0)
+#define  DC_WIN_BUFFER_ADDR_MODE_LINEAR_UV     (0 << 16)
+#define  DC_WIN_BUFFER_ADDR_MODE_TILE          (1 << 0)
+#define  DC_WIN_BUFFER_ADDR_MODE_TILE_UV       (1 << 16)
 #define DC_WIN_DV_CONTROL                      0x70e
 #define DC_WIN_BLEND_NOKEY                     0x70f
 #define DC_WIN_BLEND_1WIN                      0x710
index 06f399b..c42452c 100644 (file)
@@ -391,6 +391,9 @@ static int tegra_fb_set_windowattr(struct tegra_fb_info *tegra_fb,
                win->flags |= TEGRA_WIN_FLAG_INVERT_H;
        if (flip_win->attr.flags & TEGRA_FB_WIN_FLAG_INVERT_V)
                win->flags |= TEGRA_WIN_FLAG_INVERT_V;
+       if (flip_win->attr.flags & TEGRA_FB_WIN_FLAG_TILED)
+               win->flags |= TEGRA_WIN_FLAG_TILED;
+
        win->fmt = flip_win->attr.pixformat;
        win->x = flip_win->attr.x;
        win->y = flip_win->attr.y;
index 01f94c6..6e765c5 100644 (file)
@@ -51,6 +51,7 @@
 
 #define TEGRA_FB_WIN_FLAG_INVERT_H     (1 << 0)
 #define TEGRA_FB_WIN_FLAG_INVERT_V     (1 << 1)
+#define TEGRA_FB_WIN_FLAG_TILED                (1 << 2)
 
 /* set index to -1 to ignore window data */
 struct tegra_fb_windowattr {