diff options
| author | Changbin Du <changbin.du@intel.com> | 2017-03-22 00:35:31 -0400 |
|---|---|---|
| committer | Zhenyu Wang <zhenyuw@linux.intel.com> | 2017-03-22 01:18:56 -0400 |
| commit | bc2d4b62db67f817b09c782219996630e9c2f5e2 (patch) | |
| tree | 1e9800f79a9250fc5c60d7909330d577e32ad48d | |
| parent | 359b69310014511901bd61cc5f7680cb5de1faef (diff) | |
drm/i915/gvt: Use force single submit flag to distinguish gvt request from i915 request
In my previous Commit ab9da627906a ("drm/i915: make context status
notifier head be per engine") rely on scheduler->current_workload[x]
to distinguish gvt spacial request from i915 request. But this is
not always true since no synchronization between workload_thread and
lrc irq handler.
lrc irq handler workload_thread
---- ----
pick i915 requests;
intel_vgpu_submit_execlist();
current_workload[x] = xxx;
shadow_context_status_change();
Then current_workload[x] is not null but current request is of i915 self.
So instead we check ctx flag CONTEXT_FORCE_SINGLE_SUBMISSION. Only gvt
request set this flag and always set.
v2: Reverse the order of multi-condition 'if' statement.
Fixes: ab9da6279 ("drm/i915: make context status notifier head be per engine")
Signed-off-by: Changbin Du <changbin.du@intel.com>
Reviewed-by: Yulei Zhang <yulei.zhang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
| -rw-r--r-- | drivers/gpu/drm/i915/gvt/scheduler.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/gvt/scheduler.c b/drivers/gpu/drm/i915/gvt/scheduler.c index 39a83eb7aecc..d0c04155f7d5 100644 --- a/drivers/gpu/drm/i915/gvt/scheduler.c +++ b/drivers/gpu/drm/i915/gvt/scheduler.c | |||
| @@ -127,6 +127,11 @@ static int populate_shadow_context(struct intel_vgpu_workload *workload) | |||
| 127 | return 0; | 127 | return 0; |
| 128 | } | 128 | } |
| 129 | 129 | ||
| 130 | static inline bool is_gvt_request(struct drm_i915_gem_request *req) | ||
| 131 | { | ||
| 132 | return i915_gem_context_force_single_submission(req->ctx); | ||
| 133 | } | ||
| 134 | |||
| 130 | static int shadow_context_status_change(struct notifier_block *nb, | 135 | static int shadow_context_status_change(struct notifier_block *nb, |
| 131 | unsigned long action, void *data) | 136 | unsigned long action, void *data) |
| 132 | { | 137 | { |
| @@ -139,7 +144,7 @@ static int shadow_context_status_change(struct notifier_block *nb, | |||
| 139 | struct intel_vgpu_workload *workload = | 144 | struct intel_vgpu_workload *workload = |
| 140 | scheduler->current_workload[req->engine->id]; | 145 | scheduler->current_workload[req->engine->id]; |
| 141 | 146 | ||
| 142 | if (unlikely(!workload)) | 147 | if (!is_gvt_request(req) || unlikely(!workload)) |
| 143 | return NOTIFY_OK; | 148 | return NOTIFY_OK; |
| 144 | 149 | ||
| 145 | switch (action) { | 150 | switch (action) { |
