Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915: Serialise execbuf operation after a dma-buf reservation object

Now that we can wait upon fences before emitting the request, it becomes
trivial to wait upon any implicit fence provided by the dma-buf
reservation object.

To protect against failure, we force any asynchronous waits on a foreign
fence to timeout after 10s - so that a stall in another driver does not
permanently cripple ourselves. Still unpleasant though!

Testcase: igt/prime_vgem/fence-wait
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: John Harrison <john.c.harrison@intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20160909131201.16673-21-chris@chris-wilson.co.uk

+11
+11
drivers/gpu/drm/i915/i915_gem_execbuffer.c
··· 1131 1131 1132 1132 list_for_each_entry(vma, vmas, exec_list) { 1133 1133 struct drm_i915_gem_object *obj = vma->obj; 1134 + struct reservation_object *resv; 1134 1135 1135 1136 if (obj->flags & other_rings) { 1136 1137 ret = i915_gem_request_await_object 1137 1138 (req, obj, obj->base.pending_write_domain); 1138 1139 if (ret) 1140 + return ret; 1141 + } 1142 + 1143 + resv = i915_gem_object_get_dmabuf_resv(obj); 1144 + if (resv) { 1145 + ret = i915_sw_fence_await_reservation 1146 + (&req->submit, resv, &i915_fence_ops, 1147 + obj->base.pending_write_domain, 10*HZ, 1148 + GFP_KERNEL | __GFP_NOWARN); 1149 + if (ret < 0) 1139 1150 return ret; 1140 1151 } 1141 1152