[20/31] drm/i915: Remove intel_ring_get_tail()

Submitted by Chris Wilson on July 25, 2016, 7:44 a.m.

Details

Message ID 1469432687-22756-21-git-send-email-chris@chris-wilson.co.uk
State New
Headers show
Series "Series without cover letter" ( rev: 5 4 3 2 1 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Chris Wilson July 25, 2016, 7:44 a.m.
Joonas doesn't like the tiny function, especially if I go around making
it more complicated and using it elsewhere. To remove that temptation,
remove the function!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem_request.c | 8 ++++----
 drivers/gpu/drm/i915/intel_ringbuffer.h | 5 -----
 2 files changed, 4 insertions(+), 9 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 995ae99e9cf7..1c185e293bf0 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -419,7 +419,7 @@  void __i915_add_request(struct drm_i915_gem_request *request,
 	 * should already have been reserved in the ring buffer. Let the ring
 	 * know that it is time to use that space up.
 	 */
-	request_start = intel_ring_get_tail(ring);
+	request_start = ring->tail;
 	reserved_tail = request->reserved_space;
 	request->reserved_space = 0;
 
@@ -465,19 +465,19 @@  void __i915_add_request(struct drm_i915_gem_request *request,
 	 * GPU processing the request, we never over-estimate the
 	 * position of the head.
 	 */
-	request->postfix = intel_ring_get_tail(ring);
+	request->postfix = ring->tail;
 
 	if (i915.enable_execlists) {
 		ret = engine->emit_request(request);
 	} else {
 		ret = engine->add_request(request);
 
-		request->tail = intel_ring_get_tail(ring);
+		request->tail = ring->tail;
 	}
 	/* Not allowed to fail! */
 	WARN(ret, "emit|add_request failed: %d!\n", ret);
 	/* Sanity check that the reserved size was large enough. */
-	ret = intel_ring_get_tail(ring) - request_start;
+	ret = ring->tail - request_start;
 	if (ret < 0)
 		ret += ring->size;
 	WARN_ONCE(ret > reserved_tail,
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index cbd46d5e8d6b..13b816f2d264 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -488,11 +488,6 @@  static inline u32 intel_engine_get_seqno(struct intel_engine_cs *engine)
 
 int init_workarounds_ring(struct intel_engine_cs *engine);
 
-static inline u32 intel_ring_get_tail(struct intel_ring *ring)
-{
-	return ring->tail;
-}
-
 /*
  * Arbitrary size for largest possible 'add request' sequence. The code paths
  * are complex and variable. Empirical measurement shows that the worst case

Comments

On ma, 2016-07-25 at 08:44 +0100, Chris Wilson wrote:
> Joonas doesn't like the tiny function, especially if I go around making
> it more complicated and using it elsewhere. To remove that temptation,
> remove the function!
> 

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_gem_request.c | 8 ++++----
>  drivers/gpu/drm/i915/intel_ringbuffer.h | 5 -----
>  2 files changed, 4 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
> index 995ae99e9cf7..1c185e293bf0 100644
> --- a/drivers/gpu/drm/i915/i915_gem_request.c
> +++ b/drivers/gpu/drm/i915/i915_gem_request.c
> @@ -419,7 +419,7 @@ void __i915_add_request(struct drm_i915_gem_request *request,
>  	 * should already have been reserved in the ring buffer. Let the ring
>  	 * know that it is time to use that space up.
>  	 */
> -	request_start = intel_ring_get_tail(ring);
> +	request_start = ring->tail;
>  	reserved_tail = request->reserved_space;
>  	request->reserved_space = 0;
>  
> @@ -465,19 +465,19 @@ void __i915_add_request(struct drm_i915_gem_request *request,
>  	 * GPU processing the request, we never over-estimate the
>  	 * position of the head.
>  	 */
> -	request->postfix = intel_ring_get_tail(ring);
> +	request->postfix = ring->tail;
>  
>  	if (i915.enable_execlists) {
>  		ret = engine->emit_request(request);
>  	} else {
>  		ret = engine->add_request(request);
>  
> -		request->tail = intel_ring_get_tail(ring);
> +		request->tail = ring->tail;
>  	}
>  	/* Not allowed to fail! */
>  	WARN(ret, "emit|add_request failed: %d!\n", ret);
>  	/* Sanity check that the reserved size was large enough. */
> -	ret = intel_ring_get_tail(ring) - request_start;
> +	ret = ring->tail - request_start;
>  	if (ret < 0)
>  		ret += ring->size;
>  	WARN_ONCE(ret > reserved_tail,
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index cbd46d5e8d6b..13b816f2d264 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -488,11 +488,6 @@ static inline u32 intel_engine_get_seqno(struct intel_engine_cs *engine)
>  
>  int init_workarounds_ring(struct intel_engine_cs *engine);
>  
> -static inline u32 intel_ring_get_tail(struct intel_ring *ring)
> -{
> -	return ring->tail;
> -}
> -
>  /*
>   * Arbitrary size for largest possible 'add request' sequence. The code paths
>   * are complex and variable. Empirical measurement shows that the worst case