[Intel-gfx] [RFC 08/10] drm/i915/gvt: GVTg support context submission pvmmio optimization
Xiaolin Zhang
xiaolin.zhang at intel.com
Thu Sep 27 16:37:53 UTC 2018
implemented context submission pvmmio optimizaiton with GVTg.
GVTg to read context submission data (elsp_data) from the shared_page
directly without trap cost to improve guest GPU peformrnace.
Signed-off-by: Xiaolin Zhang <xiaolin.zhang at intel.com>
---
drivers/gpu/drm/i915/gvt/handlers.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/i915/gvt/handlers.c b/drivers/gpu/drm/i915/gvt/handlers.c
index a229770..9ddb78e 100644
--- a/drivers/gpu/drm/i915/gvt/handlers.c
+++ b/drivers/gpu/drm/i915/gvt/handlers.c
@@ -1647,13 +1647,25 @@ static int elsp_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
int ring_id = intel_gvt_render_mmio_to_ring_id(vgpu->gvt, offset);
struct intel_vgpu_execlist *execlist;
u32 data = *(u32 *)p_data;
+ u32 elsp_data[4];
int ret = 0;
+ u32 elsp_data_off;
if (WARN_ON(ring_id < 0 || ring_id >= I915_NUM_ENGINES))
return -EINVAL;
execlist = &vgpu->submission.execlist[ring_id];
+ if (VGPU_PVMMIO(vgpu) & PVMMIO_ELSP_SUBMIT) {
+ elsp_data_off = offsetof(struct gvt_shared_page, elsp_data);
+ intel_gvt_read_shared_page(vgpu, elsp_data_off, &elsp_data, 16);
+ execlist->elsp_dwords.data[3] = elsp_data[0];
+ execlist->elsp_dwords.data[2] = elsp_data[1];
+ execlist->elsp_dwords.data[1] = elsp_data[2];
+ execlist->elsp_dwords.data[0] = data;
+ return intel_vgpu_submit_execlist(vgpu, ring_id);
+ }
+
execlist->elsp_dwords.data[3 - execlist->elsp_dwords.index] = data;
if (execlist->elsp_dwords.index == 3) {
ret = intel_vgpu_submit_execlist(vgpu, ring_id);
--
1.8.3.1
More information about the Intel-gfx
mailing list