public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 19/22] drm/i915/execlists: Refactor out can_merge_rq()
Date: Mon, 4 Feb 2019 19:02:03 +0000	[thread overview]
Message-ID: <a94cee3e-1b19-ad8a-e654-ce00fbaccbb3@linux.intel.com> (raw)
In-Reply-To: <20190204132214.9459-20-chris@chris-wilson.co.uk>


On 04/02/2019 13:22, Chris Wilson wrote:
> In the next patch, we add another user that wants to check whether
> requests can be merge into a single HW execution, and in the future we
> want to add more conditions under which requests from the same context
> cannot be merge. In preparation, extract out can_merge_rq().
> 
> v2: Reorder tests to decide if we can continue filling ELSP and bonus
> comments.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>   drivers/gpu/drm/i915/intel_lrc.c | 35 ++++++++++++++++++++++----------
>   1 file changed, 24 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index e37f207afb5a..66d465708bc6 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -285,12 +285,11 @@ static inline bool need_preempt(const struct intel_engine_cs *engine,
>   }
>   
>   __maybe_unused static inline bool
> -assert_priority_queue(const struct intel_engine_execlists *execlists,
> -		      const struct i915_request *prev,
> +assert_priority_queue(const struct i915_request *prev,
>   		      const struct i915_request *next)
>   {
> -	if (!prev)
> -		return true;
> +	const struct intel_engine_execlists *execlists =
> +		&prev->engine->execlists;
>   
>   	/*
>   	 * Without preemption, the prev may refer to the still active element
> @@ -601,6 +600,17 @@ static bool can_merge_ctx(const struct intel_context *prev,
>   	return true;
>   }
>   
> +static bool can_merge_rq(const struct i915_request *prev,
> +			 const struct i915_request *next)
> +{
> +	GEM_BUG_ON(!assert_priority_queue(prev, next));
> +
> +	if (!can_merge_ctx(prev->hw_context, next->hw_context))
> +		return false;
> +
> +	return true;
> +}
> +
>   static void port_assign(struct execlist_port *port, struct i915_request *rq)
>   {
>   	GEM_BUG_ON(rq == port_request(port));
> @@ -753,8 +763,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>   		int i;
>   
>   		priolist_for_each_request_consume(rq, rn, p, i) {
> -			GEM_BUG_ON(!assert_priority_queue(execlists, last, rq));
> -
>   			/*
>   			 * Can we combine this request with the current port?
>   			 * It has to be the same context/ringbuffer and not
> @@ -766,8 +774,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>   			 * second request, and so we never need to tell the
>   			 * hardware about the first.
>   			 */
> -			if (last &&
> -			    !can_merge_ctx(rq->hw_context, last->hw_context)) {
> +			if (last && !can_merge_rq(last, rq)) {
>   				/*
>   				 * If we are on the second port and cannot
>   				 * combine this request with the last, then we
> @@ -776,6 +783,14 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>   				if (port == last_port)
>   					goto done;
>   
> +				/*
> +				 * We must not populate both ELSP[] with the
> +				 * same LRCA, i.e. we must submit 2 different
> +				 * contexts if we submit 2 ELSP.
> +				 */
> +				if (last->hw_context == rq->hw_context)
> +					goto done;
> +
>   				/*
>   				 * If GVT overrides us we only ever submit
>   				 * port[0], leaving port[1] empty. Note that we
> @@ -787,7 +802,6 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>   				    ctx_single_port_submission(rq->hw_context))
>   					goto done;
>   
> -				GEM_BUG_ON(last->hw_context == rq->hw_context);
>   
>   				if (submit)
>   					port_assign(port, last);
> @@ -826,8 +840,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>   	 * request triggering preemption on the next dequeue (or subsequent
>   	 * interrupt for secondary ports).
>   	 */
> -	execlists->queue_priority_hint =
> -		port != execlists->port ? rq_prio(last) : INT_MIN;
> +	execlists->queue_priority_hint = queue_prio(execlists);
>   
>   	if (submit) {
>   		port_assign(port, last);
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-02-04 19:01 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-04 13:21 Fleshing out the picture to Load Balancing^W^W HW semaphores Chris Wilson
2019-02-04 13:21 ` [PATCH 01/22] drm/i915/execlists: Suppress mere WAIT preemption Chris Wilson
2019-02-04 13:21 ` [PATCH 02/22] drm/i915/execlists: Suppress redundant preemption Chris Wilson
2019-02-04 13:21 ` [PATCH 03/22] drm/i915/selftests: Exercise some AB...BA preemption chains Chris Wilson
2019-02-04 13:21 ` [PATCH 04/22] drm/i915: Trim NEWCLIENT boosting Chris Wilson
2019-02-04 15:01   ` [PATCH] " Chris Wilson
2019-02-04 19:05     ` Tvrtko Ursulin
2019-02-04 13:21 ` [PATCH 05/22] drm/i915: Show support for accurate sw PMU busyness tracking Chris Wilson
2019-02-04 16:49   ` Chris Wilson
2019-02-04 13:21 ` [PATCH 06/22] drm/i915: Revoke mmaps and prevent access to fence registers across reset Chris Wilson
2019-02-04 13:21 ` [PATCH 07/22] drm/i915: Force the GPU reset upon wedging Chris Wilson
2019-02-04 13:22 ` [PATCH 08/22] drm/i915: Uninterruptibly drain the timelines on unwedging Chris Wilson
2019-02-04 13:22 ` [PATCH 09/22] drm/i915: Wait for old resets before applying debugfs/i915_wedged Chris Wilson
2019-02-04 13:22 ` [PATCH 10/22] drm/i915: Serialise resets with wedging Chris Wilson
2019-02-04 13:22 ` [PATCH 11/22] drm/i915: Don't claim an unstarted request was guilty Chris Wilson
2019-02-04 13:22 ` [PATCH 12/22] drm/i915: Generalise GPU activity tracking Chris Wilson
2019-02-05  8:51   ` Tvrtko Ursulin
2019-02-05  8:59     ` Chris Wilson
2019-02-04 13:22 ` [PATCH 13/22] drm/i915: Release the active tracker tree upon idling Chris Wilson
2019-02-04 13:22 ` [PATCH 14/22] drm/i915: Allocate active tracking nodes from a slabcache Chris Wilson
2019-02-04 18:22   ` Tvrtko Ursulin
2019-02-04 13:22 ` [PATCH 15/22] drm/i915: Make request allocation caches global Chris Wilson
2019-02-04 18:48   ` Tvrtko Ursulin
2019-02-04 21:26     ` Chris Wilson
2019-02-04 13:22 ` [PATCH 16/22] drm/i915: Add timeline barrier support Chris Wilson
2019-02-04 13:22 ` [PATCH 17/22] drm/i915: Pull i915_gem_active into the i915_active family Chris Wilson
2019-02-04 18:50   ` Tvrtko Ursulin
2019-02-04 13:22 ` [PATCH 18/22] drm/i915: Keep timeline HWSP allocated until idle across the system Chris Wilson
2019-02-04 18:57   ` Tvrtko Ursulin
2019-02-04 13:22 ` [PATCH 19/22] drm/i915/execlists: Refactor out can_merge_rq() Chris Wilson
2019-02-04 19:02   ` Tvrtko Ursulin [this message]
2019-02-04 13:22 ` [PATCH 20/22] drm/i915: Use HW semaphores for inter-engine synchronisation on gen8+ Chris Wilson
2019-02-05  9:24   ` Tvrtko Ursulin
2019-02-05  9:27     ` Chris Wilson
2019-02-04 13:22 ` [PATCH 21/22] drm/i915: Prioritise non-busywait semaphore workloads Chris Wilson
2019-02-04 13:22 ` [PATCH 22/22] semaphore-no-stats Chris Wilson
2019-02-05 10:03   ` Tvrtko Ursulin
2019-02-05 10:07     ` Chris Wilson
2019-02-04 13:58 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/22] drm/i915/execlists: Suppress mere WAIT preemption Patchwork
2019-02-04 14:07 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-02-04 14:45 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-04 15:22 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/22] drm/i915/execlists: Suppress mere WAIT preemption (rev2) Patchwork
2019-02-04 15:30 ` ✗ Fi.CI.SPARSE: " Patchwork
2019-02-04 15:42 ` ✓ Fi.CI.BAT: success " Patchwork
2019-02-04 17:51 ` ✓ Fi.CI.IGT: " Patchwork

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=a94cee3e-1b19-ad8a-e654-ce00fbaccbb3@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --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