drm/i915/gvt: Don't mark vgpu context as inactive when preempted
authorZhenyu Wang <zhenyuw@linux.intel.com>
Fri, 1 Dec 2017 06:59:53 +0000 (14:59 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Wed, 6 Dec 2017 03:34:10 +0000 (11:34 +0800)
We shouldn't mark inactive for vGPU context if preempted,
which would still be re-scheduled later. So keep active state.

Fixes: d6c0511300dc ("drm/i915/execlists: Distinguish the incomplete context notifies")
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
(cherry picked from commit da5f99eaccc10e30bf82eb02b1be74703b878720)

drivers/gpu/drm/i915/gvt/scheduler.c

index a63787be1e6b0513c4f8e43c750ee20840a082df..ab3d041ee5f994e4b9bf4063b3007d484a6cd20b 100644 (file)
@@ -189,10 +189,12 @@ static int shadow_context_status_change(struct notifier_block *nb,
                atomic_set(&workload->shadow_ctx_active, 1);
                break;
        case INTEL_CONTEXT_SCHEDULE_OUT:
-       case INTEL_CONTEXT_SCHEDULE_PREEMPTED:
                save_ring_hw_state(workload->vgpu, ring_id);
                atomic_set(&workload->shadow_ctx_active, 0);
                break;
+       case INTEL_CONTEXT_SCHEDULE_PREEMPTED:
+               save_ring_hw_state(workload->vgpu, ring_id);
+               break;
        default:
                WARN_ON(1);
                return NOTIFY_OK;