mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 12:50:11 +01:00
freedreno: 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
2fda5f9b0c
commit
7b67fec649
1 changed files with 2 additions and 8 deletions
|
|
@ -62,10 +62,7 @@ static struct fd_bo * bo_from_handle(struct fd_device *dev,
|
||||||
|
|
||||||
bo = dev->funcs->bo_from_handle(dev, size, handle);
|
bo = dev->funcs->bo_from_handle(dev, size, handle);
|
||||||
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 = fd_device_ref(dev);
|
bo->dev = fd_device_ref(dev);
|
||||||
|
|
@ -263,13 +260,10 @@ drm_private void bo_del(struct fd_bo *bo)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (bo->handle) {
|
if (bo->handle) {
|
||||||
struct drm_gem_close req = {
|
|
||||||
.handle = bo->handle,
|
|
||||||
};
|
|
||||||
drmHashDelete(bo->dev->handle_table, bo->handle);
|
drmHashDelete(bo->dev->handle_table, bo->handle);
|
||||||
if (bo->name)
|
if (bo->name)
|
||||||
drmHashDelete(bo->dev->name_table, bo->name);
|
drmHashDelete(bo->dev->name_table, bo->name);
|
||||||
drmIoctl(bo->dev->fd, DRM_IOCTL_GEM_CLOSE, &req);
|
drmCloseBufferHandle(bo->dev->fd, bo->handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
bo->funcs->destroy(bo);
|
bo->funcs->destroy(bo);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue