diff options
author | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2017-10-16 20:07:35 -0400 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2017-10-16 20:07:35 -0400 |
commit | 4a18fb8d555a5299256d77d100fadbd15b1c7749 (patch) | |
tree | 9e81c919bf4061963668b2a3d8b2f3f23b87033b | |
parent | 33d930e59a98fa10a0db9f56c7fa2f21a4aef9b9 (diff) | |
parent | ba3ee00683bc2dad4c14fba805c2241ae23acff9 (diff) |
Merge tag 'gvt-fixes-2017-10-16' of https://github.com/01org/gvt-linux into drm-intel-fixes
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/d87b1644-58cc-f7a8-57f5-126fe2b1eecd@intel.com
-rw-r--r-- | drivers/gpu/drm/i915/gvt/sched_policy.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/gvt/sched_policy.c b/drivers/gpu/drm/i915/gvt/sched_policy.c index 436377da41ba..03532dfc0cd5 100644 --- a/drivers/gpu/drm/i915/gvt/sched_policy.c +++ b/drivers/gpu/drm/i915/gvt/sched_policy.c | |||
@@ -308,20 +308,8 @@ static int tbs_sched_init_vgpu(struct intel_vgpu *vgpu) | |||
308 | 308 | ||
309 | static void tbs_sched_clean_vgpu(struct intel_vgpu *vgpu) | 309 | static void tbs_sched_clean_vgpu(struct intel_vgpu *vgpu) |
310 | { | 310 | { |
311 | struct intel_gvt_workload_scheduler *scheduler = &vgpu->gvt->scheduler; | ||
312 | int ring_id; | ||
313 | |||
314 | kfree(vgpu->sched_data); | 311 | kfree(vgpu->sched_data); |
315 | vgpu->sched_data = NULL; | 312 | vgpu->sched_data = NULL; |
316 | |||
317 | spin_lock_bh(&scheduler->mmio_context_lock); | ||
318 | for (ring_id = 0; ring_id < I915_NUM_ENGINES; ring_id++) { | ||
319 | if (scheduler->engine_owner[ring_id] == vgpu) { | ||
320 | intel_gvt_switch_mmio(vgpu, NULL, ring_id); | ||
321 | scheduler->engine_owner[ring_id] = NULL; | ||
322 | } | ||
323 | } | ||
324 | spin_unlock_bh(&scheduler->mmio_context_lock); | ||
325 | } | 313 | } |
326 | 314 | ||
327 | static void tbs_sched_start_schedule(struct intel_vgpu *vgpu) | 315 | static void tbs_sched_start_schedule(struct intel_vgpu *vgpu) |
@@ -388,6 +376,7 @@ void intel_vgpu_stop_schedule(struct intel_vgpu *vgpu) | |||
388 | { | 376 | { |
389 | struct intel_gvt_workload_scheduler *scheduler = | 377 | struct intel_gvt_workload_scheduler *scheduler = |
390 | &vgpu->gvt->scheduler; | 378 | &vgpu->gvt->scheduler; |
379 | int ring_id; | ||
391 | 380 | ||
392 | gvt_dbg_core("vgpu%d: stop schedule\n", vgpu->id); | 381 | gvt_dbg_core("vgpu%d: stop schedule\n", vgpu->id); |
393 | 382 | ||
@@ -401,4 +390,13 @@ void intel_vgpu_stop_schedule(struct intel_vgpu *vgpu) | |||
401 | scheduler->need_reschedule = true; | 390 | scheduler->need_reschedule = true; |
402 | scheduler->current_vgpu = NULL; | 391 | scheduler->current_vgpu = NULL; |
403 | } | 392 | } |
393 | |||
394 | spin_lock_bh(&scheduler->mmio_context_lock); | ||
395 | for (ring_id = 0; ring_id < I915_NUM_ENGINES; ring_id++) { | ||
396 | if (scheduler->engine_owner[ring_id] == vgpu) { | ||
397 | intel_gvt_switch_mmio(vgpu, NULL, ring_id); | ||
398 | scheduler->engine_owner[ring_id] = NULL; | ||
399 | } | ||
400 | } | ||
401 | spin_unlock_bh(&scheduler->mmio_context_lock); | ||
404 | } | 402 | } |