summaryrefslogtreecommitdiff
path: root/libdrm
diff options
context:
space:
mode:
authorKevin E Martin <kem@kem.org>2001-04-05 22:16:12 +0000
committerKevin E Martin <kem@kem.org>2001-04-05 22:16:12 +0000
commit5d6ddbca26d695561fb1d08d798a0cc254b805e7 (patch)
treeaf1e718f29c3dfca0e577bb0f4d211c6432600e6 /libdrm
parenta15b9dec3cfed3ce36826faf8c7d76284b0527a8 (diff)
Merged ati-pcigart-1-0-0
Diffstat (limited to 'libdrm')
-rw-r--r--libdrm/xf86drm.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index 82675881..bb719edb 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -67,11 +67,6 @@ extern int xf86RemoveSIGIOHandler(int fd);
# endif
#endif
-#ifdef __alpha__
-extern unsigned long _bus_base(void);
-#define BUS_BASE _bus_base()
-#endif
-
/* Not all systems have MAP_FAILED defined */
#ifndef MAP_FAILED
#define MAP_FAILED ((void *)-1)
@@ -490,11 +485,6 @@ int drmAddMap(int fd,
drm_map_t map;
map.offset = offset;
-#ifdef __alpha__
- /* Make sure we add the bus_base to all but shm */
- if (type != DRM_SHM)
- map.offset += BUS_BASE;
-#endif
map.size = size;
map.handle = 0;
map.type = type;
@@ -998,6 +988,28 @@ unsigned int drmAgpDeviceId(int fd)
return i.id_device;
}
+int drmScatterGatherAlloc(int fd, unsigned long size, unsigned long *handle)
+{
+ drm_scatter_gather_t sg;
+
+ *handle = 0;
+ sg.size = size;
+ sg.handle = 0;
+ if (ioctl(fd, DRM_IOCTL_SG_ALLOC, &sg)) return -errno;
+ *handle = sg.handle;
+ return 0;
+}
+
+int drmScatterGatherFree(int fd, unsigned long handle)
+{
+ drm_scatter_gather_t sg;
+
+ sg.size = 0;
+ sg.handle = handle;
+ if (ioctl(fd, DRM_IOCTL_SG_FREE, &sg)) return -errno;
+ return 0;
+}
+
int drmError(int err, const char *label)
{
switch (err) {