intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Kumar Valsan, Prathap" <prathap.kumar.valsan@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 32/39] drm/i915: Allow vma binding to occur asynchronously
Date: Mon, 5 Aug 2019 16:35:26 -0400	[thread overview]
Message-ID: <20190805203526.GA3842@intel.com> (raw)
In-Reply-To: <20190614071023.17929-33-chris@chris-wilson.co.uk>

On Fri, Jun 14, 2019 at 08:10:16AM +0100, Chris Wilson wrote:
> If we let pages be allocated asynchronously, we also then want to push
> the binding process into an asynchronous task. Make it so, utilising the
> recent improvements to fence error tracking and struct_mutex reduction.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
[snip]
>  /**
>   * i915_vma_bind - Sets up PTEs for an VMA in it's corresponding address space.
>   * @vma: VMA to map
> @@ -300,17 +412,12 @@ int i915_vma_bind(struct i915_vma *vma, enum i915_cache_level cache_level,
>  	u32 vma_flags;
>  	int ret;
>  
> +	GEM_BUG_ON(!flags);
>  	GEM_BUG_ON(!drm_mm_node_allocated(&vma->node));
>  	GEM_BUG_ON(vma->size > vma->node.size);
> -
> -	if (GEM_DEBUG_WARN_ON(range_overflows(vma->node.start,
> -					      vma->node.size,
> -					      vma->vm->total)))
> -		return -ENODEV;
> -
> -	if (GEM_DEBUG_WARN_ON(!flags))
> -		return -EINVAL;
> -
> +	GEM_BUG_ON(range_overflows(vma->node.start,
> +				   vma->node.size,
> +				   vma->vm->total));
>  	bind_flags = 0;
>  	if (flags & PIN_GLOBAL)
>  		bind_flags |= I915_VMA_GLOBAL_BIND;
> @@ -325,16 +432,20 @@ int i915_vma_bind(struct i915_vma *vma, enum i915_cache_level cache_level,
>  	if (bind_flags == 0)
>  		return 0;
>  
> -	GEM_BUG_ON(!vma->pages);
> +	if ((bind_flags & ~vma_flags) & I915_VMA_LOCAL_BIND)
> +		bind_flags |= I915_VMA_ALLOC_BIND;
>  
>  	trace_i915_vma_bind(vma, bind_flags);
> -	ret = vma->ops->bind_vma(vma, cache_level, bind_flags);
> +	if (bind_flags & I915_VMA_ALLOC_BIND)
> +		ret = queue_async_bind(vma, cache_level, bind_flags);
> +	else
> +		ret = __vma_bind(vma, cache_level, bind_flags);
>  	if (ret)
>  		return ret;

i915_vma_remove() expects vma has pages set. This is no longer true with
async get pages. Shouldn't the clear_pages() called iff pages are set? 

[snip]
>  static inline void i915_vma_unlock(struct i915_vma *vma)
>  {
>  	reservation_object_unlock(vma->resv);
> diff --git a/drivers/gpu/drm/i915/selftests/i915_vma.c b/drivers/gpu/drm/i915/selftests/i915_vma.c
> index 56c1cac368cc..30b831408b7b 100644
> --- a/drivers/gpu/drm/i915/selftests/i915_vma.c
> +++ b/drivers/gpu/drm/i915/selftests/i915_vma.c
> @@ -204,8 +204,10 @@ static int igt_vma_create(void *arg)
>  		mock_context_close(ctx);
>  	}
>  
> -	list_for_each_entry_safe(obj, on, &objects, st_link)
> +	list_for_each_entry_safe(obj, on, &objects, st_link) {
> +		i915_gem_object_wait(obj, I915_WAIT_ALL, MAX_SCHEDULE_TIMEOUT);
>  		i915_gem_object_put(obj);
> +	}
>  	return err;
>  }
>  
> -- 
> 2.20.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-08-05 20:19 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-14  7:09 WIP glance towards struct_mutex removal Chris Wilson
2019-06-14  7:09 ` [PATCH 01/39] drm/i915: Discard some redundant cache domain flushes Chris Wilson
2019-06-14  9:12   ` Matthew Auld
2019-06-14  7:09 ` [PATCH 02/39] drm/i915: Refine i915_reset.lock_map Chris Wilson
2019-06-14 14:10   ` Mika Kuoppala
2019-06-14 14:17     ` Chris Wilson
2019-06-14  7:09 ` [PATCH 03/39] drm/i915: Avoid tainting i915_gem_park() with wakeref.lock Chris Wilson
2019-06-14 14:47   ` Mika Kuoppala
2019-06-14 14:51     ` Chris Wilson
2019-06-14  7:09 ` [PATCH 04/39] drm/i915: Enable refcount debugging for default debug levels Chris Wilson
2019-06-14 15:11   ` Mika Kuoppala
2019-06-14 15:11   ` Mika Kuoppala
2019-06-14  7:09 ` [PATCH 05/39] drm/i915: Keep contexts pinned until after the next kernel context switch Chris Wilson
2019-06-14  7:09 ` [PATCH 06/39] drm/i915: Stop retiring along engine Chris Wilson
2019-06-14  7:09 ` [PATCH 07/39] drm/i915: Replace engine->timeline with a plain list Chris Wilson
2019-06-14  7:09 ` [PATCH 08/39] drm/i915: Flush the execution-callbacks on retiring Chris Wilson
2019-06-14  7:09 ` [PATCH 09/39] drm/i915/execlists: Preempt-to-busy Chris Wilson
2019-06-14  7:09 ` [PATCH 10/39] drm/i915/execlists: Minimalistic timeslicing Chris Wilson
2019-06-14  7:09 ` [PATCH 11/39] drm/i915/execlists: Force preemption Chris Wilson
2019-06-14  7:09 ` [PATCH 12/39] dma-fence: Propagate errors to dma-fence-array container Chris Wilson
2019-06-14  7:09 ` [PATCH 13/39] dma-fence: Report the composite sync_file status Chris Wilson
2019-06-14  7:09 ` [PATCH 14/39] dma-fence: Refactor signaling for manual invocation Chris Wilson
2019-06-14  7:09 ` [PATCH 15/39] dma-fence: Always execute signal callbacks Chris Wilson
2019-06-14  7:10 ` [PATCH 16/39] drm/i915: Execute signal callbacks from no-op i915_request_wait Chris Wilson
2019-06-14 10:45   ` Tvrtko Ursulin
2019-06-14  7:10 ` [PATCH 17/39] drm/i915: Make the semaphore saturation mask global Chris Wilson
2019-06-14  7:10 ` [PATCH 18/39] drm/i915: Throw away the active object retirement complexity Chris Wilson
2019-06-14  7:10 ` [PATCH 19/39] drm/i915: Provide an i915_active.acquire callback Chris Wilson
2019-06-14  7:10 ` [PATCH 20/39] drm/i915: Push the i915_active.retire into a worker Chris Wilson
2019-06-14  7:10 ` [PATCH 21/39] drm/i915/overlay: Switch to using i915_active tracking Chris Wilson
2019-06-14  7:10 ` [PATCH 22/39] drm/i915: Forgo last_fence active request tracking Chris Wilson
2019-06-14  7:10 ` [PATCH 23/39] drm/i915: Extract intel_frontbuffer active tracking Chris Wilson
2019-06-14  7:10 ` [PATCH 24/39] drm/i915: Coordinate i915_active with its own mutex Chris Wilson
2019-06-14  7:10 ` [PATCH 25/39] drm/i915: Track ggtt fence reservations under " Chris Wilson
2019-06-14  7:10 ` [PATCH 26/39] drm/i915: Only track bound elements of the GTT Chris Wilson
2019-06-14  7:10 ` [PATCH 27/39] drm/i915: Explicitly cleanup initial_plane_config Chris Wilson
2019-06-14  7:10 ` [PATCH 28/39] initial-plane-vma Chris Wilson
2019-06-14  7:10 ` [PATCH 29/39] drm/i915: Make i915_vma track its own kref Chris Wilson
2019-06-14 11:15   ` Matthew Auld
2019-06-14 11:18     ` Chris Wilson
2019-06-14  7:10 ` [PATCH 30/39] drm/i915: Propagate fence errors Chris Wilson
2019-06-14  7:10 ` [PATCH 31/39] drm/i915: Allow page pinning to be in the background Chris Wilson
2019-06-14  7:10 ` [PATCH 32/39] drm/i915: Allow vma binding to occur asynchronously Chris Wilson
2019-08-05 20:35   ` Kumar Valsan, Prathap [this message]
2019-06-14  7:10 ` [PATCH 33/39] revoke-fence Chris Wilson
2019-06-14  7:10 ` [PATCH 34/39] drm/i915: Use vm->mutex for serialising GTT insertion Chris Wilson
2019-06-14 19:14   ` Matthew Auld
2019-06-14 19:20     ` Chris Wilson
2019-06-14  7:10 ` [PATCH 35/39] drm/i915: Pin pages before waiting Chris Wilson
2019-06-14 19:53   ` Matthew Auld
2019-06-14 19:58     ` Chris Wilson
2019-06-14 20:13       ` Chris Wilson
2019-06-14 20:18         ` Matthew Auld
2019-06-14  7:10 ` [PATCH 36/39] drm/i915: Use reservation_object to coordinate userptr get_pages() Chris Wilson
2019-08-07 20:49   ` Daniel Vetter
2019-08-08  7:30     ` [Intel-gfx] " Daniel Vetter
2019-06-14  7:10 ` [PATCH 37/39] drm/i915: Use forced preemptions in preference over hangcheck Chris Wilson
2019-06-14  7:10 ` [PATCH 38/39] drm/i915: Remove logical HW ID Chris Wilson
2019-06-14  7:10 ` [PATCH 39/39] active-rings Chris Wilson
2019-06-14  7:22 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/39] drm/i915: Discard some redundant cache domain flushes Patchwork
2019-06-14  7:35 ` ✗ Fi.CI.SPARSE: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190805203526.GA3842@intel.com \
    --to=prathap.kumar.valsan@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).