[Intel-gfx] [PATCH 23/53] drm/i915: Generalize intel_ring_get_tail

Volkin, Bradley D bradley.d.volkin at intel.com
Fri Jun 20 22:17:27 CEST 2014


On Fri, Jun 13, 2014 at 08:37:41AM -0700, oscar.mateo at intel.com wrote:
> From: Oscar Mateo <oscar.mateo at intel.com>
> 
> Reusing stuff, a penny at a time.
> 
> Signed-off-by: Oscar Mateo <oscar.mateo at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem.c         | 4 ++--
>  drivers/gpu/drm/i915/intel_ringbuffer.h | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index c5c06c9..dcdffab 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2320,7 +2320,7 @@ int __i915_add_request(struct intel_engine_cs *ring,
>  	u32 request_ring_position, request_start;
>  	int ret;
>  
> -	request_start = intel_ring_get_tail(ring);
> +	request_start = intel_ring_get_tail(ring->buffer);
>  	/*
>  	 * Emit any outstanding flushes - execbuf can fail to emit the flush
>  	 * after having emitted the batchbuffer command. Hence we need to fix
> @@ -2341,7 +2341,7 @@ int __i915_add_request(struct intel_engine_cs *ring,
>  	 * GPU processing the request, we never over-estimate the
>  	 * position of the head.
>  	 */
> -	request_ring_position = intel_ring_get_tail(ring);
> +	request_ring_position = intel_ring_get_tail(ring->buffer);
>  
>  	ret = ring->add_request(ring);
>  	if (ret)
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index dc944fe..1558afa 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -334,9 +334,9 @@ void intel_destroy_ring_buffer(struct intel_ringbuffer *ringbuf);
>  int intel_allocate_ring_buffer(struct drm_device *dev,
>  			       struct intel_ringbuffer *ringbuf);
>  
> -static inline u32 intel_ring_get_tail(struct intel_engine_cs *ring)
> +static inline u32 intel_ring_get_tail(struct intel_ringbuffer *ringbuf)
>  {
> -	return ring->buffer->tail;
> +	return ringbuf->tail;
>  }

Another naming bikeshed, for this and the previous patch:
It might be unexpected to have all of the intel_ring_ functions except for
two take a struct intel_engine_cs and then have this and intel_ring_space
take a struct intel_ringbuffer. So maybe intel_ringbuffer_ or similar for
those two.

Brad

>  
>  static inline u32 intel_ring_get_seqno(struct intel_engine_cs *ring)
> -- 
> 1.9.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx



More information about the Intel-gfx mailing list