Commit 264e66b5 authored by Simon Ser's avatar Simon Ser
Browse files

xf86drm: add GEM_CLOSE ioctl wrapper



We have wrappers for PRIME_HANDLE_TO_FD and PRIME_FD_TO_HANDLE,
but not for GEM_CLOSE. Add it so that callers don't need to
manually call drmIoctl.
Signed-off-by: Simon Ser's avatarSimon Ser <contact@emersion.fr>
Reviewed-by: Emil Velikov's avatarEmil Velikov <emil.velikov@collabora.com>
Acked-by: Daniel Stone's avatarDaniel Stone <daniels@collabora.com>
parent 122ff0e8
Pipeline #409795 passed with stages
in 54 seconds
...@@ -22,6 +22,7 @@ drmAuthMagic ...@@ -22,6 +22,7 @@ drmAuthMagic
drmAvailable drmAvailable
drmCheckModesettingSupported drmCheckModesettingSupported
drmClose drmClose
drmCloseBufferHandle
drmCloseOnce drmCloseOnce
drmCommandNone drmCommandNone
drmCommandRead drmCommandRead
......
...@@ -3271,6 +3271,15 @@ drm_public int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle) ...@@ -3271,6 +3271,15 @@ drm_public int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle)
return 0; return 0;
} }
drm_public int drmCloseBufferHandle(int fd, uint32_t handle)
{
struct drm_gem_close args;
memclear(args);
args.handle = handle;
return drmIoctl(fd, DRM_IOCTL_GEM_CLOSE, &args);
}
static char *drmGetMinorNameForFD(int fd, int type) static char *drmGetMinorNameForFD(int fd, int type)
{ {
#ifdef __linux__ #ifdef __linux__
......
...@@ -834,6 +834,8 @@ extern int drmGetNodeTypeFromFd(int fd); ...@@ -834,6 +834,8 @@ extern int drmGetNodeTypeFromFd(int fd);
extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd); extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd);
extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle); extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle);
extern int drmCloseBufferHandle(int fd, uint32_t handle);
extern char *drmGetPrimaryDeviceNameFromFd(int fd); extern char *drmGetPrimaryDeviceNameFromFd(int fd);
extern char *drmGetRenderDeviceNameFromFd(int fd); extern char *drmGetRenderDeviceNameFromFd(int fd);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment