etnaviv: use drmCloseBufferHandle
Instead of manually calling drmIoctl, use the equivalent function from libdrm core. Signed-off-by: Simon Ser <contact@emersion.fr> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>main
parent
80f8fbd488
commit
bd1f320bc0
|
@ -48,12 +48,8 @@ drm_private void bo_del(struct etna_bo *bo)
|
|||
drmHashDelete(bo->dev->name_table, bo->name);
|
||||
|
||||
if (bo->handle) {
|
||||
struct drm_gem_close req = {
|
||||
.handle = bo->handle,
|
||||
};
|
||||
|
||||
drmHashDelete(bo->dev->handle_table, bo->handle);
|
||||
drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
||||
drmCloseBufferHandle(bo->dev->fd, bo->handle);
|
||||
}
|
||||
|
||||
free(bo);
|
||||
|
@ -82,12 +78,7 @@ static struct etna_bo *bo_from_handle(struct etna_device *dev,
|
|||
struct etna_bo *bo = calloc(sizeof(*bo), 1);
|
||||
|
||||
if (!bo) {
|
||||
struct drm_gem_close req = {
|
||||
.handle = handle,
|
||||
};
|
||||
|
||||
drmIoctl(dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
||||
|
||||
drmCloseBufferHandle(dev->fd, handle);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue