OSDN Git Service

drm/i915/guc: New GuC scratch registers for Gen11
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 27 May 2019 18:36:05 +0000 (18:36 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 28 May 2019 09:07:12 +0000 (10:07 +0100)
Gen11 adds new set of scratch registers that can be used for MMIO
based Host-to-Guc communication. Due to limited number of these
registers it is expected that host will use them only for command
transport buffers (CTB) communication setup if one is available.

Bspec: 21044

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190527183613.17076-10-michal.wajdeczko@intel.com
drivers/gpu/drm/i915/intel_guc.c
drivers/gpu/drm/i915/intel_guc_reg.h

index 888a1e9..538868a 100644 (file)
@@ -56,9 +56,15 @@ void intel_guc_init_send_regs(struct intel_guc *guc)
        enum forcewake_domains fw_domains = 0;
        unsigned int i;
 
-       guc->send_regs.base = i915_mmio_reg_offset(SOFT_SCRATCH(0));
-       guc->send_regs.count = GUC_MAX_MMIO_MSG_LEN;
-       BUILD_BUG_ON(GUC_MAX_MMIO_MSG_LEN > SOFT_SCRATCH_COUNT);
+       if (HAS_GUC_CT(dev_priv) && INTEL_GEN(dev_priv) >= 11) {
+               guc->send_regs.base =
+                               i915_mmio_reg_offset(GEN11_SOFT_SCRATCH(0));
+               guc->send_regs.count = GEN11_SOFT_SCRATCH_COUNT;
+       } else {
+               guc->send_regs.base = i915_mmio_reg_offset(SOFT_SCRATCH(0));
+               guc->send_regs.count = GUC_MAX_MMIO_MSG_LEN;
+               BUILD_BUG_ON(GUC_MAX_MMIO_MSG_LEN > SOFT_SCRATCH_COUNT);
+       }
 
        for (i = 0; i < guc->send_regs.count; i++) {
                fw_domains |= intel_uncore_forcewake_for_reg(&dev_priv->uncore,
index aec02ed..d26de51 100644 (file)
@@ -51,6 +51,9 @@
 #define SOFT_SCRATCH(n)                        _MMIO(0xc180 + (n) * 4)
 #define SOFT_SCRATCH_COUNT             16
 
+#define GEN11_SOFT_SCRATCH(n)          _MMIO(0x190240 + (n) * 4)
+#define GEN11_SOFT_SCRATCH_COUNT       4
+
 #define UOS_RSA_SCRATCH(i)             _MMIO(0xc200 + (i) * 4)
 #define UOS_RSA_SCRATCH_COUNT          64