Re: [PATCH 3/4] drm/i915: Store a pointer to intel_context in i915_request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>
> >> Cc: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> >> ---
> >>   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@xxxxxxxxxxxxxxx>
> 
> 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@xxxxxxxxx>

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@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux