summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/gvt
diff options
context:
space:
mode:
authorPing Gao <ping.a.gao@intel.com>2017-04-19 14:02:31 +0800
committerZhenyu Wang <zhenyuw@linux.intel.com>2017-05-10 11:14:10 +0800
commitae157902aea13926e9596d091cad6bd87b3be084 (patch)
tree51fdf444cea44fc1617562b89c98f1e8abac505c /drivers/gpu/drm/i915/gvt
parent2345ab1df8a9aa3cdca942142b48eb141faeb1c3 (diff)
downloadlinux-ae157902aea13926e9596d091cad6bd87b3be084.tar.bz2
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>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt')
-rw-r--r--drivers/gpu/drm/i915/gvt/sched_policy.c8
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)
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);