Skip to content

Commit 10c5585

Browse files
ickledanvet
authored andcommitted
drm/i915/selftests: Restore previous heartbeat interval
Use the defaults we store on the engine when resetting the heartbeat as we may have had to adjust it from the config value during initialisation. Signed-off-by: Chris Wilson <[email protected]> Reviewed-by: Mika Kuoppala <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Daniel Vetter <[email protected]>
1 parent e762bdf commit 10c5585

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
#include "i915_selftest.h"
1212
#include "selftest_engine_heartbeat.h"
1313

14+
static void reset_heartbeat(struct intel_engine_cs *engine)
15+
{
16+
intel_engine_set_heartbeat(engine,
17+
engine->defaults.heartbeat_interval_ms);
18+
}
19+
1420
static int timeline_sync(struct intel_timeline *tl)
1521
{
1622
struct dma_fence *fence;
@@ -269,7 +275,7 @@ static int __live_heartbeat_fast(struct intel_engine_cs *engine)
269275
err = -EINVAL;
270276
}
271277

272-
intel_engine_set_heartbeat(engine, CONFIG_DRM_I915_HEARTBEAT_INTERVAL);
278+
reset_heartbeat(engine);
273279
err_pm:
274280
intel_engine_pm_put(engine);
275281
intel_context_put(ce);
@@ -284,7 +290,7 @@ static int live_heartbeat_fast(void *arg)
284290
int err = 0;
285291

286292
/* Check that the heartbeat ticks at the desired rate. */
287-
if (!CONFIG_DRM_I915_HEARTBEAT_INTERVAL)
293+
if (!IS_ACTIVE(CONFIG_DRM_I915_HEARTBEAT_INTERVAL))
288294
return 0;
289295

290296
for_each_engine(engine, gt, id) {
@@ -332,7 +338,7 @@ static int __live_heartbeat_off(struct intel_engine_cs *engine)
332338
}
333339

334340
err_beat:
335-
intel_engine_set_heartbeat(engine, CONFIG_DRM_I915_HEARTBEAT_INTERVAL);
341+
reset_heartbeat(engine);
336342
err_pm:
337343
intel_engine_pm_put(engine);
338344
return err;
@@ -346,7 +352,7 @@ static int live_heartbeat_off(void *arg)
346352
int err = 0;
347353

348354
/* Check that we can turn off heartbeat and not interrupt VIP */
349-
if (!CONFIG_DRM_I915_HEARTBEAT_INTERVAL)
355+
if (!IS_ACTIVE(CONFIG_DRM_I915_HEARTBEAT_INTERVAL))
350356
return 0;
351357

352358
for_each_engine(engine, gt, id) {

0 commit comments

Comments
 (0)