diff options
author | Chao Xu <cxu@nvidia.com> | 2012-06-20 17:05:45 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 13:20:19 -0700 |
commit | 088af69ebe3144a22e5d0da98548524bd8a8cf9e (patch) | |
tree | 00f301da45eb4e0e7e82ce7409b668bfcb8bf692 | |
parent | 98767d097570f5d26a21d393b87398aec65a0a34 (diff) |
video: tegra: dc: add kernel blocklinear interface
Change-Id: I2cc33844d07f34b5391c927293015294b45ae125
Signed-off-by: Chao Xu <cxu@nvidia.com>
Reviewed-on: http://git-master/r/110199
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Mark Stadler <mastadler@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/include/mach/dc.h | 1 | ||||
-rw-r--r-- | drivers/video/tegra/dc/ext/dev.c | 14 | ||||
-rw-r--r-- | drivers/video/tegra/dc/ext/tegra_dc_ext_priv.h | 3 | ||||
-rw-r--r-- | include/video/tegra_dc_ext.h | 15 |
4 files changed, 27 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/include/mach/dc.h b/arch/arm/mach-tegra/include/mach/dc.h index 7e48ddaeafd9..79afabf6733a 100644 --- a/arch/arm/mach-tegra/include/mach/dc.h +++ b/arch/arm/mach-tegra/include/mach/dc.h @@ -640,6 +640,7 @@ struct tegra_dc_win { #define TEGRA_WIN_FLAG_TILED (1 << 5) #define TEGRA_WIN_FLAG_H_FILTER (1 << 6) #define TEGRA_WIN_FLAG_V_FILTER (1 << 7) +#define TEGRA_WIN_FLAG_BLOCKLINEAR (1 << 8) #define TEGRA_WIN_FLAG_SCAN_COLUMN (1 << 9) diff --git a/drivers/video/tegra/dc/ext/dev.c b/drivers/video/tegra/dc/ext/dev.c index 47064c3a1338..9d55d4d00626 100644 --- a/drivers/video/tegra/dc/ext/dev.c +++ b/drivers/video/tegra/dc/ext/dev.c @@ -205,6 +205,17 @@ int tegra_dc_ext_check_windowattr(struct tegra_dc_ext *ext, goto fail; } + if (win->flags & TEGRA_DC_EXT_FLIP_FLAG_BLOCKLINEAR) { + if (win->flags & TEGRA_DC_EXT_FLIP_FLAG_TILED) { + dev_err(&dc->ndev->dev, "Layout cannot be both " + "blocklinear and tile for window %d.\n", + win->idx); + goto fail; + } + + /* TODO: also check current window blocklinear support */ + } + return 0; fail: return -EINVAL; @@ -243,6 +254,8 @@ static int tegra_dc_ext_set_windowattr(struct tegra_dc_ext *ext, if (flip_win->attr.flags & TEGRA_DC_EXT_FLIP_FLAG_SCAN_COLUMN) win->flags |= TEGRA_WIN_FLAG_SCAN_COLUMN; #endif + if (flip_win->attr.flags & TEGRA_DC_EXT_FLIP_FLAG_BLOCKLINEAR) + win->flags |= TEGRA_WIN_FLAG_BLOCKLINEAR; win->fmt = flip_win->attr.pixformat; win->x.full = flip_win->attr.x; win->y.full = flip_win->attr.y; @@ -271,6 +284,7 @@ static int tegra_dc_ext_set_windowattr(struct tegra_dc_ext *ext, win->stride = flip_win->attr.stride; win->stride_uv = flip_win->attr.stride_uv; + /* win->blockheight = flip_win->attr.block_height_log2; */ err = tegra_dc_ext_check_windowattr(ext, win); if (err < 0) dev_err(&ext->dc->ndev->dev, diff --git a/drivers/video/tegra/dc/ext/tegra_dc_ext_priv.h b/drivers/video/tegra/dc/ext/tegra_dc_ext_priv.h index 1329544b21d7..445c24605d18 100644 --- a/drivers/video/tegra/dc/ext/tegra_dc_ext_priv.h +++ b/drivers/video/tegra/dc/ext/tegra_dc_ext_priv.h @@ -97,7 +97,8 @@ struct tegra_dc_ext_event_list { }; #define TEGRA_DC_EXT_CAPABILITIES \ - TEGRA_DC_EXT_CAPABILITIES_CURSOR_MODE + (TEGRA_DC_EXT_CAPABILITIES_CURSOR_MODE |\ + TEGRA_DC_EXT_CAPABILITIES_BLOCKLINEAR) struct tegra_dc_ext_control_user { struct tegra_dc_ext_control *control; diff --git a/include/video/tegra_dc_ext.h b/include/video/tegra_dc_ext.h index c0a9f0272966..868bfcf34420 100644 --- a/include/video/tegra_dc_ext.h +++ b/include/video/tegra_dc_ext.h @@ -72,11 +72,12 @@ #define TEGRA_DC_EXT_BLEND_PREMULT 1 #define TEGRA_DC_EXT_BLEND_COVERAGE 2 -#define TEGRA_DC_EXT_FLIP_FLAG_INVERT_H (1 << 0) -#define TEGRA_DC_EXT_FLIP_FLAG_INVERT_V (1 << 1) -#define TEGRA_DC_EXT_FLIP_FLAG_TILED (1 << 2) -#define TEGRA_DC_EXT_FLIP_FLAG_CURSOR (1 << 3) +#define TEGRA_DC_EXT_FLIP_FLAG_INVERT_H (1 << 0) +#define TEGRA_DC_EXT_FLIP_FLAG_INVERT_V (1 << 1) +#define TEGRA_DC_EXT_FLIP_FLAG_TILED (1 << 2) +#define TEGRA_DC_EXT_FLIP_FLAG_CURSOR (1 << 3) #define TEGRA_DC_EXT_FLIP_FLAG_GLOBAL_ALPHA (1 << 4) +#define TEGRA_DC_EXT_FLIP_FLAG_BLOCKLINEAR (1 << 5) #define TEGRA_DC_EXT_FLIP_FLAG_SCAN_COLUMN (1 << 6) struct tegra_dc_ext_flip_windowattr { @@ -111,8 +112,11 @@ struct tegra_dc_ext_flip_windowattr { __u32 buff_id_v; __u32 flags; __u8 global_alpha; /* requires TEGRA_DC_EXT_FLIP_FLAG_GLOBAL_ALPHA */ + /* log2(blockheight) for blocklinear format */ + __u8 block_height_log2; + /* Leave some wiggle room for future expansion */ - __u8 pad1[3]; + __u8 pad1[2]; __u32 pad2[4]; }; @@ -371,6 +375,7 @@ struct tegra_dc_ext_control_event_bandwidth { }; #define TEGRA_DC_EXT_CAPABILITIES_CURSOR_MODE (1 << 0) +#define TEGRA_DC_EXT_CAPABILITIES_BLOCKLINEAR (1 << 1) struct tegra_dc_ext_control_capabilities { __u32 caps; /* Leave some wiggle room for future expansion */ |