summaryrefslogtreecommitdiffstats
path: root/tiler/tiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'tiler/tiler.h')
-rw-r--r--tiler/tiler.h105
1 files changed, 105 insertions, 0 deletions
diff --git a/tiler/tiler.h b/tiler/tiler.h
new file mode 100644
index 0000000..8358f8d
--- /dev/null
+++ b/tiler/tiler.h
@@ -0,0 +1,105 @@
+/*
+ * tiler.h
+ *
+ * TILER driver support functions for TI OMAP processors.
+ *
+ * Copyright (C) 2009-2011 Texas Instruments, Inc.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _TILER_H_
+#define _TILER_H_
+
+#define TILER_MEM_8BIT 0x60000000
+#define TILER_MEM_16BIT 0x68000000
+#define TILER_MEM_32BIT 0x70000000
+#define TILER_MEM_PAGED 0x78000000
+#define TILER_MEM_END 0x80000000
+
+#define TILER_PAGE 0x1000
+#define TILER_WIDTH 256
+#define TILER_HEIGHT 128
+#define TILER_BLOCK_WIDTH 64
+#define TILER_BLOCK_HEIGHT 64
+#define TILER_LENGTH (TILER_WIDTH * TILER_HEIGHT * TILER_PAGE)
+
+#define TILER_DEVICE_PATH "/dev/tiler"
+#define TILER_MAX_NUM_BLOCKS 16
+
+enum tiler_fmt {
+ TILFMT_MIN = -2,
+ TILFMT_INVALID = -2,
+ TILFMT_NONE = -1,
+ TILFMT_8BIT = 0,
+ TILFMT_16BIT = 1,
+ TILFMT_32BIT = 2,
+ TILFMT_PAGE = 3,
+ TILFMT_MAX = 3,
+ TILFMT_8AND16 = 4,
+};
+
+struct area {
+ uint16_t width;
+ uint16_t height;
+};
+
+struct tiler_block_info {
+ enum tiler_fmt fmt;
+ union {
+ struct area area;
+ uint32_t len;
+ } dim;
+ uint32_t stride;
+ void *ptr;
+ uint32_t id;
+ uint32_t key;
+ uint32_t group_id;
+ uint32_t ssptr;
+};
+
+struct tiler_buf_info {
+ uint32_t num_blocks;
+ struct tiler_block_info blocks[TILER_MAX_NUM_BLOCKS];
+ uint32_t offset;
+ uint32_t length;
+};
+
+#define TILIOC_GBLK _IOWR('z', 100, struct tiler_block_info)
+#define TILIOC_FBLK _IOW('z', 101, struct tiler_block_info)
+#define TILIOC_GSSP _IOWR('z', 102, uint32_t)
+#define TILIOC_MBLK _IOWR('z', 103, struct tiler_block_info)
+#define TILIOC_UMBLK _IOW('z', 104, struct tiler_block_info)
+#define TILIOC_QBUF _IOWR('z', 105, struct tiler_buf_info)
+#define TILIOC_RBUF _IOWR('z', 106, struct tiler_buf_info)
+#define TILIOC_URBUF _IOWR('z', 107, struct tiler_buf_info)
+#define TILIOC_QBLK _IOWR('z', 108, struct tiler_block_info)
+#define TILIOC_PRBLK _IOW('z', 109, struct tiler_block_info)
+#define TILIOC_URBLK _IOW('z', 110, uint32_t)
+
+#endif