drm/i915/gvt: save RING_HEAD into vreg when vgpu switched out
authorXiaolin Zhang <xiaolin.zhang@intel.com>
Mon, 3 Jun 2019 02:55:53 +0000 (10:55 +0800)
committerZhenyu Wang <zhenyuw@linux.intel.com>
Mon, 3 Jun 2019 05:18:36 +0000 (13:18 +0800)
commit15e7f52a4596b496ce3da2fa4c1f94c6fb0023f2
treecd80b905a97fafd33ca1c9bb165a2b51b417cd10
parent3fcb01f8ab9d1c1cdd68142078243b675e17041d
drm/i915/gvt: save RING_HEAD into vreg when vgpu switched out

Save RING_HEAD into vgpu reg when vgpu switched out and report
it's value back to guest.

v6: addressed comment for ring head wrap count support. (Zhenyu)
v5: ring head wrap count support.
v4: updated HEAD/TAIL with guest value, not host value. (Yan Zhao)
v3: save RING HEAD/TAIL vgpu reg in save_ring_hw_state. (Zhenyu Wang)
v2: save RING_TAIL as well during vgpu mmio switch to meet ring_is_idle
condition. (Fred Gao)
v1: based on input from Weinan. (Weinan Li)

[zhenyuw: Include this fix for possible future guest kernel that
would utilize RING_HEAD for hangcheck.]

Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Signed-off-by: Xiaolin Zhang <xiaolin.zhang@intel.com>
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
drivers/gpu/drm/i915/gvt/reg.h
drivers/gpu/drm/i915/gvt/scheduler.c
drivers/gpu/drm/i915/gvt/scheduler.h