[Intel-gfx] [PATCH 2/4] drm/i915: OR in the COMMAND read domain for the batch buffer.
Eric Anholt
eric at anholt.net
Fri May 22 00:02:53 CEST 2009
On Thu, 2009-05-21 at 11:55 +0100, Chris Wilson wrote:
> On Thu, 2009-05-21 at 11:08 +0100, Chris Wilson wrote:
> > 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).
>
> At the last minute I decided to move the check and thus broke it. This
> is the version that was actually tested...
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c
> b/drivers/gpu/drm/i915/i915_gem.c
> index 0c5d8dd..39ed939 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3325,8 +3325,12 @@ i915_gem_execbuffer(struct drm_device *dev, void
> *data,
>
> /* Set the pending read domains for the batch buffer to COMMAND
> */
> batch_obj = object_list[args->buffer_count-1];
> - batch_obj->pending_read_domains = I915_GEM_DOMAIN_COMMAND;
> - batch_obj->pending_write_domain = 0;
> + if (batch_obj->pending_write_domain) {
> + 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 */
> exec_offset = exec_list[args->buffer_count - 1].offset;
This looks like a good series. I'll get it into -next.
--
Eric Anholt
eric at anholt.net eric.anholt at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090521/b77a47ec/attachment.sig>
More information about the Intel-gfx
mailing list