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 <contact@emersion.fr> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Acked-by: Daniel Stone <daniels@collabora.com>main
parent
122ff0e878
commit
264e66b5e9
|
@ -22,6 +22,7 @@ drmAuthMagic
|
|||
drmAvailable
|
||||
drmCheckModesettingSupported
|
||||
drmClose
|
||||
drmCloseBufferHandle
|
||||
drmCloseOnce
|
||||
drmCommandNone
|
||||
drmCommandRead
|
||||
|
|
|
@ -3271,6 +3271,15 @@ drm_public int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle)
|
|||
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)
|
||||
{
|
||||
#ifdef __linux__
|
||||
|
|
|
@ -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 drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle);
|
||||
|
||||
extern int drmCloseBufferHandle(int fd, uint32_t handle);
|
||||
|
||||
extern char *drmGetPrimaryDeviceNameFromFd(int fd);
|
||||
extern char *drmGetRenderDeviceNameFromFd(int fd);
|
||||
|
||||
|
|
Loading…
Reference in New Issue