Re: [PATCH 09/12] drm/i915/selftest: Cope with not having an RCS engine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 12, 2022 at 04:31:33PM -0700, John.C.Harrison@xxxxxxxxx wrote:
> From: John Harrison <John.C.Harrison@xxxxxxxxx>
> 
> It is no longer guaranteed that there will always be an RCS engine.
> So, use the helper function for finding the first available engine that
> can be used for general purpose selftets.
> 
> Signed-off-by: John Harrison <John.C.Harrison@xxxxxxxxx>

Reviewed-by: Matthew Brost <matthew.brost@xxxxxxxxx>

> ---
>  drivers/gpu/drm/i915/gt/selftest_hangcheck.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
> index 6493265d5f642..7f3bb1d34dfbf 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_hangcheck.c
> @@ -1302,13 +1302,15 @@ static int igt_reset_wait(void *arg)
>  {
>  	struct intel_gt *gt = arg;
>  	struct i915_gpu_error *global = &gt->i915->gpu_error;
> -	struct intel_engine_cs *engine = gt->engine[RCS0];
> +	struct intel_engine_cs *engine;
>  	struct i915_request *rq;
>  	unsigned int reset_count;
>  	struct hang h;
>  	long timeout;
>  	int err;
>  
> +	engine = intel_selftest_find_any_engine(gt);
> +
>  	if (!engine || !intel_engine_can_store_dword(engine))
>  		return 0;
>  
> @@ -1432,7 +1434,7 @@ static int __igt_reset_evict_vma(struct intel_gt *gt,
>  				 int (*fn)(void *),
>  				 unsigned int flags)
>  {
> -	struct intel_engine_cs *engine = gt->engine[RCS0];
> +	struct intel_engine_cs *engine;
>  	struct drm_i915_gem_object *obj;
>  	struct task_struct *tsk = NULL;
>  	struct i915_request *rq;
> @@ -1444,6 +1446,8 @@ static int __igt_reset_evict_vma(struct intel_gt *gt,
>  	if (!gt->ggtt->num_fences && flags & EXEC_OBJECT_NEEDS_FENCE)
>  		return 0;
>  
> +	engine = intel_selftest_find_any_engine(gt);
> +
>  	if (!engine || !intel_engine_can_store_dword(engine))
>  		return 0;
>  
> @@ -1819,12 +1823,14 @@ static int igt_handle_error(void *arg)
>  {
>  	struct intel_gt *gt = arg;
>  	struct i915_gpu_error *global = &gt->i915->gpu_error;
> -	struct intel_engine_cs *engine = gt->engine[RCS0];
> +	struct intel_engine_cs *engine;
>  	struct hang h;
>  	struct i915_request *rq;
>  	struct i915_gpu_coredump *error;
>  	int err;
>  
> +	engine = intel_selftest_find_any_engine(gt);
> +
>  	/* Check that we can issue a global GPU and engine reset */
>  
>  	if (!intel_has_reset_engine(gt))
> -- 
> 2.36.0
> 



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux