Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 05/12] drm/i915: Remove the identical implementations of request space reservation
Date: Tue, 24 Nov 2015 15:42:20 +0100	[thread overview]
Message-ID: <20151124144220.GL17050@phenom.ffwll.local> (raw)
In-Reply-To: <1448023432-10726-5-git-send-email-chris@chris-wilson.co.uk>

On Fri, Nov 20, 2015 at 12:43:45PM +0000, Chris Wilson wrote:
> Now that we share intel_ring_begin(), reserving space for the tail of
> the request is identical between legacy/execlists and so the tautology
> can be removed.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/i915_gem.c         |  7 +++----
>  drivers/gpu/drm/i915/intel_lrc.c        | 15 ---------------
>  drivers/gpu/drm/i915/intel_lrc.h        |  1 -
>  drivers/gpu/drm/i915/intel_ringbuffer.c | 15 ---------------
>  drivers/gpu/drm/i915/intel_ringbuffer.h |  3 ---
>  5 files changed, 3 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index c60105e36263..030fc9d14385 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -2743,10 +2743,9 @@ int i915_gem_request_alloc(struct intel_engine_cs *ring,
>  	 * to be redone if the request is not actually submitted straight
>  	 * away, e.g. because a GPU scheduler has deferred it.
>  	 */
> -	if (i915.enable_execlists)
> -		ret = intel_logical_ring_reserve_space(req);
> -	else
> -		ret = intel_ring_reserve_space(req);
> +	intel_ring_reserved_space_reserve(req->ringbuf,
> +					  MIN_SPACE_FOR_ADD_REQUEST);
> +	ret = intel_ring_begin(req, 0);
>  	if (ret) {
>  		/*
>  		 * At this point, the request is fully allocated even if not
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 02f798e4c726..2458804c521d 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -666,21 +666,6 @@ intel_logical_ring_advance_and_submit(struct drm_i915_gem_request *request)
>  	execlists_context_queue(request);
>  }
>  
> -int intel_logical_ring_reserve_space(struct drm_i915_gem_request *request)
> -{
> -	/*
> -	 * The first call merely notes the reserve request and is common for
> -	 * all back ends. The subsequent localised _begin() call actually
> -	 * ensures that the reservation is available. Without the begin, if
> -	 * the request creator immediately submitted the request without
> -	 * adding any commands to it then there might not actually be
> -	 * sufficient room for the submission commands.
> -	 */
> -	intel_ring_reserved_space_reserve(request->ringbuf, MIN_SPACE_FOR_ADD_REQUEST);
> -
> -	return intel_ring_begin(request, 0);
> -}
> -
>  /**
>   * execlists_submission() - submit a batchbuffer for execution, Execlists style
>   * @dev: DRM device.
> diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h
> index 5402eca78a07..9981e989fcaf 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.h
> +++ b/drivers/gpu/drm/i915/intel_lrc.h
> @@ -38,7 +38,6 @@
>  
>  /* Logical Rings */
>  int intel_logical_ring_alloc_request_extras(struct drm_i915_gem_request *request);
> -int intel_logical_ring_reserve_space(struct drm_i915_gem_request *request);
>  void intel_logical_ring_stop(struct intel_engine_cs *ring);
>  void intel_logical_ring_cleanup(struct intel_engine_cs *ring);
>  int intel_logical_rings_init(struct drm_device *dev);
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
> index fbee790ddaf0..9821c2a8074a 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.c
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
> @@ -2168,21 +2168,6 @@ int intel_ring_alloc_request_extras(struct drm_i915_gem_request *request)
>  	return 0;
>  }
>  
> -int intel_ring_reserve_space(struct drm_i915_gem_request *request)
> -{
> -	/*
> -	 * The first call merely notes the reserve request and is common for
> -	 * all back ends. The subsequent localised _begin() call actually
> -	 * ensures that the reservation is available. Without the begin, if
> -	 * the request creator immediately submitted the request without
> -	 * adding any commands to it then there might not actually be
> -	 * sufficient room for the submission commands.
> -	 */
> -	intel_ring_reserved_space_reserve(request->ringbuf, MIN_SPACE_FOR_ADD_REQUEST);
> -
> -	return intel_ring_begin(request, 0);
> -}
> -
>  void intel_ring_reserved_space_reserve(struct intel_ringbuffer *ringbuf, int size)
>  {
>  	WARN_ON(ringbuf->reserved_size);
> diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
> index 212b402818f9..368d9b0454ed 100644
> --- a/drivers/gpu/drm/i915/intel_ringbuffer.h
> +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
> @@ -487,7 +487,4 @@ void intel_ring_reserved_space_use(struct intel_ringbuffer *ringbuf);
>  /* Finish with the reserved space - for use by i915_add_request() only. */
>  void intel_ring_reserved_space_end(struct intel_ringbuffer *ringbuf);
>  
> -/* Legacy ringbuffer specific portion of reservation code: */
> -int intel_ring_reserve_space(struct drm_i915_gem_request *request);
> -
>  #endif /* _INTEL_RINGBUFFER_H_ */
> -- 
> 2.6.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-11-24 14:42 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20 12:43 [PATCH 01/12] drm/i915: Convert i915_semaphores_is_enabled over to drm_i915_private Chris Wilson
2015-11-20 12:43 ` [PATCH 02/12] drm/i915: Use the new rq->i915 field where appropriate Chris Wilson
2015-11-24 13:57   ` Daniel Vetter
2015-11-24 14:23     ` Chris Wilson
2015-11-24 14:41       ` Daniel Vetter
2015-11-20 12:43 ` [PATCH 03/12] drm/i915: Unify intel_logical_ring_emit and intel_ring_emit Chris Wilson
2015-11-24 14:33   ` Daniel Vetter
2015-11-24 14:52     ` Chris Wilson
2015-11-20 12:43 ` [PATCH 04/12] drm/i915: Unify intel_ring_begin() Chris Wilson
2015-11-24 14:38   ` Daniel Vetter
2015-11-24 14:58     ` Chris Wilson
2015-11-20 12:43 ` [PATCH 05/12] drm/i915: Remove the identical implementations of request space reservation Chris Wilson
2015-11-24 14:42   ` Daniel Vetter [this message]
2015-11-20 12:43 ` [PATCH 06/12] drm/i915: Rename request->ring to request->engine Chris Wilson
2015-11-24 14:48   ` Daniel Vetter
2015-11-20 12:43 ` [PATCH 07/12] drm/i915: Rename request->ringbuf to request->ring Chris Wilson
2015-11-24 14:51   ` Daniel Vetter
2015-11-24 15:08   ` Tvrtko Ursulin
2015-11-24 15:25     ` Chris Wilson
2015-11-25 10:22       ` Tvrtko Ursulin
2015-11-20 12:43 ` [PATCH 08/12] drm/i915: Rename backpointer from intel_ringbuffer to intel_engine_cs Chris Wilson
2015-11-24 14:58   ` Daniel Vetter
2015-11-24 15:10     ` Chris Wilson
2015-11-24 15:15     ` Chris Wilson
2015-11-24 15:36       ` Daniel Vetter
2015-11-20 12:43 ` [PATCH 09/12] drm/i915: Rename intel_context[engine].ringbuf Chris Wilson
2015-11-24 14:59   ` Daniel Vetter
2015-11-24 15:09   ` Tvrtko Ursulin
2015-11-24 15:27     ` Chris Wilson
2015-11-20 12:43 ` [PATCH 10/12] drm/i915: Reduce the pointer dance of i915_is_ggtt() Chris Wilson
2015-11-24 15:08   ` Daniel Vetter
2015-11-20 12:43 ` [PATCH 11/12] drm/i915: Remove request retirement before each batch Chris Wilson
2015-11-20 12:43 ` [PATCH 12/12] drm/i915: Cache the reset_counter for the request Chris Wilson
2015-11-24 16:43   ` Daniel Vetter
2015-11-24 21:43     ` Chris Wilson
2015-11-25  9:12       ` Daniel Vetter
2015-11-25 12:17         ` Chris Wilson
2015-11-26  9:21           ` Daniel Vetter
2015-11-26  9:50             ` Chris Wilson
2015-11-25 17:11         ` Chris Wilson
2015-11-24 13:52 ` [PATCH 01/12] drm/i915: Convert i915_semaphores_is_enabled over to drm_i915_private Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20151124144220.GL17050@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox