Blob Blame History Raw
From 0811fa663015c469510f30e2a0f2fe8fd383b224 Mon Sep 17 00:00:00 2001
From: fred gao <fred.gao@intel.com>
Date: Wed, 24 May 2017 12:02:24 +0800
Subject: [PATCH] drm/i915/gvt: Fix GDRST vreg state after reset
Git-commit: 0811fa663015c469510f30e2a0f2fe8fd383b224
Patch-mainline: v4.13-rc1
References: FATE#322643 bsc#1055900

Emulating the GDRST read behavior correctly to ack the
guest reset request.

V2: 
- split the original patch into two:
  GDRST read handler and virtual gpu reset. (Zhenyu)
V3: 
- emulate the GDRST read right after write. (Zhenyu)

Cc: Zhenyu Wang <zhenyuw@linux.intel.com>
Cc: Zhang Yulei <yulei.zhang@intel.com>
Signed-off-by: fred gao <fred.gao@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 drivers/gpu/drm/i915/gvt/handlers.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/gpu/drm/i915/gvt/handlers.c
+++ b/drivers/gpu/drm/i915/gvt/handlers.c
@@ -298,6 +298,9 @@ static int gdrst_mmio_write(struct intel
 
 	intel_gvt_reset_vgpu_locked(vgpu, false, engine_mask);
 
+	/* sw will wait for the device to ack the reset request */
+	 vgpu_vreg(vgpu, offset) = 0;
+
 	return 0;
 }