[Intel-gfx] Fwd: Discuss GVT context hacks in i915

Zhi Wang zhi.a.wang at intel.com
Mon Feb 15 09:13:44 UTC 2016


+ mailing-list

-------- Original Message --------
Subject: Discuss GVT context hacks in i915
Date: Mon, 15 Feb 2016 17:11:12 +0800
From: Zhi Wang <zhi.a.wang at intel.com>
To: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>,  Chris Wilson 
<chris at chris-wilson.co.uk>, Daniel Vetter <daniel.vetter at intel.com>, 
Zhiyuan Lv <zhiyuan.lv at intel.com>, "Tian, Kevin" <kevin.tian at intel.com>

Hi Guys:
    Previously we have sent our GVT-g device model RFC code, and thanks
for the advices and comments! As you see GVT-g needs a special kind of
LRC context as shadow context so it could be able to use i915 GEM
submission subsystem, which requires some changes in i915.

Probably we can discuss them one by one and settle them down before the
next version of RFC code. :)

Difference between a i915 LRC context and a GVT LRC context
------

* The engine context initialization of a GVT LRC context can be
bypassed, as GVT-g will initialize it by guest LRC context.

http://www.spinics.net/lists/intel-gfx/msg86546.html

* The addressing mode bit in the context descriptor should be able to
configured at runtime, as some guest is still using 32bit PPGTT address
space.

http://www.spinics.net/lists/intel-gfx/msg86544.html

* As the GVT LRC context will go with the shadow PPGTT page table
populated by GVT-g, a GVT LRC context doesn't need a i915 PPGTT
instance, also its PDP root pointer doesn't need to be populated by i915.

http://www.spinics.net/lists/intel-gfx/msg86545.html

* The ring buffer size of a GVT LRC context ring buffer object should be
configurable or hard-coded to the max size, as some guest (e.g. windows)
has a large ring buffer and could submit a lot of commands at one time.

Hacking i915
-------

The above changes needs to hack i915, in the RFC code, you can see a lot
of codes like below:

if (!gvt_context) {
	/* do something i915 needed */
} else {
	/* do something GVT-g needed */
}

This kinds of code piece is GVT-g specific, another approach should be
refining some i915 APIs or say something generic, like:

if (context->need_i915_ppgtt) {
	/* allocating i915 ppgtt instance */
}

if (context->ppgtt) {
	/* update PDP root pointers in LRC context. */
}

if (context->need_initialization) {
	/* emit commands to initialize the engine context of LRC context */
}

I'm wondering which kinds do you prefer? Or maybe you can give me some
advices? :)

Thanks,
Zhi.




More information about the Intel-gfx mailing list