Re: [Intel-gfx] [PATCH] ctx-sync

2018-06-20 Thread Chris Wilson
As fascinating as this patch is, this isn't the one I meant to send.
Oops,
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] ctx-sync

2018-06-20 Thread Chris Wilson
---
 drivers/gpu/drm/i915/intel_lrc.c | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index dc556595a845..2c310754e1f9 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1780,12 +1780,31 @@ execlists_context_pin(struct intel_engine_cs *engine,
return __execlists_context_pin(engine, ctx, ce);
 }
 
+static int await_context_update(struct i915_request *request)
+{
+   struct i915_vma *vma = request->hw_context->state;
+   struct dma_fence *fence;
+   int err = 0;
+
+   fence = reservation_object_get_excl_rcu(vma->resv);
+   if (fence) {
+   err = i915_request_await_dma_fence(request, fence);
+   dma_fence_put(fence);
+   }
+
+   return err;
+}
+
 static int execlists_request_alloc(struct i915_request *request)
 {
int ret;
 
GEM_BUG_ON(!request->hw_context->pin_count);
 
+   ret = await_context_update(request);
+   if (ret)
+   return ret;
+
/* Flush enough space to reduce the likelihood of waiting after
 * we start building the request - in which case we will just
 * have to repeat work.
-- 
2.18.0.rc2

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH] ctx-sync

2018-06-06 Thread Chris Wilson
Wrong branch,
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH] ctx-sync

2018-06-06 Thread Chris Wilson
---
 drivers/gpu/drm/i915/intel_lrc.c | 19 +++
 1 file changed, 19 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
index b06088bd644c..12db7212d643 100644
--- a/drivers/gpu/drm/i915/intel_lrc.c
+++ b/drivers/gpu/drm/i915/intel_lrc.c
@@ -1777,12 +1777,31 @@ execlists_context_pin(struct intel_engine_cs *engine,
return __execlists_context_pin(engine, ctx, ce);
 }
 
+static int await_context_update(struct i915_request *request)
+{
+   struct i915_vma *vma = request->hw_context->state;
+   struct dma_fence *fence;
+   int err = 0;
+
+   fence = reservation_object_get_excl_rcu(vma->resv);
+   if (fence) {
+   err = i915_request_await_dma_fence(request, fence);
+   dma_fence_put(fence);
+   }
+
+   return err;
+}
+
 static int execlists_request_alloc(struct i915_request *request)
 {
int ret;
 
GEM_BUG_ON(!request->hw_context->pin_count);
 
+   ret = await_context_update(request);
+   if (ret)
+   return ret;
+
/* Flush enough space to reduce the likelihood of waiting after
 * we start building the request - in which case we will just
 * have to repeat work.
-- 
2.17.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx