summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_gtt.c
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2013-07-06 01:41:05 +0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-07-09 00:04:35 +0400
commitedd41a870f11157a1bf4c15080421f9770912e09 (patch)
treeb10fa24ba754b5fd0c1a514bec60915c60252e6d /drivers/gpu/drm/i915/i915_gem_gtt.c
parentf343c5f6477354967ee1e331a68a56b9fece2f36 (diff)
downloadlinux-edd41a870f11157a1bf4c15080421f9770912e09.tar.xz
drm/i915: Kill obj->gtt_offset
With the getters in place from the previous patch this members serves no purpose other than saving one spare pointer chase, which will be killed in the next patch anyway. Moving to VMAs, this members adds unnecessary confusion since an object may exist at different offsets in different VMs. v2: Properly preserve the stolen offset. This code is a bit hacky but it all goes away when we embed the drm_mm_node and removes the need for the incorrect patch I submitted previously: "Use gtt_space->start for stolen reservation" Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_gtt.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_gtt.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 6f0a4c09e26a..76a4095452c7 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -629,18 +629,20 @@ void i915_gem_setup_global_gtt(struct drm_device *dev,
/* Mark any preallocated objects as occupied */
list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
+ uintptr_t offset = (uintptr_t) obj->gtt_space;
int ret;
- DRM_DEBUG_KMS("reserving preallocated space: %x + %zx\n",
- obj->gtt_offset, obj->base.size);
+ DRM_DEBUG_KMS("reserving preallocated space: %lx + %zx\n",
+ offset, obj->base.size);
- BUG_ON(obj->gtt_space != I915_GTT_RESERVED);
+ BUG_ON((offset & I915_GTT_RESERVED) != 0);
+ offset &= ~I915_GTT_RESERVED;
obj->gtt_space = kzalloc(sizeof(*obj->gtt_space), GFP_KERNEL);
if (!obj->gtt_space) {
- DRM_ERROR("Failed to preserve object at offset %x\n",
- obj->gtt_offset);
+ DRM_ERROR("Failed to preserve object at offset %lx\n",
+ offset);
continue;
}
- obj->gtt_space->start = obj->gtt_offset;
+ obj->gtt_space->start = (unsigned long)offset;
obj->gtt_space->size = obj->base.size;
ret = drm_mm_reserve_node(&dev_priv->mm.gtt_space,
obj->gtt_space);