Re: [PATCH 5/5] drm/i915: Simplify intel_init_ring_buffer prototype

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

 



On Wed, Jul 06, 2016 at 01:38:49PM +0100, Tvrtko Ursulin wrote:
> 
> On 06/07/16 11:58, Chris Wilson wrote:
> >On Wed, Jul 06, 2016 at 11:52:11AM +0100, Tvrtko Ursulin wrote:
> >>From: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> >>
> >>Engine contains dev_priv so need to pass it in.
> >>
> >>Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@xxxxxxxxx>
> >>---
> >>  drivers/gpu/drm/i915/intel_ringbuffer.c | 18 ++++++++----------
> >>  1 file changed, 8 insertions(+), 10 deletions(-)
> >>
> >>diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> >>index 6b24c1642d84..26fe312005d1 100644
> >>--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> >>+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> >>@@ -2167,21 +2167,19 @@ static void intel_ring_context_unpin(struct i915_gem_context *ctx,
> >>  	i915_gem_context_unreference(ctx);
> >>  }
> >>
> >>-static int intel_init_ring_buffer(struct drm_device *dev,
> >>-				  struct intel_engine_cs *engine)
> >>+static int intel_init_ring_buffer(struct intel_engine_cs *engine)
> >>  {
> >>-	struct drm_i915_private *dev_priv = to_i915(dev);
> >>+	struct drm_i915_private *dev_priv = engine->i915;
> >>  	struct intel_ringbuffer *ringbuf;
> >>  	int ret;
> >>
> >>  	WARN_ON(engine->buffer);
> >>
> >>-	engine->i915 = dev_priv;
> >>  	INIT_LIST_HEAD(&engine->active_list);
> >>  	INIT_LIST_HEAD(&engine->request_list);
> >>  	INIT_LIST_HEAD(&engine->execlist_queue);
> >>  	INIT_LIST_HEAD(&engine->buffers);
> >
> >Patch 6/5, Move all the common init code to the dispatch?
> 
> What do you mean by dispatch?

The if-else-chain in the caller. These can all be done there since they
are common to all implementations.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
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