diff mbox series

[1/3] drm/i915/guc/slpc: Run SLPC selftests on all tiles

Message ID 20220923110043.789178-2-riana.tauro@intel.com (mailing list archive)
State New, archived
Headers show
Series Add SLPC selftest live_slpc_power | expand

Commit Message

Riana Tauro Sept. 23, 2022, 11 a.m. UTC
Run slpc selftests on all tiles

Signed-off-by: Riana Tauro <riana.tauro@intel.com>
---
 drivers/gpu/drm/i915/gt/selftest_slpc.c | 45 ++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 8 deletions(-)

Comments

Vinay Belgaumkar Sept. 26, 2022, 4:02 p.m. UTC | #1
On 9/23/2022 4:00 AM, Riana Tauro wrote:
> Run slpc selftests on all tiles
>
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>

LGTM,

Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>

> ---
>   drivers/gpu/drm/i915/gt/selftest_slpc.c | 45 ++++++++++++++++++++-----
>   1 file changed, 37 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_slpc.c b/drivers/gpu/drm/i915/gt/selftest_slpc.c
> index f8a1d27df272..928f74718881 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_slpc.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_slpc.c
> @@ -270,26 +270,50 @@ static int run_test(struct intel_gt *gt, int test_type)
>   static int live_slpc_vary_min(void *arg)
>   {
>   	struct drm_i915_private *i915 = arg;
> -	struct intel_gt *gt = to_gt(i915);
> +	struct intel_gt *gt;
> +	unsigned int i;
> +	int ret;
> +
> +	for_each_gt(gt, i915, i) {
> +		ret = run_test(gt, VARY_MIN);
> +		if (ret)
> +			return ret;
> +	}
>   
> -	return run_test(gt, VARY_MIN);
> +	return ret;
>   }
>   
>   static int live_slpc_vary_max(void *arg)
>   {
>   	struct drm_i915_private *i915 = arg;
> -	struct intel_gt *gt = to_gt(i915);
> +	struct intel_gt *gt;
> +	unsigned int i;
> +	int ret;
> +
> +	for_each_gt(gt, i915, i) {
> +		ret = run_test(gt, VARY_MAX);
> +		if (ret)
> +			return ret;
> +	}
>   
> -	return run_test(gt, VARY_MAX);
> +	return ret;
>   }
>   
>   /* check if pcode can grant RP0 */
>   static int live_slpc_max_granted(void *arg)
>   {
>   	struct drm_i915_private *i915 = arg;
> -	struct intel_gt *gt = to_gt(i915);
> +	struct intel_gt *gt;
> +	unsigned int i;
> +	int ret;
> +
> +	for_each_gt(gt, i915, i) {
> +		ret = run_test(gt, MAX_GRANTED);
> +		if (ret)
> +			return ret;
> +	}
>   
> -	return run_test(gt, MAX_GRANTED);
> +	return ret;
>   }
>   
>   int intel_slpc_live_selftests(struct drm_i915_private *i915)
> @@ -300,8 +324,13 @@ int intel_slpc_live_selftests(struct drm_i915_private *i915)
>   		SUBTEST(live_slpc_max_granted),
>   	};
>   
> -	if (intel_gt_is_wedged(to_gt(i915)))
> -		return 0;
> +	struct intel_gt *gt;
> +	unsigned int i;
> +
> +	for_each_gt(gt, i915, i) {
> +		if (intel_gt_is_wedged(gt))
> +			return 0;
> +	}
>   
>   	return i915_live_subtests(tests, i915);
>   }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/selftest_slpc.c b/drivers/gpu/drm/i915/gt/selftest_slpc.c
index f8a1d27df272..928f74718881 100644
--- a/drivers/gpu/drm/i915/gt/selftest_slpc.c
+++ b/drivers/gpu/drm/i915/gt/selftest_slpc.c
@@ -270,26 +270,50 @@  static int run_test(struct intel_gt *gt, int test_type)
 static int live_slpc_vary_min(void *arg)
 {
 	struct drm_i915_private *i915 = arg;
-	struct intel_gt *gt = to_gt(i915);
+	struct intel_gt *gt;
+	unsigned int i;
+	int ret;
+
+	for_each_gt(gt, i915, i) {
+		ret = run_test(gt, VARY_MIN);
+		if (ret)
+			return ret;
+	}
 
-	return run_test(gt, VARY_MIN);
+	return ret;
 }
 
 static int live_slpc_vary_max(void *arg)
 {
 	struct drm_i915_private *i915 = arg;
-	struct intel_gt *gt = to_gt(i915);
+	struct intel_gt *gt;
+	unsigned int i;
+	int ret;
+
+	for_each_gt(gt, i915, i) {
+		ret = run_test(gt, VARY_MAX);
+		if (ret)
+			return ret;
+	}
 
-	return run_test(gt, VARY_MAX);
+	return ret;
 }
 
 /* check if pcode can grant RP0 */
 static int live_slpc_max_granted(void *arg)
 {
 	struct drm_i915_private *i915 = arg;
-	struct intel_gt *gt = to_gt(i915);
+	struct intel_gt *gt;
+	unsigned int i;
+	int ret;
+
+	for_each_gt(gt, i915, i) {
+		ret = run_test(gt, MAX_GRANTED);
+		if (ret)
+			return ret;
+	}
 
-	return run_test(gt, MAX_GRANTED);
+	return ret;
 }
 
 int intel_slpc_live_selftests(struct drm_i915_private *i915)
@@ -300,8 +324,13 @@  int intel_slpc_live_selftests(struct drm_i915_private *i915)
 		SUBTEST(live_slpc_max_granted),
 	};
 
-	if (intel_gt_is_wedged(to_gt(i915)))
-		return 0;
+	struct intel_gt *gt;
+	unsigned int i;
+
+	for_each_gt(gt, i915, i) {
+		if (intel_gt_is_wedged(gt))
+			return 0;
+	}
 
 	return i915_live_subtests(tests, i915);
 }