aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2009-06-06 04:45:58 -0400
committerEric Anholt <eric@anholt.net>2009-06-09 16:54:05 -0400
commit5f26a2c7ad6eba97141e8372f3def282f934b169 (patch)
tree355040e2e6eb308afc3b93e39f3b052b63c4b7bc /drivers
parent83d60795157c83389e6aaa0532d5e19afa976a24 (diff)
drm/i915: OR in the COMMAND read domain for the batch buffer.
The batch buffer may be shared with another read buffer, so we should not ignore any previously set domains, but just or in the command domain (and check that the buffer is not writable). 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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index ac22668b239a..2d705e8a297e 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3369,8 +3369,12 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
3369 3369
3370 /* Set the pending read domains for the batch buffer to COMMAND */ 3370 /* Set the pending read domains for the batch buffer to COMMAND */
3371 batch_obj = object_list[args->buffer_count-1]; 3371 batch_obj = object_list[args->buffer_count-1];
3372 batch_obj->pending_read_domains = I915_GEM_DOMAIN_COMMAND; 3372 if (batch_obj->pending_write_domain) {
3373 batch_obj->pending_write_domain = 0; 3373 DRM_ERROR("Attempting to use self-modifying batch buffer\n");
3374 ret = -EINVAL;
3375 goto err;
3376 }
3377 batch_obj->pending_read_domains |= I915_GEM_DOMAIN_COMMAND;
3374 3378
3375 /* Sanity check the batch buffer, prior to moving objects */ 3379 /* Sanity check the batch buffer, prior to moving objects */
3376 exec_offset = exec_list[args->buffer_count - 1].offset; 3380 exec_offset = exec_list[args->buffer_count - 1].offset;