From cd42c053c598d720c12ca8d2e13715ee490f6717 Mon Sep 17 00:00:00 2001 From: Robert Morell Date: Fri, 18 Feb 2011 15:51:38 -0800 Subject: video: tegra: Add cursor support to dc extensions This change adds full support for specify the cursor image and manipulating its position. bug 818525 Original-Change-Id: I101a951aff358b0ac0998afc6fe5f6c5c4d37c64 Signed-off-by: Robert Morell Reviewed-on: http://git-master/r/40518 Reviewed-by: Varun Colbert Tested-by: Varun Colbert Rebase-Id: R93f0c68a14e4419f200a77d48a17eb8862f2e4e1 --- include/video/tegra_dc_ext.h | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) (limited to 'include/video') diff --git a/include/video/tegra_dc_ext.h b/include/video/tegra_dc_ext.h index 346825aa4147..f9935ef8c04f 100644 --- a/include/video/tegra_dc_ext.h +++ b/include/video/tegra_dc_ext.h @@ -89,6 +89,42 @@ struct tegra_dc_ext_flip { __u32 post_syncpt_val; }; +/* + * Cursor image format: + * - Tegra hardware supports two colors: foreground and background, specified + * by the client in RGB8. + * - The image should be specified as two 1bpp bitmaps immediately following + * each other in memory. Each pixel in the final cursor will be constructed + * from the bitmaps with the following logic: + * bitmap1 bitmap0 + * (mask) (color) + * 1 0 transparent + * 1 1 inverted + * 0 0 background color + * 0 1 foreground color + * - Exactly one of the SIZE flags must be specified. + */ +#define TEGRA_DC_EXT_CURSOR_IMAGE_FLAGS_SIZE_32x32 1 +#define TEGRA_DC_EXT_CURSOR_IMAGE_FLAGS_SIZE_64x64 2 +struct tegra_dc_ext_cursor_image { + struct { + __u8 r; + __u8 g; + __u8 b; + } foreground, background; + __u32 buff_id; + __u32 flags; +}; + +/* Possible flags for struct nvdc_cursor's flags field */ +#define TEGRA_DC_EXT_CURSOR_FLAGS_VISIBLE 1 + +struct tegra_dc_ext_cursor { + __s16 x; + __s16 y; + __u32 flags; +}; + #define TEGRA_DC_EXT_SET_NVMAP_FD \ _IOW('D', 0x00, __s32) @@ -100,5 +136,13 @@ struct tegra_dc_ext_flip { #define TEGRA_DC_EXT_FLIP \ _IOWR('D', 0x03, struct tegra_dc_ext_flip) +#define TEGRA_DC_EXT_GET_CURSOR \ + _IO('D', 0x04) +#define TEGRA_DC_EXT_PUT_CURSOR \ + _IO('D', 0x05) +#define TEGRA_DC_EXT_SET_CURSOR_IMAGE \ + _IOW('D', 0x06, struct tegra_dc_ext_cursor_image) +#define TEGRA_DC_EXT_SET_CURSOR \ + _IOW('D', 0x07, struct tegra_dc_ext_cursor) #endif /* __TEGRA_DC_EXT_H */ -- cgit v1.2.3