Lines Matching refs:data
61 struct ion_allocation_data data = { in ion_alloc() local
72 ret = ion_ioctl(fd, ION_IOC_ALLOC, &data); in ion_alloc()
74 *handle = data.handle; in ion_alloc()
85 struct ion_handle_data data = { in ion_free() local
90 ret = ion_ioctl(fd, ION_IOC_FREE, &data); in ion_free()
98 struct ion_fd_data data = { in ion_map_fd() local
105 ret = ion_ioctl(fd, ION_IOC_MAP, &data); in ion_map_fd()
109 *map_fd = data.fd; in ion_map_fd()
377 static MPP_RET allocator_ion_import(void *ctx, MppBufferInfo *data) in allocator_ion_import() argument
384 ctx, p->ion_device, data->fd, data->size); in allocator_ion_import()
386 fd_data.fd = data->fd; in allocator_ion_import()
389 mpp_err_f("fd %d import failed for %s\n", data->fd, strerror(errno)); in allocator_ion_import()
393 data->hnd = (void *)(intptr_t)fd_data.handle; in allocator_ion_import()
394 ret = ion_map_fd(p->ion_device, fd_data.handle, &data->fd); in allocator_ion_import()
395 data->ptr = NULL; in allocator_ion_import()
397 ion_dbg_func("leave: ret %d handle %d\n", ret, data->hnd); in allocator_ion_import()
401 static MPP_RET allocator_ion_mmap(void *ctx, MppBufferInfo *data) in allocator_ion_mmap() argument
410 ion_dbg_func("enter: ctx %p fd %d size %d\n", ctx, data->fd, data->size); in allocator_ion_mmap()
412 if (NULL == data->ptr) in allocator_ion_mmap()
413 ret = ion_mmap(data->fd, data->size, PROT_READ | PROT_WRITE, in allocator_ion_mmap()
414 MAP_SHARED, 0, &data->ptr); in allocator_ion_mmap()
416 ion_dbg_func("leave: ret %d ptr %p\n", ret, data->ptr); in allocator_ion_mmap()
420 static MPP_RET allocator_ion_free(void *ctx, MppBufferInfo *data) in allocator_ion_free() argument
429 ctx, data->fd, data->ptr, data->size); in allocator_ion_free()
432 if (data->ptr) { in allocator_ion_free()
433 munmap(data->ptr, data->size); in allocator_ion_free()
434 data->ptr = NULL; in allocator_ion_free()
437 if (data->fd > 0) { in allocator_ion_free()
438 close(data->fd); in allocator_ion_free()
439 data->fd = -1; in allocator_ion_free()
442 if (data->hnd) { in allocator_ion_free()
443 ion_free(p->ion_device, (ion_user_handle_t)((intptr_t)data->hnd)); in allocator_ion_free()
444 data->hnd = NULL; in allocator_ion_free()