summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMichael I. Gold <gold@nvidia.com>2011-03-30 19:07:07 -0700
committerErik Gilling <konkers@android.com>2011-05-24 13:55:12 -0700
commit668225d1a8538bf4de1619783e92183251ad328d (patch)
treed13ae61b4c3a6033bf73405eec4f3d3c88571031 /drivers
parent31d7b7582026fc16c5ca29908ff33e5af2a2510f (diff)
video: tegra: add support for tiled surfaces
Change-Id: I82497fc756552740836eaa2f608fecaea409cfeb Signed-off-by: Michael I. Gold <gold@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/tegra/dc/dc.c11
-rw-r--r--drivers/video/tegra/dc/dc_reg.h4
-rw-r--r--drivers/video/tegra/fb.c3
3 files changed, 18 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c
index e846be96c7e6..53f52df2e0f8 100644
--- a/drivers/video/tegra/dc/dc.c
+++ b/drivers/video/tegra/dc/dc.c
@@ -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;
diff --git a/drivers/video/tegra/dc/dc_reg.h b/drivers/video/tegra/dc/dc_reg.h
index 43d0fa579375..df1333e31d14 100644
--- a/drivers/video/tegra/dc/dc_reg.h
+++ b/drivers/video/tegra/dc/dc_reg.h
@@ -382,6 +382,10 @@
#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
diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c
index 06f399b58d55..c42452caef43 100644
--- a/drivers/video/tegra/fb.c
+++ b/drivers/video/tegra/fb.c
@@ -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;