@@ -3077,27 +3077,54 @@ int vlv_freq_opcode(struct drm_i915_private *dev_priv, int val);
#define GTT_READ32(addr) \
({ \
- u32 ret = readl(addr); \
- ret; \
+ off_t reg = (unsigned long)(addr) - \
+ (unsigned long)(dev_priv->gtt.gsm); \
+ u32 __ret = 0; \
+ if (i915.enable_vgt) \
+ vgt_emulate_host_read(reg, &__ret, sizeof(u32), \
+ true, false); \
+ else \
+ __ret = readl(addr); \
+ __ret; \
})
#define GTT_READ64(addr) \
({ \
- u64 ret = readq(addr); \
- ret; \
+ off_t reg = (unsigned long)(addr) - \
+ (unsigned long)(dev_priv->gtt.gsm); \
+ u64 __ret = 0; \
+ if (i915.enable_vgt) \
+ vgt_emulate_host_read(reg, &__ret, sizeof(u64), \
+ true, false); \
+ else \
+ __ret = readq(addr); \
+ __ret; \
})
#define GTT_WRITE32(val, addr) \
({ \
- writel((val), (addr)); \
+ off_t reg = (unsigned long)(addr) - \
+ (unsigned long)(dev_priv->gtt.gsm); \
+ u32 __val = (val); \
+ if (i915.enable_vgt) \
+ vgt_emulate_host_write(reg, &__val, sizeof(u32), \
+ true, false); \
+ else \
+ writel((val), (addr)); \
})
#define GTT_WRITE64(val, addr) \
({ \
- writeq((val), (addr)); \
+ off_t reg = (unsigned long)(addr) - \
+ (unsigned long)(dev_priv->gtt.gsm); \
+ u64 __val = (val); \
+ if (i915.enable_vgt) \
+ vgt_emulate_host_write(reg, &__val, sizeof(u64), \
+ true, false); \
+ else \
+ writeq((val), (addr)); \
})
-
/* "Broadcast RGB" property */
#define INTEL_BROADCAST_RGB_AUTO 0
#define INTEL_BROADCAST_RGB_FULL 1
Signed-off-by: Jike Song <jike.song@intel.com> --- drivers/gpu/drm/i915/i915_drv.h | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-)