diff options
Diffstat (limited to 'armada_bufmgr.c')
-rw-r--r-- | armada_bufmgr.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/armada_bufmgr.c b/armada_bufmgr.c index 2364051..6b9e667 100644 --- a/armada_bufmgr.c +++ b/armada_bufmgr.c @@ -3,6 +3,7 @@ #include <stdlib.h> #include <string.h> #include <errno.h> +#include <sys/fcntl.h> #include <sys/mman.h> #include <time.h> @@ -452,6 +453,17 @@ int drm_armada_bo_flink(struct drm_armada_bo *dbo, uint32_t *name) return 0; } +int drm_armada_bo_to_fd(struct drm_armada_bo *dbo, int *prime_fd) +{ + struct armada_bo *bo = to_armada_bo(dbo); + int fd = bo->mgr->fd; + + if (drmPrimeHandleToFD(fd, bo->bo.handle, DRM_CLOEXEC, prime_fd)) + return -1; + + return 0; +} + int drm_armada_bo_map(struct drm_armada_bo *dbo) { struct armada_bo *bo = to_armada_bo(dbo); |