[PATCH V2] drm/i915/gvt: save RING_HEAD into vreg when vgpu switched out
Zhenyu Wang
zhenyuw at linux.intel.com
Wed May 22 09:19:45 UTC 2019
On 2019.05.22 13:08:00 +0800, Xiaolin Zhang wrote:
> to save RING_HEAD into vgpu reg when vgpu switched out and report
> it's value back to guest.
>
> 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)
>
> Fixes: 519a019491b8 ("drm/i915/hangcheck: Replace hangcheck.seqno with RING_HEAD")
>
> Signed-off-by: Xiaolin Zhang <xiaolin.zhang at intel.com>
> ---
> drivers/gpu/drm/i915/gvt/mmio_context.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/gvt/mmio_context.c b/drivers/gpu/drm/i915/gvt/mmio_context.c
> index 96e1edf..758a8b3 100644
> --- a/drivers/gpu/drm/i915/gvt/mmio_context.c
> +++ b/drivers/gpu/drm/i915/gvt/mmio_context.c
> @@ -457,6 +457,7 @@ static void switch_mmio(struct intel_vgpu *pre,
> struct intel_vgpu_submission *s;
> struct engine_mmio *mmio;
> u32 old_v, new_v;
> + u32 ring_base;
>
> dev_priv = pre ? pre->gvt->dev_priv : next->gvt->dev_priv;
> if (INTEL_GEN(dev_priv) >= 9)
> @@ -519,6 +520,14 @@ static void switch_mmio(struct intel_vgpu *pre,
> old_v, new_v);
> }
>
> + if (pre) {
> + ring_base = dev_priv->engine[ring_id]->mmio_base;
> + vgpu_vreg_t(pre, RING_HEAD(ring_base)) =
> + I915_READ_FW(RING_HEAD(ring_base));
> + vgpu_vreg_t(pre, RING_TAIL(ring_base)) =
> + I915_READ_FW(RING_TAIL(ring_base));
> + }
> +
I think we should put these into save_ring_hw_state() to capture each
state change, instead of lagging until switch time?
> if (next)
> handle_tlb_pending_event(next, ring_id);
> }
> --
> 2.7.4
>
> _______________________________________________
> intel-gvt-dev mailing list
> intel-gvt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gvt-dev
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20190522/34e58c55/attachment.sig>
More information about the intel-gvt-dev
mailing list