summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorOwain Ainsworth2010-02-18 16:33:00 +0100
committerEric Anholt2010-02-22 17:54:42 +0100
commitf590d279eb4978352af163a88b001f156c7147d2 (patch)
treefeee8fcf6dc7444c0ec9c5cc6647150c0abd90d9 /drivers/gpu/drm/i915/i915_gem.c
parentdrm/i915: blow away userspace mappings before fence change (diff)
downloadkernel-qcow2-linux-f590d279eb4978352af163a88b001f156c7147d2.tar.gz
kernel-qcow2-linux-f590d279eb4978352af163a88b001f156c7147d2.tar.xz
kernel-qcow2-linux-f590d279eb4978352af163a88b001f156c7147d2.zip
drm/i915: reduce some of the duplication of tiling checking
i915_gem_object_fenceable was mostly just a repeat of the i915_gem_object_fence_offset_ok, but also checking the size (which was checkecd when we allowed that BO to be tiled in the first place). So instead, export the latter function and use it in place. Signed-Off-By: Owain G. Ainsworth <oga@openbsd.org> Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 7b12604a9eb8..59dcce054d1e 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3253,7 +3253,8 @@ i915_gem_object_pin_and_relocate(struct drm_gem_object *obj,
obj_priv->tiling_mode != I915_TILING_NONE;
/* Check fence reg constraints and rebind if necessary */
- if (need_fence && !i915_obj_fenceable(dev, obj))
+ if (need_fence && !i915_gem_object_fence_offset_ok(obj,
+ obj_priv->tiling_mode))
i915_gem_object_unbind(obj);
/* Choose the GTT offset for our buffer and put it there. */