11
11
#include "i915_selftest.h"
12
12
#include "selftest_engine_heartbeat.h"
13
13
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
+
14
20
static int timeline_sync (struct intel_timeline * tl )
15
21
{
16
22
struct dma_fence * fence ;
@@ -269,7 +275,7 @@ static int __live_heartbeat_fast(struct intel_engine_cs *engine)
269
275
err = - EINVAL ;
270
276
}
271
277
272
- intel_engine_set_heartbeat (engine , CONFIG_DRM_I915_HEARTBEAT_INTERVAL );
278
+ reset_heartbeat (engine );
273
279
err_pm :
274
280
intel_engine_pm_put (engine );
275
281
intel_context_put (ce );
@@ -284,7 +290,7 @@ static int live_heartbeat_fast(void *arg)
284
290
int err = 0 ;
285
291
286
292
/* 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 ) )
288
294
return 0 ;
289
295
290
296
for_each_engine (engine , gt , id ) {
@@ -332,7 +338,7 @@ static int __live_heartbeat_off(struct intel_engine_cs *engine)
332
338
}
333
339
334
340
err_beat :
335
- intel_engine_set_heartbeat (engine , CONFIG_DRM_I915_HEARTBEAT_INTERVAL );
341
+ reset_heartbeat (engine );
336
342
err_pm :
337
343
intel_engine_pm_put (engine );
338
344
return err ;
@@ -346,7 +352,7 @@ static int live_heartbeat_off(void *arg)
346
352
int err = 0 ;
347
353
348
354
/* 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 ) )
350
356
return 0 ;
351
357
352
358
for_each_engine (engine , gt , id ) {
0 commit comments