aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunita Nadampalli2014-11-17 14:00:48 -0600
committerSunita Nadampalli2014-11-17 14:00:48 -0600
commit02907e6c0b25f3abbb90f762681a9b13abe29477 (patch)
tree83183f247f564db4507bc8a29b800676f8073cd3 /memplugin.h
parent5693201c37da9070928a751d79cbfed6bb8dd051 (diff)
downloadrepo-libdce-02907e6c0b25f3abbb90f762681a9b13abe29477.tar.gz
repo-libdce-02907e6c0b25f3abbb90f762681a9b13abe29477.tar.xz
repo-libdce-02907e6c0b25f3abbb90f762681a9b13abe29477.zip
libdce[Android]: Added support for DRM based Android memplugin
This patch adds memplugin implementation for GEM allocator and dce buffer locking via MmRPC for Android builds. Android memplugin implement memplugin interface for buffers with and without memheaders. This implementation is for DRM/GEM buffer allocations. And libdce_android implements GEM buffer registration and unregistration with MmRPC. Change-Id: Ie72c988a37f987446f7d7c1d97225295de73d305 Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Diffstat (limited to 'memplugin.h')
-rw-r--r--memplugin.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/memplugin.h b/memplugin.h
index 0c98b4b..0073cf1 100644
--- a/memplugin.h
+++ b/memplugin.h
@@ -83,6 +83,7 @@ typedef enum MemoryRegion {
83 MEM_TILER16_2D, 83 MEM_TILER16_2D,
84 MEM_CARVEOUT, 84 MEM_CARVEOUT,
85 MEM_SHARED, 85 MEM_SHARED,
86 MEM_GRALLOC,
86 MEM_MAX 87 MEM_MAX
87} MemRegion; 88} MemRegion;
88 89
@@ -99,12 +100,34 @@ typedef enum mem_error_status {
99 MEM_EINVALID_INPUT = -1, 100 MEM_EINVALID_INPUT = -1,
100 MEM_EOUT_OF_TILER_MEMORY = -2, 101 MEM_EOUT_OF_TILER_MEMORY = -2,
101 MEM_EOUT_OF_SHMEMORY = -3, 102 MEM_EOUT_OF_SHMEMORY = -3,
102 MEM_EOUT_OF_SYSTEM_MEMORY = -4 103 MEM_EOUT_OF_SYSTEM_MEMORY = -4,
104 MEM_EOPEN_FAILURE = -5,
103} mem_error_status; 105} mem_error_status;
104 106
105void *memplugin_alloc(int sz, int height, MemRegion region, int align, int flags); 107void *memplugin_alloc(int sz, int height, MemRegion region, int align, int flags);
106void memplugin_free(void *ptr); 108void memplugin_free(void *ptr);
107int32_t memplugin_share(void *ptr); 109int32_t memplugin_share(void *ptr);
108 110
111#ifdef BUILDOS_ANDROID
112typedef enum BufAccessMode {
113 MemAccess_8Bit,
114 MemAccess_16Bit,
115 MemAccess_32Bit
116}BufAccessMode;
117
118typedef struct Mem_2DParams {
119 uint32_t nHeight;
120 uint32_t nWidth;
121 uint32_t nStride;
122 BufAccessMode eAccessMode;
123}Mem_2DParams;
124
125void *memplugin_alloc_noheader(MemHeader *memHdr, int sz, int height, MemRegion region, int align, int flags);
126void memplugin_free_noheader(MemHeader *memHdr);
127
128int memplugin_open();
129int memplugin_close();
130#endif
131
109#endif /* __MEMPLUGIN_H__ */ 132#endif /* __MEMPLUGIN_H__ */
110 133