On Tue, 14 Feb 2012 22:09:15 +0100, Ben Widawsky <ben at bwidawsk.net> wrote: > Extend the flag parameter to support the context id (from the create > IOCTL) so that userspace can associate a context with the batchbuffer. > > Signed-off-by: Ben Widawsky <ben at bwidawsk.net> > @@ -1270,6 +1272,14 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, > > exec_start = batch_obj->gtt_offset + args->batch_start_offset; > exec_len = args->batch_len; > + > + if (ring->last_context) { > + context = i915_get_context(file, ctx_id); Add code here to handle context == NULL and erroring out, since i915_switch_context() just BUG_ONs. > + ret = i915_switch_context(ring, context, &seqno); > + if (ret) > + goto err; > + } > + -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20120215/0397359b/attachment.pgp>