Re: [PATCH 07/16] drm/i915: Inline check required for object syncing prior to execbuf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 29, 2015 at 03:03:43PM +0100, Tvrtko Ursulin wrote:
> 
> Hi,
> 
> On 04/27/2015 01:41 PM, Chris Wilson wrote:
> >This trims a little overhead from the common case of not needing to
> >synchronize between rings.
> >
> >v2: execlists is special and likes to duplicate code.
> >
> >Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> >---
> >  drivers/gpu/drm/i915/i915_gem_execbuffer.c | 10 +++++++---
> >  drivers/gpu/drm/i915/intel_lrc.c           |  9 ++++++---
> >  2 files changed, 13 insertions(+), 6 deletions(-)
> >
> >diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> >index 45d74da7f6c4..4fe09568089b 100644
> >--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> >+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
> >@@ -889,6 +889,7 @@ static int
> >  i915_gem_execbuffer_move_to_gpu(struct intel_engine_cs *ring,
> >  				struct list_head *vmas)
> >  {
> >+	const unsigned other_rings = ~intel_ring_flag(ring);
> >  	struct i915_vma *vma;
> >  	uint32_t flush_domains = 0;
> >  	bool flush_chipset = false;
> >@@ -896,9 +897,12 @@ i915_gem_execbuffer_move_to_gpu(struct intel_engine_cs *ring,
> >
> >  	list_for_each_entry(vma, vmas, exec_list) {
> >  		struct drm_i915_gem_object *obj = vma->obj;
> >-		ret = i915_gem_object_sync(obj, ring);
> >-		if (ret)
> >-			return ret;
> >+
> >+		if (obj->active & other_rings) {
> >+			ret = i915_gem_object_sync(obj, ring);
> >+			if (ret)
> >+				return ret;
> >+		}
> 
> Just to avoid bailing out near the top of i915_gem_object_sync?

Yes. Every function where we spend more time in the push/pop preamble
than in the body is a function I don't want to call :)
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx





[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux