Lines Matching refs:info
43 static MPP_RET allocator_ext_dma_alloc(void *ctx, MppBufferInfo *info) in allocator_ext_dma_alloc() argument
45 if (!ctx || !info) { in allocator_ext_dma_alloc()
53 static MPP_RET allocator_ext_dma_free(void *ctx, MppBufferInfo *info) in allocator_ext_dma_free() argument
55 if (!ctx || !info) { in allocator_ext_dma_free()
63 static MPP_RET allocator_ext_dma_import(void *ctx, MppBufferInfo *info) in allocator_ext_dma_import() argument
67 mpp_assert(info->size); in allocator_ext_dma_import()
69 if (info->ptr) { in allocator_ext_dma_import()
74 return ((info->fd < 0) ? MPP_ERR_VALUE : MPP_OK); in allocator_ext_dma_import()
77 static MPP_RET allocator_ext_dma_mmap(void *ctx, MppBufferInfo *info) in allocator_ext_dma_mmap() argument
83 mpp_assert(info->size); in allocator_ext_dma_mmap()
84 mpp_assert(info->fd >= 0); in allocator_ext_dma_mmap()
86 if (info->ptr) in allocator_ext_dma_mmap()
94 if (fcntl(info->fd, F_GETFL) & O_RDWR) in allocator_ext_dma_mmap()
97 ptr = mmap(NULL, info->size, flags, MAP_SHARED, info->fd, offset); in allocator_ext_dma_mmap()
101 info->ptr = ptr; in allocator_ext_dma_mmap()
106 static MPP_RET allocator_ext_dma_release(void *ctx, MppBufferInfo *info) in allocator_ext_dma_release() argument
109 mpp_assert(info->size); in allocator_ext_dma_release()
111 if (info->ptr) in allocator_ext_dma_release()
112 munmap(info->ptr, info->size); in allocator_ext_dma_release()
114 info->ptr = NULL; in allocator_ext_dma_release()
115 info->hnd = NULL; in allocator_ext_dma_release()
116 info->fd = -1; in allocator_ext_dma_release()
117 info->size = 0; in allocator_ext_dma_release()