diff options
author | Eric Anholt <eric@anholt.net> | 2008-11-14 19:27:47 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-12-03 20:21:48 -0500 |
commit | b670d8158283c35842ae1c650f75c375d8710607 (patch) | |
tree | 5acd986f51f15b50f401826e5ff53345a86194a8 | |
parent | ce44b0ea3dc04236d852d78a06f850d1f7b03f3d (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>
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 14 |
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, | |||
1880 | ret = i915_gem_object_set_domain(obj, | 1880 | ret = i915_gem_object_set_domain(obj, |
1881 | obj->pending_read_domains, | 1881 | obj->pending_read_domains, |
1882 | obj->pending_write_domain); | 1882 | obj->pending_write_domain); |
1883 | if (ret) | 1883 | if (ret) { |
1884 | /* As we've partially updated domains on our buffers, | ||
1885 | * we have to emit the flush we've accumulated | ||
1886 | * before exiting, or we'll have broken the | ||
1887 | * active/flushing/inactive invariants. | ||
1888 | * | ||
1889 | * We'll potentially have some things marked as | ||
1890 | * being in write domains that they actually aren't, | ||
1891 | * but that should be merely a minor performance loss. | ||
1892 | */ | ||
1893 | flush_domains = i915_gem_dev_set_domain(dev); | ||
1894 | (void)i915_add_request(dev, flush_domains); | ||
1884 | goto err; | 1895 | goto err; |
1896 | } | ||
1885 | } | 1897 | } |
1886 | 1898 | ||
1887 | i915_verify_inactive(dev, __FILE__, __LINE__); | 1899 | i915_verify_inactive(dev, __FILE__, __LINE__); |