From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Dave Gordon <david.s.gordon@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/i915/guc: drop cached copy of 'wq_head'
Date: Tue, 19 Apr 2016 16:36:53 +0100 [thread overview]
Message-ID: <57165095.9030203@linux.intel.com> (raw)
In-Reply-To: <1461078516-28678-2-git-send-email-david.s.gordon@intel.com>
On 19/04/16 16:08, Dave Gordon wrote:
> From: Alex Dai <yu.dai@intel.com>
>
> Now that we keep the GuC client process descriptor permanently mapped,
> we don't really need to keep a local copy of the GuC's work-queue-head.
> So we can simplify the code a little by not doing this.
>
> Signed-off-by: Alex Dai <yu.dai@intel.com>
> Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
> ---
> drivers/gpu/drm/i915/i915_guc_submission.c | 16 ++++------------
> drivers/gpu/drm/i915/intel_guc.h | 2 +-
> 2 files changed, 5 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
> index d251699..4718b7a 100644
> --- a/drivers/gpu/drm/i915/i915_guc_submission.c
> +++ b/drivers/gpu/drm/i915/i915_guc_submission.c
> @@ -238,9 +238,6 @@ static int guc_ring_doorbell(struct i915_guc_client *gc)
> db_exc.cookie = 1;
> }
>
> - /* Finally, update the cached copy of the GuC's WQ head */
> - gc->wq_head = desc->head;
> -
> return ret;
> }
>
> @@ -465,17 +462,10 @@ int i915_guc_wq_check_space(struct i915_guc_client *gc)
> if (!gc)
> return 0;
>
> - /* Quickly return if wq space is available since last time we cache the
> - * head position. */
> - if (CIRC_SPACE(gc->wq_tail, gc->wq_head, gc->wq_size) >= size)
> - return 0;
> -
> desc = gc->client_base + gc->proc_desc_offset;
>
> while (timeout_counter-- > 0) {
> - gc->wq_head = desc->head;
> -
> - if (CIRC_SPACE(gc->wq_tail, gc->wq_head, gc->wq_size) >= size) {
> + if (CIRC_SPACE(gc->wq_tail, desc->head, gc->wq_size) >= size) {
> ret = 0;
> break;
> }
> @@ -490,11 +480,13 @@ int i915_guc_wq_check_space(struct i915_guc_client *gc)
> static int guc_add_workqueue_item(struct i915_guc_client *gc,
> struct drm_i915_gem_request *rq)
> {
> + struct guc_process_desc *desc;
> struct guc_wq_item *wqi;
> void *base;
> u32 tail, wq_len, wq_off, space;
>
> - space = CIRC_SPACE(gc->wq_tail, gc->wq_head, gc->wq_size);
> + desc = gc->client_base + gc->proc_desc_offset;
> + space = CIRC_SPACE(gc->wq_tail, desc->head, gc->wq_size);
> if (WARN_ON(space < sizeof(struct guc_wq_item)))
> return -ENOSPC; /* shouldn't happen */
>
> diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
> index 06050c241a..19ca593 100644
> --- a/drivers/gpu/drm/i915/intel_guc.h
> +++ b/drivers/gpu/drm/i915/intel_guc.h
> @@ -46,7 +46,7 @@ struct i915_guc_client {
> uint32_t wq_offset;
> uint32_t wq_size;
> uint32_t wq_tail;
> - uint32_t wq_head;
> + uint32_t unused; /* Was 'wq_head' */
>
> /* GuC submission statistics & status */
> uint64_t submissions[GUC_MAX_ENGINES_NUM];
>
Looks OK to me, only with a disclaimer that I am not a GuC expert:
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
next prev parent reply other threads:[~2016-04-19 15:36 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-19 15:08 [PATCH 1/3] drm/i915/guc: keep GuC doorbell & process descriptor mapped in kernel Dave Gordon
2016-04-19 15:08 ` [PATCH 2/3] drm/i915/guc: drop cached copy of 'wq_head' Dave Gordon
2016-04-19 15:36 ` Tvrtko Ursulin [this message]
2016-04-19 15:08 ` [PATCH 3/3] drm/i915/guc: local optimisations and updating comments Dave Gordon
2016-04-19 15:20 ` [PATCH 1/3] drm/i915/guc: keep GuC doorbell & process descriptor mapped in kernel Tvrtko Ursulin
2016-04-19 16:24 ` ✗ Fi.CI.BAT: failure for series starting with [1/3] " Patchwork
2016-04-19 17:10 ` Dave Gordon
2016-04-20 13:47 ` Tvrtko Ursulin
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=57165095.9030203@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=david.s.gordon@intel.com \
--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 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.