Lines Matching refs:vgpu
37 static bool vgpu_has_pending_workload(struct intel_vgpu *vgpu) in vgpu_has_pending_workload() argument
42 for_each_engine(engine, vgpu->gvt->dev_priv, i) { in vgpu_has_pending_workload()
43 if (!list_empty(workload_q_head(vgpu, i))) in vgpu_has_pending_workload()
55 struct intel_vgpu *vgpu; member
75 static void vgpu_update_timeslice(struct intel_vgpu *vgpu, ktime_t cur_time) in vgpu_update_timeslice() argument
80 if (!vgpu || vgpu == vgpu->gvt->idle_vgpu) in vgpu_update_timeslice()
83 vgpu_data = vgpu->sched_data; in vgpu_update_timeslice()
179 struct intel_vgpu *vgpu = NULL; in find_busy_vgpu() local
187 if (!vgpu_has_pending_workload(vgpu_data->vgpu)) in find_busy_vgpu()
192 vgpu = vgpu_data->vgpu; in find_busy_vgpu()
200 vgpu = vgpu_data->vgpu; in find_busy_vgpu()
205 return vgpu; in find_busy_vgpu()
216 struct intel_vgpu *vgpu = NULL; in tbs_sched_func() local
222 vgpu = find_busy_vgpu(sched_data); in tbs_sched_func()
223 if (vgpu) { in tbs_sched_func()
224 scheduler->next_vgpu = vgpu; in tbs_sched_func()
225 vgpu_data = vgpu->sched_data; in tbs_sched_func()
311 static int tbs_sched_init_vgpu(struct intel_vgpu *vgpu) in tbs_sched_init_vgpu() argument
319 data->sched_ctl.weight = vgpu->sched_ctl.weight; in tbs_sched_init_vgpu()
320 data->vgpu = vgpu; in tbs_sched_init_vgpu()
323 vgpu->sched_data = data; in tbs_sched_init_vgpu()
328 static void tbs_sched_clean_vgpu(struct intel_vgpu *vgpu) in tbs_sched_clean_vgpu() argument
330 struct intel_gvt *gvt = vgpu->gvt; in tbs_sched_clean_vgpu()
333 kfree(vgpu->sched_data); in tbs_sched_clean_vgpu()
334 vgpu->sched_data = NULL; in tbs_sched_clean_vgpu()
341 static void tbs_sched_start_schedule(struct intel_vgpu *vgpu) in tbs_sched_start_schedule() argument
343 struct gvt_sched_data *sched_data = vgpu->gvt->scheduler.sched_data; in tbs_sched_start_schedule()
344 struct vgpu_sched_data *vgpu_data = vgpu->sched_data; in tbs_sched_start_schedule()
363 static void tbs_sched_stop_schedule(struct intel_vgpu *vgpu) in tbs_sched_stop_schedule() argument
365 struct vgpu_sched_data *vgpu_data = vgpu->sched_data; in tbs_sched_stop_schedule()
406 int intel_vgpu_init_sched_policy(struct intel_vgpu *vgpu) in intel_vgpu_init_sched_policy() argument
410 mutex_lock(&vgpu->gvt->sched_lock); in intel_vgpu_init_sched_policy()
411 ret = vgpu->gvt->scheduler.sched_ops->init_vgpu(vgpu); in intel_vgpu_init_sched_policy()
412 mutex_unlock(&vgpu->gvt->sched_lock); in intel_vgpu_init_sched_policy()
417 void intel_vgpu_clean_sched_policy(struct intel_vgpu *vgpu) in intel_vgpu_clean_sched_policy() argument
419 mutex_lock(&vgpu->gvt->sched_lock); in intel_vgpu_clean_sched_policy()
420 vgpu->gvt->scheduler.sched_ops->clean_vgpu(vgpu); in intel_vgpu_clean_sched_policy()
421 mutex_unlock(&vgpu->gvt->sched_lock); in intel_vgpu_clean_sched_policy()
424 void intel_vgpu_start_schedule(struct intel_vgpu *vgpu) in intel_vgpu_start_schedule() argument
426 struct vgpu_sched_data *vgpu_data = vgpu->sched_data; in intel_vgpu_start_schedule()
428 mutex_lock(&vgpu->gvt->sched_lock); in intel_vgpu_start_schedule()
430 gvt_dbg_core("vgpu%d: start schedule\n", vgpu->id); in intel_vgpu_start_schedule()
431 vgpu->gvt->scheduler.sched_ops->start_schedule(vgpu); in intel_vgpu_start_schedule()
433 mutex_unlock(&vgpu->gvt->sched_lock); in intel_vgpu_start_schedule()
443 void intel_vgpu_stop_schedule(struct intel_vgpu *vgpu) in intel_vgpu_stop_schedule() argument
446 &vgpu->gvt->scheduler; in intel_vgpu_stop_schedule()
448 struct vgpu_sched_data *vgpu_data = vgpu->sched_data; in intel_vgpu_stop_schedule()
449 struct drm_i915_private *dev_priv = vgpu->gvt->dev_priv; in intel_vgpu_stop_schedule()
454 gvt_dbg_core("vgpu%d: stop schedule\n", vgpu->id); in intel_vgpu_stop_schedule()
456 mutex_lock(&vgpu->gvt->sched_lock); in intel_vgpu_stop_schedule()
457 scheduler->sched_ops->stop_schedule(vgpu); in intel_vgpu_stop_schedule()
459 if (scheduler->next_vgpu == vgpu) in intel_vgpu_stop_schedule()
462 if (scheduler->current_vgpu == vgpu) { in intel_vgpu_stop_schedule()
471 if (scheduler->engine_owner[ring_id] == vgpu) { in intel_vgpu_stop_schedule()
472 intel_gvt_switch_mmio(vgpu, NULL, ring_id); in intel_vgpu_stop_schedule()
478 mutex_unlock(&vgpu->gvt->sched_lock); in intel_vgpu_stop_schedule()