From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: yu.dai@intel.com, intel-gfx@lists.freedesktop.org
Cc: daniel.vetter@ffwll.ch
Subject: Re: [PATCH] drm/i915/guc: Set init value for cached work queue head
Date: Wed, 10 Feb 2016 17:30:54 +0000 [thread overview]
Message-ID: <56BB73CE.7030800@linux.intel.com> (raw)
In-Reply-To: <1455062707-30895-1-git-send-email-yu.dai@intel.com>
Hi,
On 10/02/16 00:05, yu.dai@intel.com wrote:
> From: Alex Dai <yu.dai@intel.com>
>
> The cached work queue header pointer is set to last byte of work
> queue buffer. It will make sure the whole work queue buffer is
> available after coming back from reset or init.
>
> Do not hold kmap_atomic mapping before going to sleep when work
> queue is full.
Could you please split this into two patches? They are two completely
separate issues and it is customary to do so.
For the kmap_atomic issue you can also reference
https://bugs.freedesktop.org/show_bug.cgi?id=93847 in the commit message.
> Signed-off-by: Alex Dai <yu.dai@intel.com>
> ---
> drivers/gpu/drm/i915/i915_guc_submission.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
> index d7543ef..41f4a96 100644
> --- a/drivers/gpu/drm/i915/i915_guc_submission.c
> +++ b/drivers/gpu/drm/i915/i915_guc_submission.c
> @@ -486,11 +486,11 @@ int i915_guc_wq_check_space(struct i915_guc_client *gc)
> if (CIRC_SPACE(gc->wq_tail, gc->wq_head, gc->wq_size) >= size)
> return 0;
>
> - base = kmap_atomic(i915_gem_object_get_page(gc->client_obj, 0));
> - desc = base + gc->proc_desc_offset;
> -
> while (timeout_counter-- > 0) {
> + base = kmap_atomic(i915_gem_object_get_page(gc->client_obj, 0));
> + desc = base + gc->proc_desc_offset;
> gc->wq_head = desc->head;
> + kunmap_atomic(base);
>
> if (CIRC_SPACE(gc->wq_tail, gc->wq_head, gc->wq_size) >= size) {
> ret = 0;
> @@ -501,8 +501,6 @@ int i915_guc_wq_check_space(struct i915_guc_client *gc)
> usleep_range(1000, 2000);
> };
>
> - kunmap_atomic(base);
> -
> return ret;
> }
This part is OK to extinguish this fire. But in general you could also
consider caching the kmap in the client since it looks to me that object
is persistently pinned for its lifetime. So kmap_atomic just complicates
things.
> @@ -730,6 +728,8 @@ static struct i915_guc_client *guc_client_alloc(struct drm_device *dev,
> client->client_obj = obj;
> client->wq_offset = GUC_DB_SIZE;
> client->wq_size = GUC_WQ_SIZE;
> + client->wq_head = GUC_WQ_SIZE - 1;
> + client->wq_tail = 0;
>
> client->doorbell_offset = select_doorbell_cacheline(guc);
>
>
This one I can't really figure out without I suppose knowing more about
the code design. How come it was OK when it was zero (apart after reset)?
The value is otherwise only updated from the GuC shared page and a
driver does not appear to modify it. Perhaps just a better commit
message to explain things?
Perhaps
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-02-10 17:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-10 0:05 [PATCH] drm/i915/guc: Set init value for cached work queue head yu.dai
2016-02-10 8:49 ` ✗ Fi.CI.BAT: warning for " Patchwork
2016-02-10 17:30 ` Tvrtko Ursulin [this message]
2016-02-10 20:31 ` [PATCH] " Yu Dai
2016-02-15 15:01 ` Dave Gordon
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=56BB73CE.7030800@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=intel-gfx@lists.freedesktop.org \
--cc=yu.dai@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).