summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-11-14 16:27:47 -0800
committerDave Airlie <airlied@redhat.com>2008-12-04 11:21:48 +1000
commitb670d8158283c35842ae1c650f75c375d8710607 (patch)
tree5acd986f51f15b50f401826e5ff53345a86194a8 /drivers/gpu
parentce44b0ea3dc04236d852d78a06f850d1f7b03f3d (diff)
drm/i915: If interrupted while setting object domains, still emit the flush.
Otherwise, we would leave the objects in an inconsistent state, such as write_domain == 0 but on the flushing list. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 9fd28ebe0aa3..3fe108b7e2fa 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1880,8 +1880,20 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
ret = i915_gem_object_set_domain(obj,
obj->pending_read_domains,
obj->pending_write_domain);
- if (ret)
+ if (ret) {
+ /* As we've partially updated domains on our buffers,
+ * we have to emit the flush we've accumulated
+ * before exiting, or we'll have broken the
+ * active/flushing/inactive invariants.
+ *
+ * We'll potentially have some things marked as
+ * being in write domains that they actually aren't,
+ * but that should be merely a minor performance loss.
+ */
+ flush_domains = i915_gem_dev_set_domain(dev);
+ (void)i915_add_request(dev, flush_domains);
goto err;
+ }
}
i915_verify_inactive(dev, __FILE__, __LINE__);