[Intel-gfx] refactor the i915 GVT support and move to the modern mdev API v2

Christoph Hellwig
2021-11-02T07:06:16Z

Hi all,

the GVT code in the i915 is a bit of a mess right now due to strange
abstractions and lots of indirect calls. This series refactors various
bits to clean that up. The main user visible change is that almost all
of the GVT code moves out of the main i915 driver and into the kvmgt
module.

Tested on my Thinkpad with a Kaby Lake CPU and integrated graphics.

Git tree:

git://git.infradead.org/users/hch/misc.git i915-gvt

Gitweb:

http://git.infradead.org/users/hch/misc.git/shortlog/refs/heads/i915-gvt

Changes since v1:
- rebased on Linux 5.15
- allow the kvmgvt module to be loaded at any time and thus solve
the deadlock when both i915 amd kvmgvt are modular
- include the conversion to the modern mdev API

Note that I do expect to rebased this again against 5.16-rc1 once
released, but I'd like to get this out for review ASAP.

Diffstat:
b/drivers/gpu/drm/i915/Kconfig | 33
b/drivers/gpu/drm/i915/Makefile | 31
b/drivers/gpu/drm/i915/gvt/cfg_space.c | 89 --
b/drivers/gpu/drm/i915/gvt/cmd_parser.c | 4
b/drivers/gpu/drm/i915/gvt/dmabuf.c | 36 -
b/drivers/gpu/drm/i915/gvt/execlist.c | 12
b/drivers/gpu/drm/i915/gvt/gtt.c | 55 +
b/drivers/gpu/drm/i915/gvt/gvt.h | 125 ++-
b/drivers/gpu/drm/i915/gvt/interrupt.c | 38 +
b/drivers/gpu/drm/i915/gvt/kvmgt.c | 1099 +++++++++++++++-----------------
b/drivers/gpu/drm/i915/gvt/mmio.c | 4
b/drivers/gpu/drm/i915/gvt/opregion.c | 148 ----
b/drivers/gpu/drm/i915/gvt/page_track.c | 8
b/drivers/gpu/drm/i915/gvt/scheduler.c | 37 -
b/drivers/gpu/drm/i915/gvt/trace.h | 2
b/drivers/gpu/drm/i915/gvt/vgpu.c | 22
b/drivers/gpu/drm/i915/i915_drv.c | 7
b/drivers/gpu/drm/i915/i915_drv.h | 1
b/drivers/gpu/drm/i915/i915_trace.h | 1
b/drivers/gpu/drm/i915/intel_gvt.c | 162 +++-
b/drivers/gpu/drm/i915/intel_gvt.h | 17
drivers/gpu/drm/i915/gvt/Makefile | 9
drivers/gpu/drm/i915/gvt/gvt.c | 340 ---------
drivers/gpu/drm/i915/gvt/hypercall.h | 82 --
drivers/gpu/drm/i915/gvt/mpt.h | 400 -----------
25 files changed, 929 insertions(+), 1833 deletions(-)