Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b35f34d1 authored by Ping Gao's avatar Ping Gao Committed by Zhenyu Wang
Browse files

drm/i915/gvt: control the scheduler by timeslice usage



The timeslice usage will determine vGPU whether has chance to
schedule or not at every vGPU switch checkpoint.

Signed-off-by: default avatarPing Gao <ping.a.gao@intel.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent afe04fbe
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -187,9 +187,12 @@ static struct intel_vgpu *find_busy_vgpu(struct gvt_sched_data *sched_data)
		if (!vgpu_has_pending_workload(vgpu_data->vgpu))
			continue;

		/* Return the vGPU only if it has time slice left */
		if (vgpu_data->left_ts > 0) {
			vgpu = vgpu_data->vgpu;
			break;
		}
	}

	return vgpu;
}
@@ -223,6 +226,8 @@ static void tbs_sched_func(struct gvt_sched_data *sched_data)
				&sched_data->lru_runq_head);

		gvt_dbg_sched("pick next vgpu %d\n", vgpu->id);
	} else {
		scheduler->next_vgpu = gvt->idle_vgpu;
	}
out:
	if (scheduler->next_vgpu) {