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

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

drm/i915/gvt: avoid unnecessary vgpu switch



It's no need to switch vgpu if next vgpu is the same with current
vgpu, otherwise it will make performance drop in some case.

v2: correct the comments.

Signed-off-by: default avatarPing Gao <ping.a.gao@intel.com>
Signed-off-by: default avatarZhenyu Wang <zhenyuw@linux.intel.com>
parent 2345ab1d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -53,9 +53,13 @@ static void try_to_schedule_next_vgpu(struct intel_gvt *gvt)
	enum intel_engine_id i;
	struct intel_engine_cs *engine;

	/* no target to schedule */
	if (!scheduler->next_vgpu)
	/* no need to schedule if next_vgpu is the same with current_vgpu,
	 * let scheduler chose next_vgpu again by setting it to NULL.
	 */
	if (scheduler->next_vgpu == scheduler->current_vgpu) {
		scheduler->next_vgpu = NULL;
		return;
	}

	gvt_dbg_sched("try to schedule next vgpu %d\n",
			scheduler->next_vgpu->id);