diff options
| author | Ping Gao <ping.a.gao@intel.com> | 2017-04-19 02:02:31 -0400 |
|---|---|---|
| committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2017-05-09 23:14:10 -0400 |
| commit | ae157902aea13926e9596d091cad6bd87b3be084 (patch) | |
| tree | 51fdf444cea44fc1617562b89c98f1e8abac505c | |
| parent | 2345ab1df8a9aa3cdca942142b48eb141faeb1c3 (diff) | |
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: Ping Gao <ping.a.gao@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
| -rw-r--r-- | drivers/gpu/drm/i915/gvt/sched_policy.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c index 34b9acdf3479..6ac77f8cc405 100644 --- a/drivers/gpu/drm/i915/gvt/sched_policy.c +++ b/drivers/gpu/drm/i915/gvt/sched_policy.c | |||
| @@ -53,9 +53,13 @@ static void try_to_schedule_next_vgpu(struct intel_gvt *gvt) | |||
| 53 | enum intel_engine_id i; | 53 | enum intel_engine_id i; |
| 54 | struct intel_engine_cs *engine; | 54 | struct intel_engine_cs *engine; |
| 55 | 55 | ||
| 56 | /* no target to schedule */ | 56 | /* no need to schedule if next_vgpu is the same with current_vgpu, |
| 57 | if (!scheduler->next_vgpu) | 57 | * let scheduler chose next_vgpu again by setting it to NULL. |
| 58 | */ | ||
| 59 | if (scheduler->next_vgpu == scheduler->current_vgpu) { | ||
| 60 | scheduler->next_vgpu = NULL; | ||
| 58 | return; | 61 | return; |
| 62 | } | ||
| 59 | 63 | ||
| 60 | gvt_dbg_sched("try to schedule next vgpu %d\n", | 64 | gvt_dbg_sched("try to schedule next vgpu %d\n", |
| 61 | scheduler->next_vgpu->id); | 65 | scheduler->next_vgpu->id); |
