From bf23fe37bef8a5c78724f6e4fd96901632bf9373 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sun, 3 Oct 2021 19:51:57 +0200 Subject: [PATCH] omap: use drmCloseBufferHandle Instead of manually calling drmIoctl, use the equivalent function from libdrm core. Signed-off-by: Simon Ser Reviewed-by: Emil Velikov --- omap/omap_drm.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/omap/omap_drm.c b/omap/omap_drm.c index ffacea6..aa27366 100644 --- a/omap/omap_drm.c +++ b/omap/omap_drm.c @@ -174,10 +174,7 @@ static struct omap_bo * bo_from_handle(struct omap_device *dev, { struct omap_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; } bo->dev = omap_device_ref(dev); @@ -365,12 +362,9 @@ drm_public void omap_bo_del(struct omap_bo *bo) } if (bo->handle) { - struct drm_gem_close req = { - .handle = bo->handle, - }; pthread_mutex_lock(&table_lock); drmHashDelete(bo->dev->handle_table, bo->handle); - drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req); + drmCloseBufferHandle(bo->dev->fd, bo->handle); pthread_mutex_unlock(&table_lock); } -- 2.7.4