From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/i915/execlists: Microoptimise execlists_cancel_port_request()
Date: Mon, 25 Sep 2017 16:00:17 +0300 [thread overview]
Message-ID: <87shfbylum.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20170925124929.16974-1-chris@chris-wilson.co.uk>
Chris Wilson <chris@chris-wilson.co.uk> writes:
> Just rearrange the code slightly to trim the number of iterations
> required.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/intel_lrc.c | 17 ++++++++++-------
> 1 file changed, 10 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> index 3623403a4f2d..2c07f3c08bd3 100644
> --- a/drivers/gpu/drm/i915/intel_lrc.c
> +++ b/drivers/gpu/drm/i915/intel_lrc.c
> @@ -571,14 +571,17 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
> execlists_submit_ports(engine);
> }
>
> -static void execlist_cancel_port_requests(struct intel_engine_execlists *execlists)
> +static void
> +execlist_cancel_port_requests(struct intel_engine_execlists *execlists)
> {
> - unsigned int i;
> -
> - for (i = 0; i < ARRAY_SIZE(execlists->port); i++)
> - i915_gem_request_put(port_request(&execlists->port[i]));
> + struct execlist_port *port = execlists->port;
> + unsigned int num_ports = ARRAY_SIZE(execlists->port);
>
> - memset(execlists->port, 0, sizeof(execlists->port));
> + while (num_ports-- && port_isset(port)) {
> + i915_gem_request_put(port_request(port));
> + memset(port, 0, sizeof(*port));
> + port++;
> + }
I thought this to be more about the reset and thus memsetting
everything would give us a clean plate. However now it matches
more of what the function is about.
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
> }
>
> static void execlists_cancel_requests(struct intel_engine_cs *engine)
> @@ -625,7 +628,7 @@ static void execlists_cancel_requests(struct intel_engine_cs *engine)
>
> execlists->queue = RB_ROOT;
> execlists->first = NULL;
> - GEM_BUG_ON(port_isset(&execlists->port[0]));
> + GEM_BUG_ON(port_isset(execlists->port));
>
> /*
> * The port is checked prior to scheduling a tasklet, but
> --
> 2.14.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-09-25 13:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-25 12:49 [PATCH 1/3] drm/i915/execlists: Microoptimise execlists_cancel_port_request() Chris Wilson
2017-09-25 12:49 ` [PATCH 2/3] drm/i915/execlists: Move request unwinding to a separate function Chris Wilson
2017-09-25 12:55 ` Mika Kuoppala
2017-09-25 13:18 ` Chris Wilson
2017-09-25 14:54 ` Mika Kuoppala
2017-09-25 12:49 ` [PATCH 3/3] drm/i915/execlists: Cache the last priolist lookup Chris Wilson
2017-09-25 12:54 ` Chris Wilson
2017-09-25 13:59 ` [PATCH v2] " Chris Wilson
2017-09-25 13:00 ` Mika Kuoppala [this message]
2017-09-25 13:08 ` [PATCH 1/3] drm/i915/execlists: Microoptimise execlists_cancel_port_request() Chris Wilson
2017-09-25 19:38 ` Chris Wilson
2017-09-25 13:36 ` ✗ Fi.CI.BAT: failure for series starting with [1/3] " Patchwork
2017-09-25 15:04 ` ✓ Fi.CI.BAT: success for series starting with [1/3] drm/i915/execlists: Microoptimise execlists_cancel_port_request() (rev2) Patchwork
2017-09-25 18:01 ` ✓ Fi.CI.IGT: success for series starting with [1/3] drm/i915/execlists: Microoptimise execlists_cancel_port_request() Patchwork
2017-09-25 20:34 ` ✓ Fi.CI.IGT: success for series starting with [1/3] drm/i915/execlists: Microoptimise execlists_cancel_port_request() (rev2) 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=87shfbylum.fsf@gaia.fi.intel.com \
--to=mika.kuoppala@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