aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorDima Zavin <dima@android.com>2011-06-24 13:33:00 -0700
committerDima Zavin <dima@android.com>2011-06-24 13:33:00 -0700
commitbd47783bb233d659b668d4154737bb7857e2fb8a (patch)
tree82808bd2624944e14dcf6bc7b6d207d0e8c214db /arch/arm
parentc6b8854fb58cf1e5fa3dff3d30337a3e0711911e (diff)
parent2bf390d33eae05a6a8c44970852b15760d169103 (diff)
downloadkernel_samsung_tuna-bd47783bb233d659b668d4154737bb7857e2fb8a.zip
kernel_samsung_tuna-bd47783bb233d659b668d4154737bb7857e2fb8a.tar.gz
kernel_samsung_tuna-bd47783bb233d659b668d4154737bb7857e2fb8a.tar.bz2
Merge remote branch 'omap/linux-omap-mm-3.0' into linux-omap-3.0
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-omap2/include/mach/tiler.h118
1 files changed, 92 insertions, 26 deletions
diff --git a/arch/arm/mach-omap2/include/mach/tiler.h b/arch/arm/mach-omap2/include/mach/tiler.h
index bbb4108..1bdc6bd 100644
--- a/arch/arm/mach-omap2/include/mach/tiler.h
+++ b/arch/arm/mach-omap2/include/mach/tiler.h
@@ -41,6 +41,7 @@
#define TILER_H
#include <linux/mm.h>
+#include <linux/scatterlist.h>
/*
* ----------------------------- API Definitions -----------------------------
@@ -139,13 +140,10 @@ u32 tiler_virt2phys(u32 usr);
* must be 0) with the tiler block information. 'height' must be 1
* for 1D block.
* @param fmt TILER block format
- * @param align block alignment (default: normally PAGE_SIZE)
- * @param offs block offset
*
* @return error status
*/
-s32 tiler_alloc(struct tiler_block_t *blk, enum tiler_fmt fmt, u32 align,
- u32 offs);
+s32 tiler_alloc(struct tiler_block_t *blk, enum tiler_fmt fmt);
/**
* Reserves a 1D or 2D TILER block area and memory for a set process and group
@@ -155,15 +153,13 @@ s32 tiler_alloc(struct tiler_block_t *blk, enum tiler_fmt fmt, u32 align,
* must be 0) with the tiler block information. 'height' must be 1
* for 1D block.
* @param fmt TILER block format
- * @param align block alignment (default: normally PAGE_SIZE)
- * @param offs block offset
* @param gid group ID
* @param pid process ID
*
* @return error status
*/
-s32 tiler_allocx(struct tiler_block_t *blk, enum tiler_fmt fmt, u32 align,
- u32 offs, u32 gid, pid_t pid);
+s32 tiler_allocx(struct tiler_block_t *blk, enum tiler_fmt fmt,
+ u32 gid, pid_t pid);
/**
* Mmaps a portion of a tiler block to a virtual address. Use this method in
@@ -259,11 +255,8 @@ void tiler_free(struct tiler_block_t *blk);
* @param fmt TILER format
* @param width block width
* @param height block height (must be 1 for 1D)
- * @param align block alignment (default: PAGE_SIZE)
- * @param offs block offset
*/
-void tiler_reserve(u32 n, enum tiler_fmt fmt, u32 width, u32 height, u32 align,
- u32 offs);
+void tiler_reserve(u32 n, enum tiler_fmt fmt, u32 width, u32 height);
/**
* Reserves tiler area for n identical blocks. Use this method to get optimal
@@ -274,13 +267,11 @@ void tiler_reserve(u32 n, enum tiler_fmt fmt, u32 width, u32 height, u32 align,
* @param fmt TILER bit mode
* @param width block width
* @param height block height (must be 1 for 1D)
- * @param align block alignment (default: PAGE_SIZE)
- * @param offs block offset
* @param gid group ID
* @param pid process ID
*/
void tiler_reservex(u32 n, enum tiler_fmt fmt, u32 width, u32 height,
- u32 align, u32 offs, u32 gid, pid_t pid);
+ u32 gid, pid_t pid);
/**
* Reserves tiler area for n identical NV12 blocks for the current process. Use
@@ -290,10 +281,8 @@ void tiler_reservex(u32 n, enum tiler_fmt fmt, u32 width, u32 height,
* @param n number of identical set of blocks
* @param width block width (Y)
* @param height block height (Y)
- * @param align block alignment (default: PAGE_SIZE)
- * @param offs block offset
*/
-void tiler_reserve_nv12(u32 n, u32 width, u32 height, u32 align, u32 offs);
+void tiler_reserve_nv12(u32 n, u32 width, u32 height);
/**
* Reserves tiler area for n identical NV12 blocks. Use this method to get
@@ -303,13 +292,10 @@ void tiler_reserve_nv12(u32 n, u32 width, u32 height, u32 align, u32 offs);
* @param n number of identical set of blocks
* @param width block width (Y)
* @param height block height (Y)
- * @param align block alignment (default: PAGE_SIZE)
- * @param offs block offset
* @param gid group ID
* @param pid process ID
*/
-void tiler_reservex_nv12(u32 n, u32 width, u32 height, u32 align, u32 offs,
- u32 gid, pid_t pid);
+void tiler_reservex_nv12(u32 n, u32 width, u32 height, u32 gid, pid_t pid);
/**
* Create a view based on a tiler address and width and height
@@ -393,9 +379,91 @@ struct tiler_pa_info {
typedef struct mem_info *tiler_blk_handle;
-/* NOTE: this will take ownership pa->mem (will free it) */
+/**
+ * Allocate a 1D area of container space in the Tiler
+ *
+ * @param pa ptr to tiler_pa_info structure
+ *
+ * @return handle Handle to tiler block information. NULL on error.
+ *
+ * NOTE: this will take ownership pa->mem (will free it)
+ *
+ */
tiler_blk_handle tiler_map_1d_block(struct tiler_pa_info *pa);
-void tiler_free_block(tiler_blk_handle block);
+
+/**
+ * Allocate an area of container space in the Tiler
+ *
+ * @param fmt Tiler bpp mode
+ * @param width Width in pixels
+ * @param height Height in pixels
+ * @param ssptr Value of tiler physical address of allocation
+ *
+ * @return handle Handle to tiler block information. NULL on error.
+ *
+ * NOTE: For 1D allocations, specify the full size in the width field, and
+ * specify a height of 1.
+ */
+tiler_blk_handle tiler_alloc_block_area(enum tiler_fmt fmt, u32 width,
+ u32 height, u32 *ssptr);
+
+/**
+ * Free a reserved area in the Tiler
+ *
+ * @param handle Handle to tiler block information
+ *
+ */
+void tiler_free_block_area(tiler_blk_handle block);
+
+/**
+ * Pins a set of physical pages into the Tiler using the area defined in a
+ * handle
+ *
+ * @param handle Handle to tiler block information
+ * @param sg Scatterlist of physical pages
+ * @param nents Number of entries in scatterlist
+ *
+ * @return error status.
+ */
+s32 tiler_pin_block(tiler_blk_handle handle, struct scatterlist *sg, u32 nents);
+
+/**
+ * Unpins a set of physical pages from the Tiler
+ *
+ * @param handle Handle to tiler block information
+ *
+ */
+void tiler_unpin_block(tiler_blk_handle handle);
+
+
+/**
+ * Gives Tiler physical address for a given tiler_blk_handle
+ *
+ * @param handle Handle to tiler block information
+ *
+ * @return phsyical address. NULL on error.
+ */
+u32 tiler_handle_to_phys(tiler_blk_handle handle);
+
+/**
+ * Gives memory requirements for a given container allocation
+ *
+ * @param fmt Tiler bpp mode
+ * @param width Width in pixels
+ * @param height Height in pixels
+ *
+ * @return Number of pages required. On error, returns 0
+ */
+u32 tiler_memsize(enum tiler_fmt fmt, u32 width, u32 height);
+
+/**
+ * Returns virtual stride of a tiler block
+ *
+ * @param handle Handle to tiler block allocation
+ *
+ * @return Size of virtual stride
+ */
+u32 tiler_block_vstride(tiler_blk_handle handle);
/*
* ---------------------------- IOCTL Definitions ----------------------------
@@ -431,8 +499,6 @@ struct tiler_block_info {
u32 id;
u32 key;
u32 group_id;
- u32 align; /* alignment requirements for ssptr */
- u32 offs; /* offset (ssptr & (align - 1) will equal offs) */
u32 ssptr; /* physical address, may not exposed by default */
};