tegra: use drmCloseBufferHandle
authorSimon Ser <contact@emersion.fr>
Sun, 3 Oct 2021 17:53:07 +0000 (19:53 +0200)
committerSimon Ser <contact@emersion.fr>
Wed, 6 Oct 2021 07:03:21 +0000 (09:03 +0200)
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>
tegra/tegra.c

index cf00a3c..420b171 100644 (file)
 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);
 }