summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_stolen.c
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2013-07-05 14:41:03 -0700
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-07-08 22:04:33 +0200
commit338710e7aff3428dc8170a03704a8ae981b58dcd (patch)
tree5c95329df3cd1114ddd3f59181f36fc4cbd5ab96 /drivers/gpu/drm/i915/i915_gem_stolen.c
parentb3a070cccb9135f8bec63d9f194ddaa422136fb0 (diff)
drm: Change create block to reserve node
With the previous patch we no longer actually create a node, we simply find the correct hole and occupy it. This very well could have been squashed with the last patch, but since I already had David's review, I figured it's easiest to keep it distinct. Also update the users in i915. Conveniently this is the only user of the interface. CC: David Airlie <airlied@linux.ie> CC: <dri-devel@lists.freedesktop.org> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Acked-by: David Airlie <airlied@linux.ie> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_stolen.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_stolen.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 2746ff2d846a..4e6dbbb47dfe 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -349,8 +349,9 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
if (!stolen)
return NULL;
- ret = drm_mm_create_block(&dev_priv->mm.stolen, stolen, stolen_offset,
- size);
+ stolen->start = stolen_offset;
+ stolen->size = size;
+ ret = drm_mm_reserve_node(&dev_priv->mm.stolen, stolen);
if (ret) {
DRM_DEBUG_KMS("failed to allocate stolen space\n");
kfree(stolen);
@@ -380,9 +381,10 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
goto unref_out;
}
- ret = drm_mm_create_block(&dev_priv->mm.gtt_space,
- obj->gtt_space,
- gtt_offset, size);
+ obj->gtt_space->start = gtt_offset;
+ obj->gtt_space->size = size;
+ ret = drm_mm_reserve_node(&dev_priv->mm.gtt_space,
+ obj->gtt_space);
if (ret) {
DRM_DEBUG_KMS("failed to allocate stolen GTT space\n");
goto free_out;