Lines Matching full:engine
20 static void intel_gsc_idle_msg_enable(struct intel_engine_cs *engine) in intel_gsc_idle_msg_enable() argument
22 struct drm_i915_private *i915 = engine->i915; in intel_gsc_idle_msg_enable()
24 if (MEDIA_VER(i915) >= 13 && engine->id == GSC0) { in intel_gsc_idle_msg_enable()
25 intel_uncore_write(engine->gt->uncore, in intel_gsc_idle_msg_enable()
29 intel_uncore_write(engine->gt->uncore, in intel_gsc_idle_msg_enable()
42 int type = intel_gt_coherent_map_type(ce->engine->gt, obj, true); in dbg_poison_ce()
60 struct intel_engine_cs *engine = in __engine_unpark() local
61 container_of(wf, typeof(*engine), wakeref); in __engine_unpark()
64 ENGINE_TRACE(engine, "\n"); in __engine_unpark()
66 engine->wakeref_track = intel_gt_pm_get(engine->gt); in __engine_unpark()
69 ce = engine->kernel_context; in __engine_unpark()
75 intel_engine_flush_submission(engine); in __engine_unpark()
91 if (engine->unpark) in __engine_unpark()
92 engine->unpark(engine); in __engine_unpark()
94 intel_breadcrumbs_unpark(engine->breadcrumbs); in __engine_unpark()
95 intel_engine_unpark_heartbeat(engine); in __engine_unpark()
103 ewma__engine_latency_add(&rq->engine->latency, in duration()
111 struct intel_engine_cs *engine) in __queue_and_release_pm() argument
113 struct intel_gt_timelines *timelines = &engine->gt->timelines; in __queue_and_release_pm()
115 ENGINE_TRACE(engine, "parking\n"); in __queue_and_release_pm()
124 __intel_gt_pm_get(engine->gt); in __queue_and_release_pm()
125 rq->context->wakeref = intel_wakeref_track(&engine->gt->wakeref); in __queue_and_release_pm()
130 * engine->wakeref.counter or our timeline->active_count. in __queue_and_release_pm()
146 __intel_wakeref_defer_park(&engine->wakeref); in __queue_and_release_pm()
151 static bool switch_to_kernel_context(struct intel_engine_cs *engine) in switch_to_kernel_context() argument
153 struct intel_context *ce = engine->kernel_context; in switch_to_kernel_context()
167 if (intel_engine_uses_guc(engine)) in switch_to_kernel_context()
171 if (intel_gt_is_wedged(engine->gt)) in switch_to_kernel_context()
175 GEM_BUG_ON(ce->timeline->hwsp_ggtt != engine->status_page.vma); in switch_to_kernel_context()
178 if (engine->wakeref_serial == engine->serial) in switch_to_kernel_context()
186 * else from creating a request on this engine. This also requires in switch_to_kernel_context()
189 * This should hold true as we can only park the engine after in switch_to_kernel_context()
196 * A new gpu user will be waiting on the engine-pm to start their in switch_to_kernel_context()
197 * engine_unpark. New waiters are predicated on engine->wakeref.count in switch_to_kernel_context()
199 * engine->wakeref. in switch_to_kernel_context()
206 * engine->wakeref.count, we may see the request completion and retire in switch_to_kernel_context()
207 * it causing an underflow of the engine->wakeref. in switch_to_kernel_context()
218 engine->wakeref_serial = engine->serial + 1; in switch_to_kernel_context()
223 if (likely(!__i915_request_commit(rq))) { /* engine should be idle! */ in switch_to_kernel_context()
237 __queue_and_release_pm(rq, ce->timeline, engine); in switch_to_kernel_context()
245 static void call_idle_barriers(struct intel_engine_cs *engine) in call_idle_barriers() argument
249 llist_for_each_safe(node, next, llist_del_all(&engine->barrier_tasks)) { in call_idle_barriers()
260 struct intel_engine_cs *engine = in __engine_park() local
261 container_of(wf, typeof(*engine), wakeref); in __engine_park()
263 engine->saturated = 0; in __engine_park()
272 if (!switch_to_kernel_context(engine)) in __engine_park()
275 ENGINE_TRACE(engine, "parked\n"); in __engine_park()
277 call_idle_barriers(engine); /* cleanup after wedging */ in __engine_park()
279 intel_engine_park_heartbeat(engine); in __engine_park()
280 intel_breadcrumbs_park(engine->breadcrumbs); in __engine_park()
282 if (engine->park) in __engine_park()
283 engine->park(engine); in __engine_park()
286 intel_gt_pm_put_async(engine->gt, engine->wakeref_track); in __engine_park()
295 void intel_engine_init__pm(struct intel_engine_cs *engine) in intel_engine_init__pm() argument
297 intel_wakeref_init(&engine->wakeref, engine->i915, &wf_ops, engine->name); in intel_engine_init__pm()
298 intel_engine_init_heartbeat(engine); in intel_engine_init__pm()
300 intel_gsc_idle_msg_enable(engine); in intel_engine_init__pm()
305 * an engine.
306 * @engine: The engine whose pinned contexts we want to reset.
311 void intel_engine_reset_pinned_contexts(struct intel_engine_cs *engine) in intel_engine_reset_pinned_contexts() argument
315 list_for_each_entry(ce, &engine->pinned_contexts_list, in intel_engine_reset_pinned_contexts()
318 if (ce == engine->kernel_context) in intel_engine_reset_pinned_contexts()