[Intel-gfx] [PATCH] drm/i915/selftests: Declare we allocated the guc clients

Michel Thierry michel.thierry at intel.com
Mon Nov 20 21:52:06 UTC 2017


On 11/20/2017 1:19 PM, Chris Wilson wrote:
> Silence sparse over
> 
> drivers/gpu/drm/i915/selftests/intel_guc.c:135 igt_guc_init_doorbell_hw() error: we previously assumed 'guc->execbuf_client' could be null (see line 123)
> drivers/gpu/drm/i915/selftests/intel_guc.c:142 igt_guc_init_doorbell_hw() error: we previously assumed 'guc->preempt_client' could be null (see line 123)
> 
> by asserting that we did succeed in creating the pair of clients for
> testing.
> 

Sparse isn't smart enough to see what guc_clients_destroy/_create do.

> References: 55bd6bd75717 ("drm/i915/selftests: Add a GuC doorbells selftest")
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Michel Thierry <michel.thierry at intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio at intel.com>

Anyway, thanks for fixing it and sorry for these new sparse warnings.

Reviewed-by: Michel Thierry <michel.thierry at intel.com>

> ---
>   drivers/gpu/drm/i915/selftests/intel_guc.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/selftests/intel_guc.c b/drivers/gpu/drm/i915/selftests/intel_guc.c
> index f1baeda8b4a8..7b23597858bb 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_guc.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_guc.c
> @@ -131,6 +131,8 @@ static int igt_guc_init_doorbell_hw(void *args)
>   		pr_err("Failed to create clients\n");
>   		goto unlock;
>   	}
> +	GEM_BUG_ON(!guc->execbuf_client);
> +	GEM_BUG_ON(!guc->preempt_client);
>   
>   	err = validate_client(guc->execbuf_client,
>   			      GUC_CLIENT_PRIORITY_KMD_NORMAL, false);
> 


More information about the Intel-gfx mailing list