Lines Matching refs:data
152 struct drm_mode_destroy_dumb data = { in drm_free() local
155 return drm_ioctl(fd, DRM_IOCTL_MODE_DESTROY_DUMB, &data); in drm_free()
251 static MPP_RET os_allocator_drm_import(void *ctx, MppBufferInfo *data) in os_allocator_drm_import() argument
254 RK_S32 fd_ext = data->fd; in os_allocator_drm_import()
261 data->fd = mpp_dup(fd_ext); in os_allocator_drm_import()
262 data->ptr = NULL; in os_allocator_drm_import()
264 if (data->fd <= 0) { in os_allocator_drm_import()
265 mpp_err_f(" fd dup return invalid fd %d\n", data->fd); in os_allocator_drm_import()
269 drm_dbg_func("leave dev %d fd %d -> %d\n", p->drm_device, fd_ext, data->fd); in os_allocator_drm_import()
274 static MPP_RET os_allocator_drm_free(void *ctx, MppBufferInfo *data) in os_allocator_drm_free() argument
286 data->hnd, data->ptr, data->fd, data->size); in os_allocator_drm_free()
288 if (data->ptr) { in os_allocator_drm_free()
289 munmap(data->ptr, data->size); in os_allocator_drm_free()
290 data->ptr = NULL; in os_allocator_drm_free()
293 if (data->fd > 0) { in os_allocator_drm_free()
294 close(data->fd); in os_allocator_drm_free()
295 data->fd = -1; in os_allocator_drm_free()
297 mpp_err_f("can not close invalid fd %d\n", data->fd); in os_allocator_drm_free()
324 static MPP_RET os_allocator_drm_mmap(void *ctx, MppBufferInfo *data) in os_allocator_drm_mmap() argument
337 if (NULL == data->ptr) { in os_allocator_drm_mmap()
340 if (fcntl(data->fd, F_GETFL) & O_RDWR) in os_allocator_drm_mmap()
343 data->ptr = mmap(NULL, data->size, flags, MAP_SHARED, data->fd, 0); in os_allocator_drm_mmap()
344 if (data->ptr == MAP_FAILED) { in os_allocator_drm_mmap()
346 data->ptr = NULL; in os_allocator_drm_mmap()
351 data->fd, data->ptr, in os_allocator_drm_mmap()