Skip to content

Commit 450405c

Browse files
committed
Merge tag 'gvt-fixes-2021-07-15' of https://github.com/intel/gvt-linux into drm-intel-fixes
gvt-fixes-2021-07-15 - Fix shadow ppgtt invalidation with proper D3 state tracking (Colin) Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> From: Zhenyu Wang <zhenyuw@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210715022237.GX12150@zhen-hp.sh.intel.com
2 parents 2734d6c + c90b450 commit 450405c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,6 +1977,21 @@ static int elsp_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
19771977
if (drm_WARN_ON(&i915->drm, !engine))
19781978
return -EINVAL;
19791979

1980+
/*
1981+
* Due to d3_entered is used to indicate skipping PPGTT invalidation on
1982+
* vGPU reset, it's set on D0->D3 on PCI config write, and cleared after
1983+
* vGPU reset if in resuming.
1984+
* In S0ix exit, the device power state also transite from D3 to D0 as
1985+
* S3 resume, but no vGPU reset (triggered by QEMU devic model). After
1986+
* S0ix exit, all engines continue to work. However the d3_entered
1987+
* remains set which will break next vGPU reset logic (miss the expected
1988+
* PPGTT invalidation).
1989+
* Engines can only work in D0. Thus the 1st elsp write gives GVT a
1990+
* chance to clear d3_entered.
1991+
*/
1992+
if (vgpu->d3_entered)
1993+
vgpu->d3_entered = false;
1994+
19801995
execlist = &vgpu->submission.execlist[engine->id];
19811996

19821997
execlist->elsp_dwords.data[3 - execlist->elsp_dwords.index] = data;

0 commit comments

Comments
 (0)