tegra: 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
Simon Ser 2021-10-03 19:53:07 +02:00
parent bf23fe37be
commit 751752d264
1 changed files with 1 additions and 5 deletions

View File

@ -38,15 +38,11 @@
static void drm_tegra_bo_free(struct drm_tegra_bo *bo)
{
struct drm_tegra *drm = bo->drm;
struct drm_gem_close args;
if (bo->map)
munmap(bo->map, bo->size);
memset(&args, 0, sizeof(args));
args.handle = bo->handle;
drmIoctl(drm->fd, DRM_IOCTL_GEM_CLOSE, &args);
drmCloseBufferHandle(drm->fd, bo->handle);
free(bo);
}