Skip to content

Commit

Permalink
drm/i915/gvt: avoid unnecessary vgpu switch
Browse files Browse the repository at this point in the history
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: Ping Gao <[email protected]>
Signed-off-by: Zhenyu Wang <[email protected]>
  • Loading branch information
Ping Gao authored and zhenyw committed May 10, 2017
1 parent 2345ab1 commit ae15790
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/gpu/drm/i915/gvt/sched_policy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ae15790

Please sign in to comment.