mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-25 16:11:45 +00:00
drm/i915/gvt: Use fence error from GVT request for workload status
The req->fence.error will be set if this request caused GPU hang so
we can use this value to workload->status to indicate whether this
GVT request caused any problem. If it caused GPU hang, we shouldn't
trigger any context switch back to the guest.
v2:
- only take -EIO from fence->error. (Zhenyu)
Fixes: 8f1117abb4
(drm/i915/gvt: handle workload lifecycle properly)
Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
This commit is contained in:
parent
4cc74389a5
commit
0cf5ec4183
1 changed files with 12 additions and 9 deletions
|
@ -174,15 +174,6 @@ static int shadow_context_status_change(struct notifier_block *nb,
|
||||||
atomic_set(&workload->shadow_ctx_active, 1);
|
atomic_set(&workload->shadow_ctx_active, 1);
|
||||||
break;
|
break;
|
||||||
case INTEL_CONTEXT_SCHEDULE_OUT:
|
case INTEL_CONTEXT_SCHEDULE_OUT:
|
||||||
/* If the status is -EINPROGRESS means this workload
|
|
||||||
* doesn't meet any issue during dispatching so when
|
|
||||||
* get the SCHEDULE_OUT set the status to be zero for
|
|
||||||
* good. If the status is NOT -EINPROGRESS means there
|
|
||||||
* is something wrong happened during dispatching and
|
|
||||||
* the status should not be set to zero
|
|
||||||
*/
|
|
||||||
if (workload->status == -EINPROGRESS)
|
|
||||||
workload->status = 0;
|
|
||||||
atomic_set(&workload->shadow_ctx_active, 0);
|
atomic_set(&workload->shadow_ctx_active, 0);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -427,6 +418,18 @@ static void complete_current_workload(struct intel_gvt *gvt, int ring_id)
|
||||||
wait_event(workload->shadow_ctx_status_wq,
|
wait_event(workload->shadow_ctx_status_wq,
|
||||||
!atomic_read(&workload->shadow_ctx_active));
|
!atomic_read(&workload->shadow_ctx_active));
|
||||||
|
|
||||||
|
/* If this request caused GPU hang, req->fence.error will
|
||||||
|
* be set to -EIO. Use -EIO to set workload status so
|
||||||
|
* that when this request caused GPU hang, didn't trigger
|
||||||
|
* context switch interrupt to guest.
|
||||||
|
*/
|
||||||
|
if (likely(workload->status == -EINPROGRESS)) {
|
||||||
|
if (workload->req->fence.error == -EIO)
|
||||||
|
workload->status = -EIO;
|
||||||
|
else
|
||||||
|
workload->status = 0;
|
||||||
|
}
|
||||||
|
|
||||||
i915_gem_request_put(fetch_and_zero(&workload->req));
|
i915_gem_request_put(fetch_and_zero(&workload->req));
|
||||||
|
|
||||||
if (!workload->status && !vgpu->resetting) {
|
if (!workload->status && !vgpu->resetting) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue