int ast_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev, uint32_t handle, uint64_t *offset) { struct drm_gem_object *obj; int ret; struct ast_bo *bo; mutex_lock(&dev->struct_mutex); obj = drm_gem_object_lookup(dev, file, handle); if (obj == NULL) { ret = -ENOENT; goto out_unlock; } bo = gem_to_ast_bo(obj); *offset = ast_bo_mmap_offset(bo); drm_gem_object_unreference(obj); ret = 0; out_unlock: mutex_unlock(&dev->struct_mutex); return ret; }
void ast_gem_free_object(struct drm_gem_object *obj) { struct ast_bo *ast_bo = gem_to_ast_bo(obj); if (!ast_bo) return; ast_bo_unref(&ast_bo); }
int ast_dumb_mmap_offset(struct drm_file *file, struct drm_device *dev, uint32_t handle, uint64_t *offset) { struct drm_gem_object *obj; struct ast_bo *bo; obj = drm_gem_object_lookup(dev, file, handle); if (obj == NULL) return -ENOENT; bo = gem_to_ast_bo(obj); *offset = ast_bo_mmap_offset(bo); drm_gem_object_unreference_unlocked(obj); return 0; }