summaryrefslogtreecommitdiff
path: root/sys/dev/pci/drm/i915/i915_gem.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/pci/drm/i915/i915_gem.c')
-rw-r--r--sys/dev/pci/drm/i915/i915_gem.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/sys/dev/pci/drm/i915/i915_gem.c b/sys/dev/pci/drm/i915/i915_gem.c
index dc24f6bac43..baa7f56795e 100644
--- a/sys/dev/pci/drm/i915/i915_gem.c
+++ b/sys/dev/pci/drm/i915/i915_gem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i915_gem.c,v 1.65 2014/01/21 08:29:32 kettenis Exp $ */
+/* $OpenBSD: i915_gem.c,v 1.66 2014/01/21 08:57:22 kettenis Exp $ */
/*
* Copyright (c) 2008-2009 Owain G. Ainsworth <oga@openbsd.org>
*
@@ -1851,10 +1851,8 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj)
#ifdef __linux__
sg_free_table(obj->pages);
- kfree(obj->pages);
-#else
- drm_free(obj->pages);
#endif
+ kfree(obj->pages);
}
static int
@@ -2042,7 +2040,7 @@ err_pages:
return PTR_ERR(page);
#else
err_pages:
- drm_free(st);
+ free(st, M_DRM);
return -ENOMEM;
#endif
}
@@ -2214,7 +2212,7 @@ i915_add_request(struct intel_ring_buffer *ring,
if (ret)
return ret;
- request = drm_alloc(sizeof(*request));
+ request = kmalloc(sizeof(*request), GFP_KERNEL);
if (request == NULL)
return -ENOMEM;
@@ -2228,7 +2226,7 @@ i915_add_request(struct intel_ring_buffer *ring,
ret = ring->add_request(ring);
if (ret) {
- drm_free(request);
+ kfree(request);
return ret;
}
@@ -2297,7 +2295,7 @@ static void i915_gem_reset_ring_lists(struct drm_i915_private *dev_priv,
list_del(&request->list);
i915_gem_request_remove_from_client(request);
- drm_free(request);
+ kfree(request);
}
while (!list_empty(&ring->active_list)) {
@@ -2391,7 +2389,7 @@ i915_gem_retire_requests_ring(struct intel_ring_buffer *ring)
list_del(&request->list);
i915_gem_request_remove_from_client(request);
- drm_free(request);
+ kfree(request);
}
/* Move any buffers on the active list that are no longer referenced
@@ -3119,7 +3117,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
i915_gem_object_pin_pages(obj);
- node = malloc(sizeof(*node), M_DRM, M_NOWAIT | M_ZERO);
+ node = kzalloc(sizeof(*node), GFP_KERNEL);
if (node == NULL) {
i915_gem_object_unpin_pages(obj);
/* XXX Until we've hooked up the shrinking functions. */
@@ -3146,7 +3144,7 @@ i915_gem_object_bind_to_gtt(struct drm_i915_gem_object *obj,
i915_gem_object_unpin_pages(obj);
/* XXX Until we've hooked up the shrinking functions. */
i915_gem_object_put_pages(obj);
- free(node, M_DRM);
+ kfree(node);
return ret;
}
if (WARN_ON(!i915_gem_valid_gtt_space(dev, node, obj->cache_level))) {
@@ -3978,7 +3976,7 @@ void i915_gem_free_object(struct drm_gem_object *gem_obj)
drm_gem_object_release(&obj->base);
i915_gem_info_remove_obj(dev_priv, obj->base.size);
- drm_free(obj->bit_17);
+ kfree(obj->bit_17);
pool_put(&dev->objpl, obj);
}
@@ -4386,7 +4384,7 @@ static int i915_gem_init_phys_object(struct drm_device *dev,
if (dev_priv->mm.phys_objs[id - 1] || !size)
return 0;
- phys_obj = drm_alloc(sizeof(struct drm_i915_gem_phys_object));
+ phys_obj = kzalloc(sizeof(struct drm_i915_gem_phys_object), GFP_KERNEL);
if (!phys_obj)
return -ENOMEM;
@@ -4402,7 +4400,7 @@ static int i915_gem_init_phys_object(struct drm_device *dev,
return 0;
kfree_obj:
- drm_free(phys_obj);
+ kfree(phys_obj);
return ret;
}