Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: matthew.auld@intel.com
Subject: Re: [Intel-gfx] [PATCH 2/6] drm/i915: Initialise basic fence before acquiring seqno
Date: Mon, 3 Feb 2020 10:55:52 +0000	[thread overview]
Message-ID: <9ed6606c-650f-3a32-5c85-c0b244ac1ea7@linux.intel.com> (raw)
In-Reply-To: <20200203094152.4150550-2-chris@chris-wilson.co.uk>


On 03/02/2020 09:41, Chris Wilson wrote:
> Inside the intel_timeline_get_seqno(), we currently track the retirement
> of the old cachelines by listening to the new request. This requires
> that the new request is ready to be used and so requires a minimum bit
> of initialisation prior to getting the new seqno.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Matthew Auld <matthew.auld@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_request.c | 21 ++++++++++++++-------
>   1 file changed, 14 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
> index 78a5f5d3c070..f56b046a32de 100644
> --- a/drivers/gpu/drm/i915/i915_request.c
> +++ b/drivers/gpu/drm/i915/i915_request.c
> @@ -595,6 +595,8 @@ static void __i915_request_ctor(void *arg)
>   	i915_sw_fence_init(&rq->submit, submit_notify);
>   	i915_sw_fence_init(&rq->semaphore, semaphore_notify);
>   
> +	dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock, 0, 0);
> +
>   	rq->file_priv = NULL;
>   	rq->capture_list = NULL;
>   
> @@ -653,25 +655,30 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp)
>   		}
>   	}
>   
> -	ret = intel_timeline_get_seqno(tl, rq, &seqno);
> -	if (ret)
> -		goto err_free;
> -
>   	rq->i915 = ce->engine->i915;
>   	rq->context = ce;
>   	rq->engine = ce->engine;
>   	rq->ring = ce->ring;
>   	rq->execution_mask = ce->engine->mask;
>   
> +	kref_init(&rq->fence.refcount);
> +	rq->fence.flags = 0;
> +	rq->fence.error = 0;
> +	INIT_LIST_HEAD(&rq->fence.cb_list);

One of these fields the previous user leaves in a non-empty state?

Regards,

Tvrtko

> +
> +	ret = intel_timeline_get_seqno(tl, rq, &seqno);
> +	if (ret)
> +		goto err_free;
> +
> +	rq->fence.context = tl->fence_context;
> +	rq->fence.seqno = seqno;
> +
>   	RCU_INIT_POINTER(rq->timeline, tl);
>   	RCU_INIT_POINTER(rq->hwsp_cacheline, tl->hwsp_cacheline);
>   	rq->hwsp_seqno = tl->hwsp_seqno;
>   
>   	rq->rcustate = get_state_synchronize_rcu(); /* acts as smp_mb() */
>   
> -	dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock,
> -		       tl->fence_context, seqno);
> -
>   	/* We bump the ref for the fence chain */
>   	i915_sw_fence_reinit(&i915_request_get(rq)->submit);
>   	i915_sw_fence_reinit(&i915_request_get(rq)->semaphore);
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-02-03 10:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-03  9:41 [Intel-gfx] [PATCH 1/6] drm/i915: Hold reference to previous active fence as we queue Chris Wilson
2020-02-03  9:41 ` [Intel-gfx] [PATCH 2/6] drm/i915: Initialise basic fence before acquiring seqno Chris Wilson
2020-02-03 10:55   ` Tvrtko Ursulin [this message]
2020-02-03 10:58     ` Chris Wilson
2020-02-03 11:02       ` Tvrtko Ursulin
2020-02-03  9:41 ` [Intel-gfx] [PATCH 3/6] drm/i915/gt: Warn about the hidden i915_vma_pin in timeline_get_seqno Chris Wilson
2020-02-03  9:41 ` [Intel-gfx] [PATCH 4/6] drm/i915/selftests: Add a simple rollover for the kernel context Chris Wilson
2020-02-03 17:32   ` Matthew Auld
2020-02-03 17:37     ` Chris Wilson
2020-02-03  9:41 ` [Intel-gfx] [PATCH 5/6] drm/i915: Flush execution tasklets before checking request status Chris Wilson
2020-02-03  9:41 ` [Intel-gfx] [PATCH 6/6] drm/i915/gt: Yield the timeslice if caught waiting on a user semaphore Chris Wilson
2020-02-03 10:50 ` [Intel-gfx] [PATCH 1/6] drm/i915: Hold reference to previous active fence as we queue Tvrtko Ursulin
2020-02-03 11:33 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/6] " Patchwork
2020-02-05 17:55 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=9ed6606c-650f-3a32-5c85-c0b244ac1ea7@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.auld@intel.com \
    /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