All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Dave Gordon <david.s.gordon@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/5] drm/i915/guc: add engine mask to GuC client & pass to GuC
Date: Tue, 19 Jul 2016 16:06:22 +0100	[thread overview]
Message-ID: <578E41EE.5040005@linux.intel.com> (raw)
In-Reply-To: <1468933157-22412-4-git-send-email-david.s.gordon@intel.com>


On 19/07/16 13:59, Dave Gordon wrote:
> The Context Descriptor passed by the kernel to the GuC contains a field
> specifying which engine(s) the context will use. Historically, this was
> always set to "all of them", but now that we have one client per engine,
> we can be more precise, and set only the single bit for the engine that
> the client is associated with.
>
> Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
> ---
>   drivers/gpu/drm/i915/i915_guc_submission.c | 15 ++++++++++-----
>   drivers/gpu/drm/i915/intel_guc.h           |  3 ++-
>   2 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
> index b0f9945..4daba77 100644
> --- a/drivers/gpu/drm/i915/i915_guc_submission.c
> +++ b/drivers/gpu/drm/i915/i915_guc_submission.c
> @@ -340,7 +340,7 @@ static void guc_init_ctx_desc(struct intel_guc *guc,
>   	desc.priority = client->priority;
>   	desc.db_id = client->doorbell_id;
>
> -	for_each_engine(engine, dev_priv) {
> +	for_each_engine_masked(engine, dev_priv, client->engines) {
>   		struct intel_context *ce = &ctx->engine[engine->id];
>   		struct guc_execlist_context *lrc = &desc.lrc[engine->guc_id];
>   		struct drm_i915_gem_object *obj;
> @@ -374,6 +374,8 @@ static void guc_init_ctx_desc(struct intel_guc *guc,
>   		desc.engines_used |= (1 << engine->guc_id);
>   	}
>
> +	DRM_DEBUG_DRIVER("Host engines 0x%x => GuC engines used 0x%x\n",
> +			client->engines, desc.engines_used);
>   	WARN_ON(desc.engines_used == 0);
>
>   	/*
> @@ -768,6 +770,7 @@ static void guc_init_doorbell_hw(struct intel_guc *guc)
>    */
>   static struct i915_guc_client *
>   guc_client_alloc(struct drm_i915_private *dev_priv,
> +		 uint32_t engines,
>   		 uint32_t priority,
>   		 struct i915_gem_context *ctx)
>   {
> @@ -780,10 +783,11 @@ static void guc_init_doorbell_hw(struct intel_guc *guc)
>   	if (!client)
>   		return NULL;
>
> -	client->doorbell_id = GUC_INVALID_DOORBELL_ID;
> -	client->priority = priority;
>   	client->owner = ctx;
>   	client->guc = guc;
> +	client->engines = engines;
> +	client->priority = priority;
> +	client->doorbell_id = GUC_INVALID_DOORBELL_ID;
>
>   	client->ctx_index = (uint32_t)ida_simple_get(&guc->ctx_ids, 0,
>   			GUC_MAX_GPU_CONTEXTS, GFP_KERNEL);
> @@ -825,8 +829,8 @@ static void guc_init_doorbell_hw(struct intel_guc *guc)
>   	if (guc_init_doorbell(guc, client, db_id))
>   		goto err;
>
> -	DRM_DEBUG_DRIVER("new priority %u client %p: ctx_index %u\n",
> -		priority, client, client->ctx_index);
> +	DRM_DEBUG_DRIVER("new priority %u client %p for engine(s) 0x%x: ctx_index %u\n",
> +		priority, client, client->engines, client->ctx_index);
>   	DRM_DEBUG_DRIVER("doorbell id %u, cacheline offset 0x%x\n",
>   		client->doorbell_id, client->doorbell_offset);
>
> @@ -1011,6 +1015,7 @@ int i915_guc_submission_enable(struct drm_i915_private *dev_priv)
>   	for_each_engine(engine, dev_priv) {
>   		/* client for execbuf submission */
>   		client = guc_client_alloc(dev_priv,
> +					  intel_engine_flag(engine),
>   					  GUC_CTX_PRIORITY_KMD_NORMAL,
>   					  dev_priv->kernel_context);
>   		if (!client) {
> diff --git a/drivers/gpu/drm/i915/intel_guc.h b/drivers/gpu/drm/i915/intel_guc.h
> index 7b4cc4d..53d41b5 100644
> --- a/drivers/gpu/drm/i915/intel_guc.h
> +++ b/drivers/gpu/drm/i915/intel_guc.h
> @@ -67,6 +67,8 @@ struct i915_guc_client {
>   	void *client_base;		/* first page (only) of above	*/
>   	struct i915_gem_context *owner;
>   	struct intel_guc *guc;
> +
> +	uint32_t engines;		/* bitmap of (host) engine ids	*/
>   	uint32_t priority;
>   	uint32_t ctx_index;
>
> @@ -79,7 +81,6 @@ struct i915_guc_client {
>   	uint32_t wq_offset;
>   	uint32_t wq_size;
>   	uint32_t wq_tail;
> -	uint32_t unused;		/* Was 'wq_head'		*/
>
>   	uint32_t no_wq_space;
>   	uint32_t q_fail;		/* No longer used		*/
>

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:[~2016-07-19 15:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-19 12:59 [PATCH 1/5] drm/i915/guc: doorbell reset should avoid used doorbells Dave Gordon
2016-07-19 12:59 ` [PATCH 2/5] drm/i915/guc: refactor guc_init_doorbell_hw() Dave Gordon
2016-07-19 14:51   ` Tvrtko Ursulin
2016-07-19 12:59 ` [PATCH 3/5] drm/i915/guc: use a separate GuC client for each engine Dave Gordon
2016-07-19 15:02   ` Tvrtko Ursulin
2016-07-19 15:13     ` Dave Gordon
2016-07-19 12:59 ` [PATCH 4/5] drm/i915/guc: add engine mask to GuC client & pass to GuC Dave Gordon
2016-07-19 15:06   ` Tvrtko Ursulin [this message]
2016-07-27 20:06   ` kbuild test robot
2016-07-19 12:59 ` [PATCH 5/5] drm/i915/guc: use for_each_engine_id() where appropriate Dave Gordon
2016-07-19 15:09   ` Tvrtko Ursulin
2016-07-19 14:16 ` ✗ Ro.CI.BAT: failure for series starting with [1/5] drm/i915/guc: doorbell reset should avoid used doorbells Patchwork
2016-07-19 15:07   ` Dave Gordon
2016-07-19 14:43 ` [PATCH 1/5] " 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=578E41EE.5040005@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.