summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/i915/gvt/mmio.h
diff options
context:
space:
mode:
authorChangbin Du <changbin.du@intel.com>2017-06-06 15:56:09 +0800
committerZhenyu Wang <zhenyuw@linux.intel.com>2017-06-08 13:59:19 +0800
commit65f9f6febf12ed5bbcebd3599698eb78b03e5b69 (patch)
treea9f1d792175a49ecd7808a309a4de4ac8a87764b /drivers/gpu/drm/i915/gvt/mmio.h
parentaf2c6399aabeb7a7107657a469cb2f16b55dfbae (diff)
drm/i915/gvt: Optimize MMIO register handling for some large MMIO blocks
Some of traced MMIO registers are a large continuous section. These stuffed the MMIO lookup hash table and so waste lots of memory and get much lower lookup performance. Here we picked out these sections by special handling. These sections include: o Display pipe registers, total 768. o The PVINFO page, total 1024. o MCHBAR_MIRROR, total 65536. o CSR_MMIO, total 3072. So we removed 70,400 items from the hash table, and speed up guest boot time by ~500ms. v2: o add a local function find_mmio_block(). o fix comments. Signed-off-by: Changbin Du <changbin.du@intel.com> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/gvt/mmio.h')
-rw-r--r--drivers/gpu/drm/i915/gvt/mmio.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/gvt/mmio.h b/drivers/gpu/drm/i915/gvt/mmio.h
index bd193f9bbcee..4410a323eea3 100644
--- a/drivers/gpu/drm/i915/gvt/mmio.h
+++ b/drivers/gpu/drm/i915/gvt/mmio.h
@@ -52,6 +52,9 @@ struct intel_vgpu;
#define D_PRE_SKL (D_BDW)
#define D_ALL (D_BDW | D_SKL | D_KBL)
+typedef int (*gvt_mmio_func)(struct intel_vgpu *, unsigned int, void *,
+ unsigned int);
+
struct intel_gvt_mmio_info {
u32 offset;
u32 size;
@@ -59,8 +62,8 @@ struct intel_gvt_mmio_info {
u32 addr_mask;
u64 ro_mask;
u32 device;
- int (*read)(struct intel_vgpu *, unsigned int, void *, unsigned int);
- int (*write)(struct intel_vgpu *, unsigned int, void *, unsigned int);
+ gvt_mmio_func read;
+ gvt_mmio_func write;
u32 addr_range;
struct hlist_node node;
};
@@ -71,8 +74,6 @@ bool intel_gvt_match_device(struct intel_gvt *gvt, unsigned long device);
int intel_gvt_setup_mmio_info(struct intel_gvt *gvt);
void intel_gvt_clean_mmio_info(struct intel_gvt *gvt);
-struct intel_gvt_mmio_info *intel_gvt_find_mmio_info(struct intel_gvt *gvt,
- unsigned int offset);
#define INTEL_GVT_MMIO_OFFSET(reg) ({ \
typeof(reg) __reg = reg; \
u32 *offset = (u32 *)&__reg; \
@@ -103,4 +104,8 @@ int intel_vgpu_default_mmio_write(struct intel_vgpu *vgpu, unsigned int offset,
bool intel_gvt_in_force_nonpriv_whitelist(struct intel_gvt *gvt,
unsigned int offset);
+
+int intel_vgpu_mmio_reg_rw(struct intel_vgpu *vgpu, unsigned int offset,
+ void *pdata, unsigned int bytes, bool is_read);
+
#endif