drm/i915: Embed drm_mm_node in i915 gem obj
authorBen Widawsky <ben@bwidawsk.net>
Fri, 5 Jul 2013 21:41:06 +0000 (14:41 -0700)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 8 Jul 2013 20:04:36 +0000 (22:04 +0200)
commitc6cfb325677ea6305fb19acf3a4d14ea267f923e
tree8660aa760fa3f510e58e93c0a6096b267f4c03ee
parentedd41a870f11157a1bf4c15080421f9770912e09
drm/i915: Embed drm_mm_node in i915 gem obj

Embedding the node in the obj is more natural in the transition to VMAs
which will also have embedded nodes. This change also helps transition
away from put_block to remove node.

Though it's quite an uncommon occurrence, it's somewhat convenient to not
fail at bind time because we cannot allocate the node. Though in
practice there are other allocations (like the request structure) which
would probably make this point not terribly useful.

Quoting Daniel:
Note that the only difference between put_block and remove_node is
that the former fills up the preallocation cache. Which we don't need
anyway and hence is just wasted space.

v2: Clean up the stolen preallocation code.
Rebased on the reserve_node patches
renames ggtt_ stuff to gtt_ stuff
WARN_ON if the object is already bound (which doesn't mean it's in the
bound list, tricky)

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_evict.c
drivers/gpu/drm/i915/i915_gem_gtt.c
drivers/gpu/drm/i915/i915_gem_stolen.c