All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 1/3] drm/i915/guc: Allow preempt-client to be NULL
Date: Wed, 31 Jan 2018 13:31:09 +0200	[thread overview]
Message-ID: <87mv0uw9he.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <20180131094703.3676-1-chris@chris-wilson.co.uk>

Chris Wilson <chris@chris-wilson.co.uk> writes:

> In the next patch, we may only conditionally allocate the preempt-client
> if there is a global preempt context and so we need to be prepared in
> case the preempt-client itself is NULL.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Michal Winiarski <michal.winiarski@intel.com>
> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: Michel Thierry <michel.thierry@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_guc_submission.c | 27 +++++++++++++++++----------
>  1 file changed, 17 insertions(+), 10 deletions(-)
>

You need to prepare the debugfs to handle the null also.

Does our simple igt/debugfs test include reading through all the nodes
it finds?

-Mika

> diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c
> index 1f3a8786bbdc..4ea65df05e02 100644
> --- a/drivers/gpu/drm/i915/intel_guc_submission.c
> +++ b/drivers/gpu/drm/i915/intel_guc_submission.c
> @@ -832,10 +832,12 @@ static int guc_clients_doorbell_init(struct intel_guc *guc)
>  	if (ret)
>  		return ret;
>  
> -	ret = create_doorbell(guc->preempt_client);
> -	if (ret) {
> -		destroy_doorbell(guc->execbuf_client);
> -		return ret;
> +	if (guc->preempt_client) {
> +		ret = create_doorbell(guc->preempt_client);
> +		if (ret) {
> +			destroy_doorbell(guc->execbuf_client);
> +			return ret;
> +		}
>  	}
>  
>  	return 0;
> @@ -848,8 +850,11 @@ static void guc_clients_doorbell_fini(struct intel_guc *guc)
>  	 * Instead of trying (in vain) to communicate with it, let's just
>  	 * cleanup the doorbell HW and our internal state.
>  	 */
> -	__destroy_doorbell(guc->preempt_client);
> -	__update_doorbell_desc(guc->preempt_client, GUC_DOORBELL_INVALID);
> +	if (guc->preempt_client) {
> +		__destroy_doorbell(guc->preempt_client);
> +		__update_doorbell_desc(guc->preempt_client,
> +				       GUC_DOORBELL_INVALID);
> +	}
>  	__destroy_doorbell(guc->execbuf_client);
>  	__update_doorbell_desc(guc->execbuf_client, GUC_DOORBELL_INVALID);
>  }
> @@ -998,10 +1003,11 @@ static void guc_clients_destroy(struct intel_guc *guc)
>  {
>  	struct intel_guc_client *client;
>  
> -	client = fetch_and_zero(&guc->execbuf_client);
> -	guc_client_free(client);
> -
>  	client = fetch_and_zero(&guc->preempt_client);
> +	if (client)
> +		guc_client_free(client);
> +
> +	client = fetch_and_zero(&guc->execbuf_client);
>  	guc_client_free(client);
>  }
>  
> @@ -1160,7 +1166,8 @@ int intel_guc_submission_enable(struct intel_guc *guc)
>  	GEM_BUG_ON(!guc->execbuf_client);
>  
>  	guc_reset_wq(guc->execbuf_client);
> -	guc_reset_wq(guc->preempt_client);
> +	if (guc->preempt_client)
> +		guc_reset_wq(guc->preempt_client);
>  
>  	err = intel_guc_sample_forcewake(guc);
>  	if (err)
> -- 
> 2.15.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

  parent reply	other threads:[~2018-01-31 11:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-31  9:47 [PATCH v2 1/3] drm/i915/guc: Allow preempt-client to be NULL Chris Wilson
2018-01-31  9:47 ` [PATCH v2 2/3] drm/i915: Move the scheduler feature bits into the purview of the engines Chris Wilson
2018-01-31 13:58   ` Mika Kuoppala
2018-02-01 18:54     ` Chris Wilson
2018-02-01 19:02     ` [PATCH v2] " Chris Wilson
2018-02-02 13:55       ` Mika Kuoppala
2018-02-02 14:06       ` Lis, Tomasz
2018-01-31  9:47 ` [PATCH v2 3/3] drm/i915: Only allocate preempt context when required Chris Wilson
2018-01-31 14:38   ` Mika Kuoppala
2018-01-31 15:25     ` Chris Wilson
2018-02-03 10:40   ` [PATCH v2] " Chris Wilson
2018-01-31 11:01 ` ✗ Fi.CI.BAT: warning for series starting with [v2,1/3] drm/i915/guc: Allow preempt-client to be NULL Patchwork
2018-01-31 11:31 ` Mika Kuoppala [this message]
2018-01-31 11:34   ` [PATCH v2 1/3] " Chris Wilson
2018-01-31 12:42     ` Mika Kuoppala
2018-01-31 12:03   ` [PATCH v2] " Chris Wilson
2018-01-31 13:14     ` Mika Kuoppala
2018-01-31 13:00 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915/guc: Allow preempt-client to be NULL (rev2) Patchwork
2018-01-31 16:44 ` ✓ Fi.CI.IGT: " Patchwork
2018-02-01 19:22 ` ✗ Fi.CI.BAT: failure for series starting with [v2] drm/i915/guc: Allow preempt-client to be NULL (rev3) Patchwork
2018-02-03 11:17 ` ✓ Fi.CI.BAT: success for series starting with [v2] drm/i915/guc: Allow preempt-client to be NULL (rev4) Patchwork
2018-02-04  6:51 ` ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2018-02-07 21:05 [PATCH v2 1/3] drm/i915/guc: Allow preempt-client to be NULL 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=87mv0uw9he.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 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.