[PATCH] drm/i915/gvt: implement per-vm mmio switching optimization

Du, Changbin changbin.du at intel.com
Tue May 2 10:21:57 UTC 2017


On Tue, May 02, 2017 at 03:20:55AM -0700, Dong, Chuanxiao wrote:
> > > Eh....With per-vm switching, the switching between the VMs should be
> > something like:
> > >
> > > Host i915 req0 (RCS) --- host i915 req1 (BCS) --- host i915 req2 (RCS)
> > > --- mmio switching to vgpu1 --- vgpu1 req0 (RCS) --- vgpu1 req1 (BCS)
> > > --- "mmio switching to host" --- host i915 req 3(BCS)
> > >
> > This case make sense. The sencond ring will not be switched. It is a problem.
> > May need a per-ring flag here.
> > 
> > > Based on your patch, "mmio switching to vgpu1" will only save the RCS
> > mmio, right? Then vgpu1 req1 comes and uses the BCS which is not saved by
> > "mmio switching to vgpu1". When "mmio switching to host", and your patch
> > will restore the BCS for host which is actually not saved before...
> > >
> > Will not restore BCS, but just missed the mmio switch for BCS. RCS will be
> > restored.
> 
> No, actually you will restore based on the next i915 request's "req->engine->id" which is BCS but not the ring id (RCS) saved at the previous mmio switching in this case.
> +	if (!is_gvt_request(req)) {
> +		if (action == INTEL_CONTEXT_SCHEDULE_IN && scheduler->last_vgpu) {
> +			/* Switch from vGPU to host. */
> +			intel_gvt_switch_mmio(scheduler->last_vgpu, NULL,
> +					      req->engine->id);
> +		}
> 
It only restore last_ring, please check intel_gvt_switch_mmio().

> Thanks
> Chuanxiao

-- 
Thanks,
Changbin Du
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/intel-gvt-dev/attachments/20170502/27f7c6c5/attachment.sig>


More information about the intel-gvt-dev mailing list