All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, yan.y.zhao@intel.com
Subject: Re: [PATCH 3/4] drm/i915: Store a pointer to intel_context in i915_request
Date: Fri, 18 May 2018 09:42:47 +0100	[thread overview]
Message-ID: <152663296712.4210.4267258137100448064@mail.alporthouse.com> (raw)
In-Reply-To: <853c767c-e1db-50ca-5b52-6ba5fef8ee01@linux.intel.com>

Quoting Tvrtko Ursulin (2018-05-18 08:43:33)
> 
> On 18/05/2018 04:21, Zhenyu Wang wrote:
> > On 2018.05.17 22:26:32 +0100, Chris Wilson wrote:
> >> To ease the frequent and ugly pointer dance of
> >> &request->gem_context->engine[request->engine->id] during request
> >> submission, store that pointer as request->hw_context. One major
> >> advantage that we will exploit later is that this decouples the logical
> >> context state from the engine itself.
> >>
> >> v2: Set mock_context->ops so we don't crash and burn in selftests.
> >>      Cleanups from Tvrtko.
> >>
> >> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >> ---
> >>   drivers/gpu/drm/i915/gvt/mmio_context.c       |   6 +-
> >>   drivers/gpu/drm/i915/gvt/mmio_context.h       |   2 +-
> >>   drivers/gpu/drm/i915/gvt/scheduler.c          | 141 +++++++-----------
> >>   drivers/gpu/drm/i915/gvt/scheduler.h          |   1 -
> > 
> > gvt change looks fine to me.
> > 
> > Acked-by: Zhenyu Wang <zhenyuw@linux.intel.com>
> 
> Excellent, thanks!
> 
> And I think I already have my r-b earlier for non-GVT parts. So let me 
> repeat it:
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Thanks. Applied, please yell if I broke anything, or better yet donate
some machines to testing intel-gfx@ :)

There will be a few more changes to make struct intel_context a first
class citizen for i915_request if Tvrtko manages to whip me or the api
into shape. So expect a little more upheaval in the coming months.
I'm thinking an api like:

	ce = intel_context_get_and_lock(context, engine);

	rq = i915_request_get(ce);
	...
	i915_request_add(rq);

	intel_context_put_and_unlock(ce);

(get_and_lock() is a helper around _get() and _lock())

In the gvt case, I expect you will want to manage your intel_contexts
explicitly as the ref/pin/locked phases is slightly longer for you than
the typical construct-a-request used elsewhere. Note also that the goal
is to replace the struct_mutex with fine grained locks.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-05-18  8:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-17 21:26 [PATCH 1/4] drm/i915: Move request->ctx aside Chris Wilson
2018-05-17 21:26 ` [PATCH 2/4] drm/i915: Move fiddling with engine->last_retired_context Chris Wilson
2018-05-17 21:26 ` [PATCH 3/4] drm/i915: Store a pointer to intel_context in i915_request Chris Wilson
2018-05-18  3:21   ` Zhenyu Wang
2018-05-18  7:43     ` Tvrtko Ursulin
2018-05-18  8:42       ` Chris Wilson [this message]
2018-05-18 10:04         ` Zhenyu Wang
2018-05-17 21:26 ` [PATCH 4/4] drm/i915: Pull the context->pin_count dec into the common intel_context_unpin Chris Wilson
2018-05-17 21:59 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/4] drm/i915: Move request->ctx aside Patchwork
2018-05-17 22:14 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-18  3:02 ` ✓ 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=152663296712.4210.4267258137100448064@mail.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=yan.y.zhao@intel.com \
    --cc=zhenyuw@linux.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.