diff options
author | Erik Gilling <konkers@android.com> | 2011-05-24 15:41:54 -0700 |
---|---|---|
committer | Erik Gilling <konkers@android.com> | 2011-05-24 15:42:09 -0700 |
commit | e70a45d0e17f752d11d1d6bc8df29fdf12b80196 (patch) | |
tree | 68954bbee08a7487333858718c7e10b88fbbec20 /drivers/video | |
parent | f6874dc5e20d69bc5aed0d1b0edb7f9b902c8b04 (diff) | |
parent | 668225d1a8538bf4de1619783e92183251ad328d (diff) |
Merge branch 'linux-tegra-2.6.36' into android-tegra-2.6.36
Change-Id: I80fdbf17c2e3a77be3ea63350191c8eab235ed94
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/tegra/dc/dc.c | 36 | ||||
-rw-r--r-- | drivers/video/tegra/dc/dc_reg.h | 8 | ||||
-rw-r--r-- | drivers/video/tegra/fb.c | 7 |
3 files changed, 46 insertions, 5 deletions
diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 4549670fdff5..53f52df2e0f8 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -500,6 +500,10 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) struct tegra_dc_win *win = windows[i]; unsigned h_dda; unsigned v_dda; + unsigned h_offset; + unsigned v_offset; + bool invert_h = (win->flags & TEGRA_WIN_FLAG_INVERT_H) != 0; + bool invert_v = (win->flags & TEGRA_WIN_FLAG_INVERT_V) != 0; bool yuvp = tegra_dc_is_yuv_planar(win->fmt); if (win->z != dc->blend.z[win->idx]) { @@ -567,9 +571,30 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) DC_WIN_LINE_STRIDE); } - tegra_dc_writel(dc, win->x * tegra_dc_fmt_bpp(win->fmt) / 8, - DC_WINBUF_ADDR_H_OFFSET); - tegra_dc_writel(dc, win->y, DC_WINBUF_ADDR_V_OFFSET); + h_offset = win->x; + if (invert_h) { + h_offset += win->w - 1; + } + h_offset *= tegra_dc_fmt_bpp(win->fmt) / 8; + + v_offset = win->y; + if (invert_v) { + v_offset += win->h - 1; + } + + 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) @@ -582,6 +607,11 @@ int tegra_dc_update_windows(struct tegra_dc_win *windows[], int n) if (win->h != win->out_h) val |= V_FILTER_ENABLE; + if (invert_h) + val |= H_DIRECTION_DECREMENT; + if (invert_v) + val |= V_DIRECTION_DECREMENT; + tegra_dc_writel(dc, val, DC_WIN_WIN_OPTIONS); win->dirty = no_vsync ? 0 : 1; diff --git a/drivers/video/tegra/dc/dc_reg.h b/drivers/video/tegra/dc/dc_reg.h index ab21c6eba0e1..df1333e31d14 100644 --- a/drivers/video/tegra/dc/dc_reg.h +++ b/drivers/video/tegra/dc/dc_reg.h @@ -332,9 +332,9 @@ #define DC_WIN_V_FILTER_P(x) (0x619 + (x)) #define DC_WIN_WIN_OPTIONS 0x700 #define H_DIRECTION_INCREMENT (0 << 0) -#define H_DIRECTION_DECREMENTT (1 << 0) +#define H_DIRECTION_DECREMENT (1 << 0) #define V_DIRECTION_INCREMENT (0 << 2) -#define V_DIRECTION_DECREMENTT (1 << 2) +#define V_DIRECTION_DECREMENT (1 << 2) #define COLOR_EXPAND (1 << 6) #define H_FILTER_ENABLE (1 << 8) #define V_FILTER_ENABLE (1 << 10) @@ -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 9b70114c9cd1..c42452caef43 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -387,6 +387,13 @@ static int tegra_fb_set_windowattr(struct tegra_fb_info *tegra_fb, win->flags |= TEGRA_WIN_FLAG_BLEND_PREMULT; else if (flip_win->attr.blend == TEGRA_FB_WIN_BLEND_COVERAGE) win->flags |= TEGRA_WIN_FLAG_BLEND_COVERAGE; + if (flip_win->attr.flags & TEGRA_FB_WIN_FLAG_INVERT_H) + 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; |