All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi@etezian.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org, matthew.auld@intel.com
Subject: Re: [Intel-gfx] [PATCH 4/5] drm/i915/gem: Pin gen6_ppgtt prior to constructing the request
Date: Sat, 7 Dec 2019 01:31:26 +0200	[thread overview]
Message-ID: <20191206233126.GA1300@jack.zhora.eu> (raw)
In-Reply-To: <20191206105527.1130413-4-chris@chris-wilson.co.uk>

Hi Chris,

> All pinning must be done prior to i915_request_create, to avoid
> timeline->mutex inversions.
> 
> Here we slightly abuse the context_barrier_task stages to utilise the
> 'skip' decision as an opportunity to acquire the pin on the new ppgtt.
> Consider it s/skip/prepare/. At the moment, we only have on user of
> context_barrier_task, so it might be worth breaking it down for the
> specific task of set-vm and refactor it later if we find a second
> purpose.

[...]

> diff --git a/drivers/gpu/drm/i915/gem/i915_gem_context.c b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> index 9f1dc96b10a6..9d8d75765ee4 100644
> --- a/drivers/gpu/drm/i915/gem/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/gem/i915_gem_context.c
> @@ -1141,8 +1141,6 @@ static int emit_ppgtt_update(struct i915_request *rq, void *data)
>  		*cs++ = MI_NOOP;
>  		intel_ring_advance(rq, cs);
>  	} else {
> -		/* ppGTT is not part of the legacy context image */
> -		gen6_ppgtt_pin(i915_vm_to_ppgtt(vm));
>  	}

mh? Am I not seeing something obvious? Can we remove the else?

>  
>  	return 0;
> @@ -1150,10 +1148,20 @@ static int emit_ppgtt_update(struct i915_request *rq, void *data)
>  
>  static bool skip_ppgtt_update(struct intel_context *ce, void *data)
>  {
> +	if (!test_bit(CONTEXT_ALLOC_BIT, &ce->flags))
> +		return true;
> +
>  	if (HAS_LOGICAL_RING_CONTEXTS(ce->engine->i915))
> -		return !ce->state;
> -	else
> -		return !atomic_read(&ce->pin_count);
> +		return false;
> +
> +	if (!atomic_read(&ce->pin_count))
> +		return true;
> +
> +	/* ppGTT is not part of the legacy context image */
> +	if (gen6_ppgtt_pin(i915_vm_to_ppgtt(ce->vm)))
> +		return true;
> +
> +	return false;

looks correct, a bit tricky, but I don't see any issue.

Reviewed-by: Andi Shyti <andi.shyti@intel.com>

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

  reply	other threads:[~2019-12-06 23:49 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 10:55 [Intel-gfx] [PATCH 1/5] drm/i915/gem: Flush the pwrite through the chipset before signaling Chris Wilson
2019-12-06 10:55 ` [Intel-gfx] [PATCH 2/5] drm/i915: Claim vma while under closed_lock in i915_vma_parked() Chris Wilson
2019-12-06 10:55 ` [Intel-gfx] [PATCH 3/5] drm/i915/gt: Acquire a GT wakeref for the breadcrumb interrupt Chris Wilson
2019-12-06 10:55 ` [Intel-gfx] [PATCH 4/5] drm/i915/gem: Pin gen6_ppgtt prior to constructing the request Chris Wilson
2019-12-06 23:31   ` Andi Shyti [this message]
2019-12-06 23:35     ` Chris Wilson
2019-12-06 10:55 ` [Intel-gfx] [PATCH 5/5] drm/i915: Avoid calling i915_gem_object_unbind holding object lock Chris Wilson
2019-12-07  0:03   ` Andi Shyti
2019-12-07  0:20     ` Chris Wilson
2019-12-07 19:24       ` Andi Shyti
2019-12-06 11:02 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/5] drm/i915/gem: Flush the pwrite through the chipset before signaling Patchwork
2019-12-06 11:23 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2019-12-06 11:34 ` [Intel-gfx] [PATCH 1/5] " Tvrtko Ursulin
2019-12-06 22:38 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/5] " 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=20191206233126.GA1300@jack.zhora.eu \
    --to=andi@etezian.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.