Lines Matching refs:fd

30     RK_U32 fd;  member
61 RK_S32 fd; member
80 int fd; in try_open_path() local
83 fd = open(buf, O_RDONLY | O_CLOEXEC); // read permission is enough in try_open_path()
85 dma_heap_dbg_ops("open dma_heap %-24s -> fd %d\n", name, fd); in try_open_path()
87 return fd; in try_open_path()
102 if (src->fd > 0) { in try_flip_flag()
104 dst->fd = mpp_dup(src->fd); in try_flip_flag()
111 return dst->fd > 0 ? MPP_OK : MPP_NOK; in try_flip_flag()
127 if (info->fd > 0) in dma_heap_init()
130 info->fd = try_open_path(info->name); in dma_heap_init()
131 if (info->fd <= 0) in dma_heap_init()
140 if (info->fd > 0) in dma_heap_init()
168 if (info->fd > 0) { in dma_heap_deinit()
169 close(info->fd); in dma_heap_deinit()
170 info->fd = -1; in dma_heap_deinit()
175 static int dma_heap_alloc(int fd, size_t len, RK_S32 *dmabuf_fd, RK_U32 flags) in dma_heap_alloc() argument
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()
215 if (info->fd <= 0) { in os_allocator_dma_heap_open()
227 p->device = info->fd; in os_allocator_dma_heap_open()
248 ret = dma_heap_alloc(p->device, info->size, (RK_S32 *)&info->fd, p->flags); in os_allocator_dma_heap_alloc()
250 dma_heap_dbg_ops("dev %d alloc %3d size %d\n", p->device, info->fd, info->size); in os_allocator_dma_heap_alloc()
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()
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()
292 data->fd, data->size, data->ptr); in os_allocator_dma_heap_free()
298 close(data->fd); in os_allocator_dma_heap_free()
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()
342 data->fd, data->ptr, in os_allocator_dma_heap_mmap()