Lines Matching refs:data

177     struct dma_heap_allocation_data data;  in dma_heap_alloc()  local
180 memset(&data, 0, sizeof(data)); in dma_heap_alloc()
181 data.len = len; in dma_heap_alloc()
182 data.fd_flags = O_RDWR | O_CLOEXEC; in dma_heap_alloc()
183 data.heap_flags = 0; // heap_flags should be set to 0 in dma_heap_alloc()
185 ret = ioctl(fd, DMA_HEAP_IOCTL_ALLOC, &data); in dma_heap_alloc()
191 dma_heap_dbg_ioctl("ioctl alloc get fd %d\n", data.fd); in dma_heap_alloc()
193 *dmabuf_fd = data.fd; in dma_heap_alloc()
261 static MPP_RET os_allocator_dma_heap_import(void *ctx, MppBufferInfo *data) in os_allocator_dma_heap_import() argument
264 RK_S32 fd_ext = data->fd; in os_allocator_dma_heap_import()
269 data->fd = mpp_dup(fd_ext); in os_allocator_dma_heap_import()
270 data->ptr = NULL; in os_allocator_dma_heap_import()
272 dma_heap_dbg_ops("dev %d import %3d -> %3d\n", p->device, fd_ext, data->fd); in os_allocator_dma_heap_import()
274 mpp_assert(data->fd > 0); in os_allocator_dma_heap_import()
279 static MPP_RET os_allocator_dma_heap_free(void *ctx, MppBufferInfo *data) in os_allocator_dma_heap_free() argument
292 data->fd, data->size, data->ptr); in os_allocator_dma_heap_free()
294 if (data->ptr) { in os_allocator_dma_heap_free()
295 munmap(data->ptr, data->size); in os_allocator_dma_heap_free()
296 data->ptr = NULL; in os_allocator_dma_heap_free()
298 close(data->fd); in os_allocator_dma_heap_free()
315 static MPP_RET os_allocator_dma_heap_mmap(void *ctx, MppBufferInfo *data) in os_allocator_dma_heap_mmap() argument
328 if (NULL == data->ptr) { in os_allocator_dma_heap_mmap()
331 if (fcntl(data->fd, F_GETFL) & O_RDWR) in os_allocator_dma_heap_mmap()
334 data->ptr = mmap(NULL, data->size, flags, MAP_SHARED, data->fd, 0); in os_allocator_dma_heap_mmap()
335 if (data->ptr == MAP_FAILED) { in os_allocator_dma_heap_mmap()
337 data->ptr = NULL; in os_allocator_dma_heap_mmap()
342 data->fd, data->ptr, in os_allocator_dma_heap_mmap()