Lines Matching refs:engine
14 static void reset_heartbeat(struct intel_engine_cs *engine) in reset_heartbeat() argument
16 intel_engine_set_heartbeat(engine, in reset_heartbeat()
17 engine->defaults.heartbeat_interval_ms); in reset_heartbeat()
37 static int engine_sync_barrier(struct intel_engine_cs *engine) in engine_sync_barrier() argument
39 return timeline_sync(engine->kernel_context->timeline); in engine_sync_barrier()
90 static int __live_idle_pulse(struct intel_engine_cs *engine, in __live_idle_pulse() argument
96 GEM_BUG_ON(!intel_engine_pm_is_awake(engine)); in __live_idle_pulse()
106 err = i915_active_acquire_preallocate_barrier(&p->active, engine); in __live_idle_pulse()
116 GEM_BUG_ON(llist_empty(&engine->barrier_tasks)); in __live_idle_pulse()
118 err = fn(engine); in __live_idle_pulse()
122 GEM_BUG_ON(!llist_empty(&engine->barrier_tasks)); in __live_idle_pulse()
124 if (engine_sync_barrier(engine)) { in __live_idle_pulse()
127 pr_err("%s: no heartbeat pulse?\n", engine->name); in __live_idle_pulse()
128 intel_engine_dump(engine, &m, "%s", engine->name); in __live_idle_pulse()
134 GEM_BUG_ON(READ_ONCE(engine->serial) != engine->wakeref_serial); in __live_idle_pulse()
142 engine->name); in __live_idle_pulse()
157 struct intel_engine_cs *engine; in live_idle_flush() local
163 for_each_engine(engine, gt, id) { in live_idle_flush()
164 st_engine_heartbeat_disable(engine); in live_idle_flush()
165 err = __live_idle_pulse(engine, intel_engine_flush_barriers); in live_idle_flush()
166 st_engine_heartbeat_enable(engine); in live_idle_flush()
177 struct intel_engine_cs *engine; in live_idle_pulse() local
183 for_each_engine(engine, gt, id) { in live_idle_pulse()
184 st_engine_heartbeat_disable(engine); in live_idle_pulse()
185 err = __live_idle_pulse(engine, intel_engine_pulse); in live_idle_pulse()
186 st_engine_heartbeat_enable(engine); in live_idle_pulse()
203 static int __live_heartbeat_fast(struct intel_engine_cs *engine) in __live_heartbeat_fast() argument
213 ce = intel_context_create(engine); in __live_heartbeat_fast()
217 intel_engine_pm_get(engine); in __live_heartbeat_fast()
219 err = intel_engine_set_heartbeat(engine, 1); in __live_heartbeat_fast()
226 intel_engine_park_heartbeat(engine); in __live_heartbeat_fast()
227 GEM_BUG_ON(engine->heartbeat.systole); in __live_heartbeat_fast()
228 engine->serial++; /* pretend we are not idle! */ in __live_heartbeat_fast()
229 intel_engine_unpark_heartbeat(engine); in __live_heartbeat_fast()
231 flush_delayed_work(&engine->heartbeat.work); in __live_heartbeat_fast()
232 if (!delayed_work_pending(&engine->heartbeat.work)) { in __live_heartbeat_fast()
234 engine->name, i); in __live_heartbeat_fast()
240 rq = READ_ONCE(engine->heartbeat.systole); in __live_heartbeat_fast()
247 while (rq == READ_ONCE(engine->heartbeat.systole)) in __live_heartbeat_fast()
258 engine->name, in __live_heartbeat_fast()
272 engine->name, in __live_heartbeat_fast()
278 reset_heartbeat(engine); in __live_heartbeat_fast()
280 intel_engine_pm_put(engine); in __live_heartbeat_fast()
288 struct intel_engine_cs *engine; in live_heartbeat_fast() local
296 for_each_engine(engine, gt, id) { in live_heartbeat_fast()
297 err = __live_heartbeat_fast(engine); in live_heartbeat_fast()
305 static int __live_heartbeat_off(struct intel_engine_cs *engine) in __live_heartbeat_off() argument
309 intel_engine_pm_get(engine); in __live_heartbeat_off()
311 engine->serial++; in __live_heartbeat_off()
312 flush_delayed_work(&engine->heartbeat.work); in __live_heartbeat_off()
313 if (!delayed_work_pending(&engine->heartbeat.work)) { in __live_heartbeat_off()
315 engine->name); in __live_heartbeat_off()
320 err = intel_engine_set_heartbeat(engine, 0); in __live_heartbeat_off()
324 engine->serial++; in __live_heartbeat_off()
325 flush_delayed_work(&engine->heartbeat.work); in __live_heartbeat_off()
326 if (delayed_work_pending(&engine->heartbeat.work)) { in __live_heartbeat_off()
328 engine->name); in __live_heartbeat_off()
333 if (READ_ONCE(engine->heartbeat.systole)) { in __live_heartbeat_off()
335 engine->name); in __live_heartbeat_off()
341 reset_heartbeat(engine); in __live_heartbeat_off()
343 intel_engine_pm_put(engine); in __live_heartbeat_off()
350 struct intel_engine_cs *engine; in live_heartbeat_off() local
358 for_each_engine(engine, gt, id) { in live_heartbeat_off()
359 if (!intel_engine_has_preemption(engine)) in live_heartbeat_off()
362 err = __live_heartbeat_off(engine); in live_heartbeat_off()
393 void st_engine_heartbeat_disable(struct intel_engine_cs *engine) in st_engine_heartbeat_disable() argument
395 engine->props.heartbeat_interval_ms = 0; in st_engine_heartbeat_disable()
397 intel_engine_pm_get(engine); in st_engine_heartbeat_disable()
398 intel_engine_park_heartbeat(engine); in st_engine_heartbeat_disable()
401 void st_engine_heartbeat_enable(struct intel_engine_cs *engine) in st_engine_heartbeat_enable() argument
403 intel_engine_pm_put(engine); in st_engine_heartbeat_enable()
405 engine->props.heartbeat_interval_ms = in st_engine_heartbeat_enable()
406 engine->defaults.heartbeat_interval_ms; in st_engine_heartbeat_enable()
409 void st_engine_heartbeat_disable_no_pm(struct intel_engine_cs *engine) in st_engine_heartbeat_disable_no_pm() argument
411 engine->props.heartbeat_interval_ms = 0; in st_engine_heartbeat_disable_no_pm()
419 if (intel_engine_pm_get_if_awake(engine)) { in st_engine_heartbeat_disable_no_pm()
420 intel_engine_park_heartbeat(engine); in st_engine_heartbeat_disable_no_pm()
421 intel_engine_pm_put(engine); in st_engine_heartbeat_disable_no_pm()
425 void st_engine_heartbeat_enable_no_pm(struct intel_engine_cs *engine) in st_engine_heartbeat_enable_no_pm() argument
427 engine->props.heartbeat_interval_ms = in st_engine_heartbeat_enable_no_pm()
428 engine->defaults.heartbeat_interval_ms; in st_engine_heartbeat_enable_no_pm()