public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Riana Tauro <riana.tauro@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v3 1/1] drm/i915/guc/slpc: Add selftest for slpc tile-tile interaction
Date: Mon, 31 Oct 2022 05:54:51 -0400	[thread overview]
Message-ID: <Y1+ba4l6T7KttKfd@intel.com> (raw)
In-Reply-To: <20221031051411.3739031-2-riana.tauro@intel.com>

On Mon, Oct 31, 2022 at 10:44:11AM +0530, Riana Tauro wrote:
> Run a workload on tiles simultaneously by requesting for RP0 frequency.
> Pcode can however limit the frequency being granted due to throttling
> reasons. This test fails if there is any throttling

I'm not convinced we really want to sign up for that.
PCODE is the ultimate decider of the frequency and it can throttle
on our back based on the overall power conditions.

> 
> v2: Fix build error
> v3: Use IS_ERR_OR_NULL to check worker
>     Addressed cosmetic review comments (Tvrtko)

Thanks for adding the history here. no need for a cover letter
on a single stand-alone patch.

> 
> Signed-off-by: Riana Tauro <riana.tauro@intel.com>
> ---
>  drivers/gpu/drm/i915/gt/selftest_slpc.c | 60 +++++++++++++++++++++++++
>  1 file changed, 60 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gt/selftest_slpc.c b/drivers/gpu/drm/i915/gt/selftest_slpc.c
> index 82ec95a299f6..427e714b432b 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_slpc.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_slpc.c
> @@ -13,6 +13,14 @@ enum test_type {
>  	VARY_MAX,
>  	MAX_GRANTED,
>  	SLPC_POWER,
> +	TILE_INTERACTION,
> +};
> +
> +struct slpc_thread {
> +	struct kthread_worker *worker;
> +	struct kthread_work work;
> +	struct intel_gt *gt;
> +	int result;
>  };
>  
>  static int slpc_set_min_freq(struct intel_guc_slpc *slpc, u32 freq)
> @@ -310,6 +318,7 @@ static int run_test(struct intel_gt *gt, int test_type)
>  			break;
>  
>  		case MAX_GRANTED:
> +		case TILE_INTERACTION:
>  			/* Media engines have a different RP0 */
>  			if (engine->class == VIDEO_DECODE_CLASS ||
>  			    engine->class == VIDEO_ENHANCEMENT_CLASS) {
> @@ -426,6 +435,56 @@ static int live_slpc_power(void *arg)
>  	return ret;
>  }
>  
> +static void slpc_spinner_thread(struct kthread_work *work)
> +{
> +	struct slpc_thread *thread = container_of(work, typeof(*thread), work);
> +
> +	thread->result = run_test(thread->gt, TILE_INTERACTION);
> +}
> +
> +static int live_slpc_tile_interaction(void *arg)
> +{
> +	struct drm_i915_private *i915 = arg;
> +	struct intel_gt *gt;
> +	struct slpc_thread *threads;
> +	int i = 0, ret = 0;
> +
> +	threads = kcalloc(I915_MAX_GT, sizeof(*threads), GFP_KERNEL);
> +	if (!threads)
> +		return -ENOMEM;
> +
> +	for_each_gt(gt, i915, i) {
> +		threads[i].worker = kthread_create_worker(0, "igt/slpc_parallel:%d", gt->info.id);
> +
> +		if (IS_ERR(threads[i].worker)) {
> +			ret = PTR_ERR(threads[i].worker);
> +			break;
> +		}
> +
> +		threads[i].gt = gt;
> +		kthread_init_work(&threads[i].work, slpc_spinner_thread);
> +		kthread_queue_work(threads[i].worker, &threads[i].work);
> +	}
> +
> +	for_each_gt(gt, i915, i) {
> +		int status;
> +
> +		if (IS_ERR_OR_NULL(threads[i].worker))
> +			continue;
> +
> +		kthread_flush_work(&threads[i].work);
> +		status = READ_ONCE(threads[i].result);
> +		if (status && !ret) {
> +			pr_err("%s GT %d failed ", __func__, gt->info.id);
> +			ret = status;
> +		}
> +		kthread_destroy_worker(threads[i].worker);
> +	}
> +
> +	kfree(threads);
> +	return ret;
> +}
> +
>  int intel_slpc_live_selftests(struct drm_i915_private *i915)
>  {
>  	static const struct i915_subtest tests[] = {
> @@ -433,6 +492,7 @@ int intel_slpc_live_selftests(struct drm_i915_private *i915)
>  		SUBTEST(live_slpc_vary_min),
>  		SUBTEST(live_slpc_max_granted),
>  		SUBTEST(live_slpc_power),
> +		SUBTEST(live_slpc_tile_interaction),
>  	};
>  
>  	struct intel_gt *gt;
> -- 
> 2.25.1
> 

  reply	other threads:[~2022-10-31  9:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-31  5:14 [Intel-gfx] [PATCH v3 0/1] Add selftest for slpc tile interaction Riana Tauro
2022-10-31  5:14 ` [Intel-gfx] [PATCH v3 1/1] drm/i915/guc/slpc: Add selftest for slpc tile-tile interaction Riana Tauro
2022-10-31  9:54   ` Rodrigo Vivi [this message]
2022-11-04  3:28   ` Belgaumkar, Vinay
2022-10-31  6:01 ` [Intel-gfx] ✗ Fi.CI.DOCS: warning for Add selftest for slpc tile interaction (rev3) Patchwork
2022-10-31  6:23 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-10-31  9:20 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

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=Y1+ba4l6T7KttKfd@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=riana.tauro@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox