summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/i915_gem_stolen.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_stolen.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_stolen.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem_stolen.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
index 4e6dbbb47dfe..559f75450d35 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -389,10 +389,13 @@ i915_gem_object_create_stolen_for_preallocated(struct drm_device *dev,
DRM_DEBUG_KMS("failed to allocate stolen GTT space\n");
goto free_out;
}
- } else
- obj->gtt_space = I915_GTT_RESERVED;
+ } else {
+ if (WARN_ON(gtt_offset & ~PAGE_MASK))
+ DRM_DEBUG_KMS("Cannot preserve non page aligned offset\n");
+ obj->gtt_space =
+ (struct drm_mm_node *)((uintptr_t)(I915_GTT_RESERVED | gtt_offset));
+ }
- obj->gtt_offset = gtt_offset;
obj->has_global_gtt_mapping = 1;
list_add_tail(&obj->global_list, &dev_priv->mm.bound_list);