* [PATCH] drm/i915/guc: don't hardcode BCS0 in guc_hang selftest
@ 2022-11-02 21:43 Daniele Ceraolo Spurio
2022-11-03 0:34 ` John Harrison
2022-11-03 9:10 ` Das, Nirmoy
0 siblings, 2 replies; 3+ messages in thread
From: Daniele Ceraolo Spurio @ 2022-11-02 21:43 UTC (permalink / raw)
To: intel-gfx; +Cc: Daniele Ceraolo Spurio, John Harrison, dri-devel
On MTL there are no BCS engines on the media GT, so we can't always use
BCS0 in the test. There is no actual reason to use a BCS engine over an
engine of a different class, so switch to using any available engine.
Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: John Harrison <John.C.Harrison@Intel.com>
---
drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c b/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c
index 01f8cd3c3134..d91b58f70403 100644
--- a/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c
+++ b/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c
@@ -35,11 +35,14 @@ static int intel_hang_guc(void *arg)
struct i915_request *rq;
intel_wakeref_t wakeref;
struct i915_gpu_error *global = >->i915->gpu_error;
- struct intel_engine_cs *engine;
+ struct intel_engine_cs *engine = intel_selftest_find_any_engine(gt);
unsigned int reset_count;
u32 guc_status;
u32 old_beat;
+ if (!engine)
+ return 0;
+
ctx = kernel_context(gt->i915, NULL);
if (IS_ERR(ctx)) {
drm_err(>->i915->drm, "Failed get kernel context: %ld\n", PTR_ERR(ctx));
@@ -48,14 +51,13 @@ static int intel_hang_guc(void *arg)
wakeref = intel_runtime_pm_get(gt->uncore->rpm);
- ce = intel_context_create(gt->engine[BCS0]);
+ ce = intel_context_create(engine);
if (IS_ERR(ce)) {
ret = PTR_ERR(ce);
drm_err(>->i915->drm, "Failed to create spinner request: %d\n", ret);
goto err;
}
- engine = ce->engine;
reset_count = i915_reset_count(global);
old_beat = engine->props.heartbeat_interval_ms;
--
2.37.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915/guc: don't hardcode BCS0 in guc_hang selftest
2022-11-02 21:43 [PATCH] drm/i915/guc: don't hardcode BCS0 in guc_hang selftest Daniele Ceraolo Spurio
@ 2022-11-03 0:34 ` John Harrison
2022-11-03 9:10 ` Das, Nirmoy
1 sibling, 0 replies; 3+ messages in thread
From: John Harrison @ 2022-11-03 0:34 UTC (permalink / raw)
To: Daniele Ceraolo Spurio, intel-gfx; +Cc: dri-devel
On 11/2/2022 14:43, Daniele Ceraolo Spurio wrote:
> On MTL there are no BCS engines on the media GT, so we can't always use
> BCS0 in the test. There is no actual reason to use a BCS engine over an
> engine of a different class, so switch to using any available engine.
>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
Reviewed-by: John Harrison <John.C.Harrison@Intel.com>
> ---
> drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c b/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c
> index 01f8cd3c3134..d91b58f70403 100644
> --- a/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c
> +++ b/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c
> @@ -35,11 +35,14 @@ static int intel_hang_guc(void *arg)
> struct i915_request *rq;
> intel_wakeref_t wakeref;
> struct i915_gpu_error *global = >->i915->gpu_error;
> - struct intel_engine_cs *engine;
> + struct intel_engine_cs *engine = intel_selftest_find_any_engine(gt);
> unsigned int reset_count;
> u32 guc_status;
> u32 old_beat;
>
> + if (!engine)
> + return 0;
> +
> ctx = kernel_context(gt->i915, NULL);
> if (IS_ERR(ctx)) {
> drm_err(>->i915->drm, "Failed get kernel context: %ld\n", PTR_ERR(ctx));
> @@ -48,14 +51,13 @@ static int intel_hang_guc(void *arg)
>
> wakeref = intel_runtime_pm_get(gt->uncore->rpm);
>
> - ce = intel_context_create(gt->engine[BCS0]);
> + ce = intel_context_create(engine);
> if (IS_ERR(ce)) {
> ret = PTR_ERR(ce);
> drm_err(>->i915->drm, "Failed to create spinner request: %d\n", ret);
> goto err;
> }
>
> - engine = ce->engine;
> reset_count = i915_reset_count(global);
>
> old_beat = engine->props.heartbeat_interval_ms;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] drm/i915/guc: don't hardcode BCS0 in guc_hang selftest
2022-11-02 21:43 [PATCH] drm/i915/guc: don't hardcode BCS0 in guc_hang selftest Daniele Ceraolo Spurio
2022-11-03 0:34 ` John Harrison
@ 2022-11-03 9:10 ` Das, Nirmoy
1 sibling, 0 replies; 3+ messages in thread
From: Das, Nirmoy @ 2022-11-03 9:10 UTC (permalink / raw)
To: Daniele Ceraolo Spurio, intel-gfx; +Cc: dri-devel
LGTM Acked-by: Nirmoy Das <nirmoy.das@intel.com>
On 11/2/2022 10:43 PM, Daniele Ceraolo Spurio wrote:
> On MTL there are no BCS engines on the media GT, so we can't always use
> BCS0 in the test. There is no actual reason to use a BCS engine over an
> engine of a different class, so switch to using any available engine.
>
> Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
> Cc: John Harrison <John.C.Harrison@Intel.com>
> ---
> drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c b/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c
> index 01f8cd3c3134..d91b58f70403 100644
> --- a/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c
> +++ b/drivers/gpu/drm/i915/gt/uc/selftest_guc_hangcheck.c
> @@ -35,11 +35,14 @@ static int intel_hang_guc(void *arg)
> struct i915_request *rq;
> intel_wakeref_t wakeref;
> struct i915_gpu_error *global = >->i915->gpu_error;
> - struct intel_engine_cs *engine;
> + struct intel_engine_cs *engine = intel_selftest_find_any_engine(gt);
> unsigned int reset_count;
> u32 guc_status;
> u32 old_beat;
>
> + if (!engine)
> + return 0;
> +
> ctx = kernel_context(gt->i915, NULL);
> if (IS_ERR(ctx)) {
> drm_err(>->i915->drm, "Failed get kernel context: %ld\n", PTR_ERR(ctx));
> @@ -48,14 +51,13 @@ static int intel_hang_guc(void *arg)
>
> wakeref = intel_runtime_pm_get(gt->uncore->rpm);
>
> - ce = intel_context_create(gt->engine[BCS0]);
> + ce = intel_context_create(engine);
> if (IS_ERR(ce)) {
> ret = PTR_ERR(ce);
> drm_err(>->i915->drm, "Failed to create spinner request: %d\n", ret);
> goto err;
> }
>
> - engine = ce->engine;
> reset_count = i915_reset_count(global);
>
> old_beat = engine->props.heartbeat_interval_ms;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-03 9:10 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 21:43 [PATCH] drm/i915/guc: don't hardcode BCS0 in guc_hang selftest Daniele Ceraolo Spurio
2022-11-03 0:34 ` John Harrison
2022-11-03 9:10 ` Das, Nirmoy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).