summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorKevin E Martin <kem@kem.org>2001-03-14 22:22:50 +0000
committerKevin E Martin <kem@kem.org>2001-03-14 22:22:50 +0000
commit74e19a40187ac3b5907922e5dc01418135a5794b (patch)
tree6623cfe435730e28c25829ebc6931e46871b81ce /libdrm
parente2b2bffc6b25361b2f09afc5a28030645440cd03 (diff)
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drm.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 73a083e3..a640d598 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -513,6 +513,16 @@ int drmAddMap(int fd,
return 0;
}
+int drmRmMap(int fd, drmHandle handle)
+{
+ drm_map_t map;
+
+ map.handle = (void *)handle;
+
+ if(ioctl(fd, DRM_IOCTL_RM_MAP, &map)) return -errno;
+ return 0;
+}
+
int drmAddBufs(int fd, int count, int size, drmBufDescFlags flags,
int agp_offset)
{
@@ -1088,6 +1098,29 @@ void *drmGetContextTag(int fd, drmContext context)
return value;
}
+int drmAddContextPrivateMapping(int fd, drmContext ctx_id, drmHandle handle)
+{
+ drm_ctx_priv_map_t map;
+
+ map.ctx_id = ctx_id;
+ map.handle = (void *)handle;
+
+ if (ioctl(fd, DRM_IOCTL_SET_SAREA_CTX, &map)) return -errno;
+ return 0;
+}
+
+int drmGetContextPrivateMapping(int fd, drmContext ctx_id, drmHandlePtr handle)
+{
+ drm_ctx_priv_map_t map;
+
+ map.ctx_id = ctx_id;
+
+ if (ioctl(fd, DRM_IOCTL_GET_SAREA_CTX, &map)) return -errno;
+ if (handle) *handle = (drmHandle)map.handle;
+
+ return 0;
+}
+
int drmGetMap(int fd, int idx, drmHandle *offset, drmSize *size,
drmMapType *type, drmMapFlags *flags, drmHandle *handle,
int *mtrr)