Commit 5f26a2c7 authored by Chris Wilson's avatar Chris Wilson Committed by Eric Anholt

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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarEric Anholt <eric@anholt.net>
parent 83d60795
...@@ -3369,8 +3369,12 @@ i915_gem_execbuffer(struct drm_device *dev, void *data, ...@@ -3369,8 +3369,12 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
/* Set the pending read domains for the batch buffer to COMMAND */ /* Set the pending read domains for the batch buffer to COMMAND */
batch_obj = object_list[args->buffer_count-1]; batch_obj = object_list[args->buffer_count-1];
batch_obj->pending_read_domains = I915_GEM_DOMAIN_COMMAND; if (batch_obj->pending_write_domain) {
batch_obj->pending_write_domain = 0; DRM_ERROR("Attempting to use self-modifying batch buffer\n");
ret = -EINVAL;
goto err;
}
batch_obj->pending_read_domains |= I915_GEM_DOMAIN_COMMAND;
/* Sanity check the batch buffer, prior to moving objects */ /* Sanity check the batch buffer, prior to moving objects */
exec_offset = exec_list[args->buffer_count - 1].offset; exec_offset = exec_list[args->buffer_count - 1].offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment