All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: Mika Kuoppala <mika.kuoppala@linux.intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Introduce execlist_port_* accessors
Date: Fri, 20 Oct 2017 13:34:38 +0300	[thread overview]
Message-ID: <1508495678.5349.31.camel@linux.intel.com> (raw)
In-Reply-To: <20171019143942.909-1-mika.kuoppala@linux.intel.com>

On Thu, 2017-10-19 at 17:39 +0300, Mika Kuoppala wrote:
> From: Mika Kuoppala <mika.kuoppala@intel.com>
> 
> Instead of trusting that first available port is at index 0,
> use accessor to hide this. This is a preparation for a
> following patches where head can be at arbitrary location
> in the port array.
> 
> v2: improved commit message, elsp_ready readability (Chris)
> v3: s/execlist_port_index/execlist_port (Chris)
> v4: rebase to new naming
> v5: fix port_next indexing
> 
> Cc: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>

<SNIP>

> @@ -561,15 +563,20 @@ static void port_assign(struct execlist_port *port,
>  static void i915_guc_dequeue(struct intel_engine_cs *engine)
>  {
>  	struct intel_engine_execlists * const execlists = &engine->execlists;
> -	struct execlist_port *port = execlists->port;
> +	struct execlist_port *port;
>  	struct drm_i915_gem_request *last = NULL;
> -	const struct execlist_port * const last_port =
> -		&execlists->port[execlists->port_mask];
>  	bool submit = false;
>  	struct rb_node *rb;
>  
> -	if (port_isset(port))
> -		port++;
> +	port = execlists_port_head(execlists);
> +
> +	/*
> +	 * We don't coalesce into last submitted port with guc.
> +	 * Find first free port, this is safe as we dont dequeue without
> +	 * atleast last port free.

"at least" + "the"

<SNIP>

> @@ -557,6 +557,9 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>  	if (!rb)
>  		goto unlock;
>  
> +	port = execlists_port_head(execlists);
> +	last = port_request(port);
> +
>  	if (last) {
>  		/*
>  		 * Don't resubmit or switch until all outstanding
> @@ -564,7 +567,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>  		 * know the next preemption status we see corresponds
>  		 * to this ELSP update.
>  		 */
> -		if (port_count(&port[0]) > 1)
> +		if (port_count(port) > 1)
>  			goto unlock;
>  
>  		if (can_preempt(engine) &&
> @@ -598,7 +601,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>  			 * the driver is unable to keep up the supply of new
>  			 * work).
>  			 */
> -			if (port_count(&port[1]))
> +			if (port_count(execlists_port_next(execlists, port)))
>  				goto unlock;
>  
>  			/* WaIdleLiteRestore:bdw,skl
> @@ -634,7 +637,7 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
>  				 * combine this request with the last, then we
>  				 * are done.
>  				 */
> -				if (port == last_port) {
> +				if (port == execlists_port_tail(execlists)) {
>  					__list_del_many(&p->requests,
>  							&rq->priotree.link);

Nothing to fix related to this patch, but I was sure next hunk was
going to escape my screen :) Maybe we need to cut the indents a bit.

> @@ -890,7 +902,7 @@ static void intel_lrc_irq_handler(unsigned long data)
>  			}
>  
>  			/* After the final element, the hw should be idle */
> -			GEM_BUG_ON(port_count(port) == 0 &&
> +			GEM_BUG_ON(port_count(execlists_port_head(execlists)) == 0 &&
>  				   !(status & GEN8_CTX_STATUS_ACTIVE_IDLE));

Why did you stop trusting port variable here?

Other than that, looks good to me.

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-10-20 10:34 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-19 14:39 [PATCH 1/2] drm/i915: Introduce execlist_port_* accessors Mika Kuoppala
2017-10-19 14:39 ` [PATCH 2/2] drm/i915: Move execlists port head instead of memmoving array Mika Kuoppala
2017-10-19 15:54   ` Chris Wilson
2017-10-19 14:48 ` [PATCH 1/2] drm/i915: Introduce execlist_port_* accessors Chris Wilson
2017-10-20 12:00   ` Mika Kuoppala
2017-10-19 14:50 ` Chris Wilson
2017-10-19 14:59 ` ✗ Fi.CI.BAT: warning for series starting with [1/2] " Patchwork
2017-10-20 10:34 ` Joonas Lahtinen [this message]
2017-10-20 11:12   ` [PATCH 1/2] " Mika Kuoppala
2017-10-20 11:26     ` Chris Wilson
2017-10-20 12:53     ` Mika Kuoppala
2017-10-31 15:27 Mika Kuoppala
2017-10-31 15:41 ` Chris Wilson
2017-10-31 15:56   ` Chris Wilson
2017-11-02 10:38   ` Mika Kuoppala
2017-11-02 10:57     ` Chris Wilson
2017-11-02 14:14       ` Mika Kuoppala
2017-11-02 14:15         ` Mika Kuoppala
2017-11-02 14:32 ` Mika Kuoppala
2017-11-02 15:03   ` Chris Wilson
2017-11-30  9:10 [PATCH 0/2] execlist port handling improvements Mika Kuoppala
2017-11-30  9:10 ` [PATCH 1/2] drm/i915: Introduce execlist_port_* accessors Mika Kuoppala
2017-11-30 10:21   ` Chris Wilson

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=1508495678.5349.31.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=mika.kuoppala@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.