diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-02-11 14:26:44 +0000 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2009-03-10 20:22:24 -0700 |
commit | 9b2412f9ad0a3913baa40c270d6e1fa3c6d50067 (patch) | |
tree | 88f0382840856fc1d58aa12bcbfb2d1ec8eb7ae0 /drivers | |
parent | 040aefa263aa9cd7bd5df50586c35e1e15e77f84 (diff) | |
download | linux-9b2412f9ad0a3913baa40c270d6e1fa3c6d50067.tar.gz linux-9b2412f9ad0a3913baa40c270d6e1fa3c6d50067.tar.bz2 linux-9b2412f9ad0a3913baa40c270d6e1fa3c6d50067.zip |
drm/i915: First recheck for an empty fence register.
If we wait upon a request and successfully unbind a buffer occupying a
fence register, then that slot will be freed and cause a NULL derefrence
upon rescanning.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index c94069b28a47..6497c1ad02d3 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1580,6 +1580,7 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj, bool write) } /* First try to find a free reg */ +try_again: for (i = dev_priv->fence_reg_start; i < dev_priv->num_fence_regs; i++) { reg = &dev_priv->fence_regs[i]; if (!reg->obj) @@ -1591,7 +1592,6 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj, bool write) struct drm_i915_gem_object *old_obj_priv = NULL; loff_t offset; -try_again: /* Could try to use LRU here instead... */ for (i = dev_priv->fence_reg_start; i < dev_priv->num_fence_regs; i++) { |