mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 05:50:12 +01:00
omap: 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>
This commit is contained in:
parent
53ef4b37a1
commit
bf23fe37be
1 changed files with 2 additions and 8 deletions
|
|
@ -174,10 +174,7 @@ static struct omap_bo * bo_from_handle(struct omap_device *dev,
|
||||||
{
|
{
|
||||||
struct omap_bo *bo = calloc(sizeof(*bo), 1);
|
struct omap_bo *bo = calloc(sizeof(*bo), 1);
|
||||||
if (!bo) {
|
if (!bo) {
|
||||||
struct drm_gem_close req = {
|
drmCloseBufferHandle(dev->fd, handle);
|
||||||
.handle = handle,
|
|
||||||
};
|
|
||||||
drmIoctl(dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
bo->dev = omap_device_ref(dev);
|
bo->dev = omap_device_ref(dev);
|
||||||
|
|
@ -365,12 +362,9 @@ drm_public void omap_bo_del(struct omap_bo *bo)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bo->handle) {
|
if (bo->handle) {
|
||||||
struct drm_gem_close req = {
|
|
||||||
.handle = bo->handle,
|
|
||||||
};
|
|
||||||
pthread_mutex_lock(&table_lock);
|
pthread_mutex_lock(&table_lock);
|
||||||
drmHashDelete(bo->dev->handle_table, bo->handle);
|
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);
|
pthread_mutex_unlock(&table_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue