All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Hoath <nicholas.hoath@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v10] drm/i915: Extend LRC pinning to cover GPU context writeback
Date: Thu, 14 Jan 2016 11:56:07 +0000	[thread overview]
Message-ID: <56978CD7.5030107@intel.com> (raw)
In-Reply-To: <20160114113639.GU29867@nuc-i3427.alporthouse.com>

On 14/01/2016 11:36, Chris Wilson wrote:
> On Wed, Jan 13, 2016 at 04:19:45PM +0000, Nick Hoath wrote:
>> +	if (ctx->engine[ring->id].dirty) {
>> +		struct drm_i915_gem_request *req = NULL;
>> +
>> +		/**
>> +		 * If there is already a request pending on
>> +		 * this ring, wait for that to complete,
>> +		 * otherwise create a switch to idle request
>> +		 */
>> +		if (list_empty(&ring->request_list)) {
>> +			int ret;
>> +
>> +			ret = i915_gem_request_alloc(
>> +					ring,
>> +					ring->default_context,
>> +					&req);
>> +			if (!ret)
>> +				i915_add_request(req);
>> +			else
>> +				DRM_DEBUG("Failed to ensure context saved");
>> +		} else {
>> +			req = list_first_entry(
>> +					&ring->request_list,
>> +					typeof(*req), list);
>> +		}
>> +		if (req) {
>> +			ret = i915_wait_request(req);
>> +			if (ret != 0) {
>> +				/**
>> +				 * If we get here, there's probably been a ring
>> +				 * reset, so we just clean up the dirty flag.&
>> +				 * pin count.
>> +				 */
>> +				ctx->engine[ring->id].dirty = false;
>> +				__intel_lr_context_unpin(
>> +					ring,
>> +					ctx);
>> +			}
>> +		}
>
> If you were to take a lr_context_pin on the last_context, and only
> release that pin when you change to a new context, you do not need to

That what this patch does.

> introduce a blocking context-close, nor do you need to introduce the
> usage of default_context.

The use of default_context here is to stop a context hanging around 
after it is no longer needed.

>
> (lr_context_pin should take a reference on the ctx to prevent early
> freeeing ofc).

You can't clear the reference on the ctx in an interrupt context.

>
> The code at that point starts to look v.v.similar to legacy, right down
> to the need to use a GPU reset during shutdown to prevent writing back
> the context image. (Which you still currently need to get rid of the
> default context now.)
> -Chris
>

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

  reply	other threads:[~2016-01-14 11:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-13 16:19 [PATCH v10] drm/i915: Extend LRC pinning to cover GPU context writeback Nick Hoath
2016-01-13 19:28 ` Yu Dai
2016-01-14  7:20 ` ✗ failure: Fi.CI.BAT Patchwork
2016-01-14 11:31   ` Nick Hoath
2016-01-19  9:08     ` Daniel Vetter
2016-01-14 11:36 ` [PATCH v10] drm/i915: Extend LRC pinning to cover GPU context writeback Chris Wilson
2016-01-14 11:56   ` Nick Hoath [this message]
2016-01-14 12:31     ` Chris Wilson
2016-01-14 12:37       ` Nick Hoath
2016-01-15 10:59         ` Nick Hoath
2016-01-18 15:02           ` Tvrtko Ursulin
2016-01-18 16:53             ` Chris Wilson
2016-01-18 17:14               ` Tvrtko Ursulin
2016-01-18 20:47                 ` Chris Wilson
2016-01-19 10:24                   ` Tvrtko Ursulin
2016-01-19 17:18                     ` Tvrtko Ursulin
2016-01-19 17:31                       ` Tvrtko Ursulin

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=56978CD7.5030107@intel.com \
    --to=nicholas.hoath@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel.vetter@ffwll.ch \
    --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 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.