summaryrefslogtreecommitdiff
path: root/libdrm/xf86drm.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2007-10-09 21:09:30 -0400
committerDave Airlie <airlied@linux.ie>2007-10-16 22:03:05 +1100
commitdccefba71a65566e7e1628b3be67621866000411 (patch)
tree339b8d236f0ebca9e88554042fbc648309bc21bc /libdrm/xf86drm.c
parent440fc5113ef1ffb1a22bff92cf34eaf23896db8d (diff)
Take bo type argument out of the ioctl interface.
The buffer object type is still tracked internally, but it is no longer part of the user space visible ioctl interface. If the bo create ioctl specifies a non-NULL buffer address we assume drm_bo_type_user, otherwise drm_bo_type_dc. Kernel side allocations call drm_buffer_object_create() directly and can still specify drm_bo_type_kernel. Not 100% this makes sense either, but with this patch, the buffer type is no longer exported and we can clean up the internals later on.
Diffstat (limited to 'libdrm/xf86drm.c')
-rw-r--r--libdrm/xf86drm.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index bb2b3abe..c450a985 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -2698,8 +2698,8 @@ static void drmBOCopyReply(const struct drm_bo_info_rep *rep, drmBO *buf)
-int drmBOCreate(int fd, unsigned long start, unsigned long size,
- unsigned pageAlignment, void *user_buffer, drm_bo_type_t type,
+int drmBOCreate(int fd, unsigned long size,
+ unsigned pageAlignment, void *user_buffer,
uint64_t mask,
unsigned hint, drmBO *buf)
{
@@ -2713,23 +2713,11 @@ int drmBOCreate(int fd, unsigned long start, unsigned long size,
req->mask = mask;
req->hint = hint;
req->size = size;
- req->type = type;
req->page_alignment = pageAlignment;
+ req->buffer_start = (unsigned long) user_buffer;
buf->virtual = NULL;
- switch(type) {
- case drm_bo_type_dc:
- req->buffer_start = start;
- break;
- case drm_bo_type_user:
- req->buffer_start = (unsigned long) user_buffer;
- buf->virtual = user_buffer;
- break;
- default:
- return -EINVAL;
- }
-
do {
ret = ioctl(fd, DRM_IOCTL_BO_CREATE, &arg);
} while (ret != 0 && errno == EAGAIN);
@@ -2777,7 +2765,6 @@ int drmBOReference(int fd, unsigned handle, drmBO *buf)
return -errno;
drmBOCopyReply(rep, buf);
- buf->type = drm_bo_type_dc;
buf->mapVirtual = NULL;
buf->mapCount = 0;
buf->virtual = NULL;