diff options
author | Rik Faith <faith@alephnull.com> | 2000-01-07 13:24:39 +0000 |
---|---|---|
committer | Rik Faith <faith@alephnull.com> | 2000-01-07 13:24:39 +0000 |
commit | 19e480b61040093c55fcbdb0bbff6d833635d11b (patch) | |
tree | 27e4f2b22159808392425034844f21750afed376 /libdrm | |
parent | c8884f95620b1467dcd18e32d03ee0db2e38bcb9 (diff) |
Change drmAgpAlloc and drmAgpBind prototypes to match other, similar,
prototypes; thereby allowing better error information to be returned.
Diffstat (limited to 'libdrm')
-rw-r--r-- | libdrm/xf86drm.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 926e80bc..25ab1d62 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -766,14 +766,16 @@ int drmAgpEnable(int fd, unsigned long mode) return 0; } -unsigned long drmAgpAlloc(int fd, unsigned long size) +int drmAgpAlloc(int fd, unsigned long size, unsigned long *handle) { drm_agp_buffer_t b; + *handle = 0; b.size = size; b.handle = 0; - if (ioctl(fd, DRM_IOCTL_AGP_ALLOC, &b)) return 0; - return b.handle; + if (ioctl(fd, DRM_IOCTL_AGP_ALLOC, &b)) return -errno; + *handle = b.handle; + return 0; } int drmAgpFree(int fd, unsigned long handle) @@ -786,12 +788,12 @@ int drmAgpFree(int fd, unsigned long handle) return 0; } -unsigned long drmAgpBind(int fd, unsigned long handle, unsigned long offset) +int drmAgpBind(int fd, unsigned long handle, unsigned long offset) { drm_agp_binding_t b; - b.handle = handle; - b.offset = offset; + b.handle = handle; + b.offset = offset; if (ioctl(fd, DRM_IOCTL_AGP_BIND, &b)) return -errno; return 0; } |