summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gvt/gvt.h
diff options
context:
space:
mode:
authorZhi Wang <zhi.a.wang@intel.com>2016-07-20 01:14:38 -0400
committerZhenyu Wang <zhenyuw@linux.intel.com>2016-10-14 18:12:46 +0800
commit4d60c5fd3f8751ea751d6dc6cfe0c1620420ccf8 (patch)
treeb9825065a7318e731e1b8cf2a3302472bf300906 /drivers/gpu/drm/i915/gvt/gvt.h
parent2707e44466881d6b0a8ed05a429dcf0940c22f60 (diff)
drm/i915/gvt: vGPU PCI configuration space virtualization
This patch introduces vGPU PCI configuration space virtualization. - Adjust the trapped GPFN(Guest Page Frame Number) window of virtual GEN PCI BAR 0 when guest initializes PCI BAR 0 address. - Emulate OpRegion when guest touches OpRegion. - Pass-through a part of aperture to guest when guest initializes aperture BAR. Signed-off-by: Zhi Wang <zhi.a.wang@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/gvt.h')
-rw-r--r--drivers/gpu/drm/i915/gvt/gvt.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gvt/gvt.h b/drivers/gpu/drm/i915/gvt/gvt.h
index 11267e73671a..f895c9242a28 100644
--- a/drivers/gpu/drm/i915/gvt/gvt.h
+++ b/drivers/gpu/drm/i915/gvt/gvt.h
@@ -108,6 +108,14 @@ struct intel_vgpu_irq {
bool irq_warn_once[INTEL_GVT_EVENT_MAX];
};
+struct intel_vgpu_opregion {
+ void *va;
+ u32 gfn[INTEL_GVT_OPREGION_PAGES];
+ struct page *pages[INTEL_GVT_OPREGION_PAGES];
+};
+
+#define vgpu_opregion(vgpu) (&(vgpu->opregion))
+
struct intel_vgpu {
struct intel_gvt *gvt;
int id;
@@ -121,6 +129,7 @@ struct intel_vgpu {
struct intel_vgpu_mmio mmio;
struct intel_vgpu_irq irq;
struct intel_vgpu_gtt gtt;
+ struct intel_vgpu_opregion opregion;
};
struct intel_gvt_gm {
@@ -145,6 +154,11 @@ struct intel_gvt_firmware {
bool firmware_loaded;
};
+struct intel_gvt_opregion {
+ void *opregion_va;
+ u32 opregion_pa;
+};
+
struct intel_gvt {
struct mutex lock;
bool initialized;
@@ -159,6 +173,7 @@ struct intel_gvt {
struct intel_gvt_firmware firmware;
struct intel_gvt_irq irq;
struct intel_gvt_gtt gtt;
+ struct intel_gvt_opregion opregion;
};
void intel_gvt_free_firmware(struct intel_gvt *gvt);
@@ -300,6 +315,21 @@ int intel_gvt_ggtt_index_g2h(struct intel_vgpu *vgpu, unsigned long g_index,
unsigned long *h_index);
int intel_gvt_ggtt_h2g_index(struct intel_vgpu *vgpu, unsigned long h_index,
unsigned long *g_index);
+
+int intel_vgpu_emulate_cfg_read(void *__vgpu, unsigned int offset,
+ void *p_data, unsigned int bytes);
+
+int intel_vgpu_emulate_cfg_write(void *__vgpu, unsigned int offset,
+ void *p_data, unsigned int bytes);
+
+void intel_gvt_clean_opregion(struct intel_gvt *gvt);
+int intel_gvt_init_opregion(struct intel_gvt *gvt);
+
+void intel_vgpu_clean_opregion(struct intel_vgpu *vgpu);
+int intel_vgpu_init_opregion(struct intel_vgpu *vgpu, u32 gpa);
+
+int intel_vgpu_emulate_opregion_request(struct intel_vgpu *vgpu, u32 swsci);
+
#include "mpt.h"
#endif