Re: [PATCH 5/9] drm/i915: Make ring buffer size configurable

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

 



Thanks. Will do. :)

> -----Original Message-----
> From: Chris Wilson [mailto:chris@xxxxxxxxxxxxxxxxxx]
> Sent: Friday, May 20, 2016 3:02 PM
> To: Wang, Zhi A <zhi.a.wang@xxxxxxxxx>
> Cc: intel-gfx@xxxxxxxxxxxxxxxxxxxxx; tvrtko.ursulin@xxxxxxxxxxxxxxx;
> joonas.lahtinen@xxxxxxxxxxxxxxx; Tian, Kevin <kevin.tian@xxxxxxxxx>; Lv,
> Zhiyuan <zhiyuan.lv@xxxxxxxxx>
> Subject: Re: [PATCH 5/9] drm/i915: Make ring buffer size configurable
> 
> On Tue, May 17, 2016 at 04:19:05AM -0400, Zhi Wang wrote:
> > This patch introduces an option for configuring ring buffer size
> > during context creation. If no ring buffer size is specified, the
> > default size
> > (4 * PAGE_SIZE) will be used.
> >
> > Signed-off-by: Zhi Wang <zhi.a.wang@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h  | 1 +
> > drivers/gpu/drm/i915/intel_lrc.c | 8 ++++++--
> >  2 files changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h
> > b/drivers/gpu/drm/i915/i915_drv.h index ea04352..cc83f2d 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -883,6 +883,7 @@ struct intel_context {
> >  		uint32_t *lrc_reg_state;
> >  		bool initialised;
> >  	} engine[I915_NUM_ENGINES];
> > +	u32 ring_buffer_size;
> >
> >  	struct list_head link;
> >  };
> > diff --git a/drivers/gpu/drm/i915/intel_lrc.c
> > b/drivers/gpu/drm/i915/intel_lrc.c
> > index db10c96..d52c806 100644
> > --- a/drivers/gpu/drm/i915/intel_lrc.c
> > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > @@ -2495,7 +2495,7 @@ static int execlists_context_deferred_alloc(struct
> intel_context *ctx,
> >  					    struct intel_engine_cs *engine)  {
> >  	struct drm_i915_gem_object *ctx_obj;
> > -	uint32_t context_size;
> > +	uint32_t context_size, ring_buffer_size;
> >  	struct intel_ringbuffer *ringbuf;
> >  	int ret;
> >
> > @@ -2513,7 +2513,11 @@ static int execlists_context_deferred_alloc(struct
> intel_context *ctx,
> >  		return PTR_ERR(ctx_obj);
> >  	}
> >
> > -	ringbuf = intel_engine_create_ringbuffer(engine, 4 * PAGE_SIZE);
> > +	ring_buffer_size = ctx->ring_buffer_size;
> > +	if (!ring_buffer_size)
> > +		ring_buffer_size = 4 * PAGE_SIZE;
> 
> Just don't let it be zero (during construction).
> -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