aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_bo.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 /linux-core/drm_bo.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 'linux-core/drm_bo.c')
-rw-r--r--linux-core/drm_bo.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c
index 7dd9856d..e2f460ed 100644
--- a/linux-core/drm_bo.c
+++ b/linux-core/drm_bo.c
@@ -1620,7 +1620,10 @@ int drm_buffer_object_create(struct drm_device *dev,
INIT_LIST_HEAD(&bo->vma_list);
#endif
bo->dev = dev;
- bo->type = type;
+ if (buffer_start != 0)
+ bo->type = drm_bo_type_user;
+ else
+ bo->type = type;
bo->num_pages = num_pages;
bo->mem.mem_type = DRM_BO_MEM_LOCAL;
bo->mem.num_pages = bo->num_pages;
@@ -1783,8 +1786,8 @@ int drm_bo_create_ioctl(struct drm_device *dev, void *data, struct drm_file *fil
struct drm_buffer_object *entry;
int ret = 0;
- DRM_DEBUG("drm_bo_create_ioctl: %dkb, %dkb align, %d type\n",
- (int)(req->size / 1024), req->page_alignment * 4, req->type);
+ DRM_DEBUG("drm_bo_create_ioctl: %dkb, %dkb align\n",
+ (int)(req->size / 1024), req->page_alignment * 4);
if (!dev->bm.initialized) {
DRM_ERROR("Buffer object manager is not initialized.\n");
@@ -1792,7 +1795,7 @@ int drm_bo_create_ioctl(struct drm_device *dev, void *data, struct drm_file *fil
}
ret = drm_buffer_object_create(file_priv->head->dev,
- req->size, req->type, req->mask,
+ req->size, drm_bo_type_dc, req->mask,
req->hint, req->page_alignment,
req->buffer_start, &entry);
if (ret)