aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunita Nadampalli2013-09-13 06:05:29 -0500
committerSunita Nadampalli2013-09-13 06:05:29 -0500
commite6859266dde6d2c5a85b43fd1ca27ce093b93eb8 (patch)
tree76e5e158b6016e57a26f00421c49fa8b39f301fd /memplugin.h
parent71a368d4d01d0dd7bd80f1189fe205f4645fd320 (diff)
downloadrepo-libdce-e6859266dde6d2c5a85b43fd1ca27ce093b93eb8.tar.gz
repo-libdce-e6859266dde6d2c5a85b43fd1ca27ce093b93eb8.tar.xz
repo-libdce-e6859266dde6d2c5a85b43fd1ca27ce093b93eb8.zip
[LIBDCE] update memplugin headers and apis
memheader and memplugin apis are extended to meet the requirements for mem allocations/free/share for all OSes. Change-Id: Ide911d1654ccd0807ace37de9576299cbb860d07 Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Diffstat (limited to 'memplugin.h')
-rw-r--r--memplugin.h36
1 files changed, 19 insertions, 17 deletions
diff --git a/memplugin.h b/memplugin.h
index bd09a8b..1a4a8aa 100644
--- a/memplugin.h
+++ b/memplugin.h
@@ -42,6 +42,7 @@
42#include <xf86drm.h> 42#include <xf86drm.h>
43#include <omap_drm.h> 43#include <omap_drm.h>
44#include <omap_drmif.h> 44#include <omap_drmif.h>
45#define DEFAULT_REGION MEM_TILER_1D
45#endif /* BUILDOS_LINUX */ 46#endif /* BUILDOS_LINUX */
46 47
47 48
@@ -50,6 +51,7 @@
50#include <tilermem.h> 51#include <tilermem.h>
51#include <SharedMemoryAllocatorUsr.h> 52#include <SharedMemoryAllocatorUsr.h>
52#include <memmgr.h> 53#include <memmgr.h>
54#define DEFAULT_REGION MEM_TILER_1D
53#endif /* BUILDOS_QNX */ 55#endif /* BUILDOS_QNX */
54 56
55 57
@@ -65,21 +67,23 @@
65/* or IH264DEC_Params */ 67/* or IH264DEC_Params */
66typedef struct MemHeader { 68typedef struct MemHeader {
67 uint32_t size; 69 uint32_t size;
68 void *ptr; 70 void *ptr; /* vptr/handle for mpu access */
69#if defined(BUILDOS_LINUX) 71 int32_t dma_buf_fd; /* shared dma buf fd */
70 int32_t dma_buf_fd; 72 uint32_t region; /* mem region the buffer allocated from */
71#endif 73 /* internal meta data for the buffer */
74 uint32_t offset; /* offset for the actual data with in the buffer */
75 int32_t map_fd; /* mmapped fd */
76 void * handle; /*custom handle for the HLOS memallocator*/
72} MemHeader; 77} MemHeader;
73 78
74 79typedef enum MemoryRegion {
75typedef enum mem_type { 80 MEM_TILER_1D,
76 TILER_1D_BUFFER, 81 MEM_TILER8_2D,
77 TILER8_2D_BUFFER, 82 MEM_TILER16_2D,
78 TILER16_2D_BUFFER, 83 MEM_CARVEOUT,
79 SHARED_MEMORY_BUFFER, 84 MEM_SHARED,
80 MEM_MAX 85 MEM_MAX
81} mem_type; 86} MemRegion;
82
83 87
84/* DCE Error Types */ 88/* DCE Error Types */
85typedef enum mem_error_status { 89typedef enum mem_error_status {
@@ -90,11 +94,9 @@ typedef enum mem_error_status {
90 MEM_EOUT_OF_SYSTEM_MEMORY = -4 94 MEM_EOUT_OF_SYSTEM_MEMORY = -4
91} mem_error_status; 95} mem_error_status;
92 96
93void *memplugin_alloc(int sz, int height, mem_type memory_type); 97void *memplugin_alloc(int sz, int height, MemRegion region, int align, int flags);
94 98void memplugin_free(void *ptr);
95void memplugin_free(void *ptr, mem_type memory_type); 99int32_t memplugin_share(void *ptr);
96
97int memplugin_share(void *ptr);
98 100
99#endif /* __MEMPLUGIN_H__ */ 101#endif /* __MEMPLUGIN_H__ */
100 102