]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/guc: New GuC interrupt register for Gen11
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Mon, 27 May 2019 18:36:04 +0000 (18:36 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 28 May 2019 09:07:10 +0000 (10:07 +0100)
Gen11 defines new more flexible Host-to-GuC interrupt register.
Now the host can write any 32-bit payload to trigger an interrupt
and GuC can additionally read this payload from the register.
Current GuC firmware ignores the payload so we just write 0.

Bspec: 21043

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-9-michal.wajdeczko@intel.com
drivers/gpu/drm/i915/intel_guc.c
drivers/gpu/drm/i915/intel_guc_reg.h

index 60e6463a3aacde7bd1a0101632dfcdb04e017dd5..888a1e999c8b7c3b24b93ef0510da851dfe8bbfc 100644 (file)
@@ -34,6 +34,13 @@ static void gen8_guc_raise_irq(struct intel_guc *guc)
        I915_WRITE(GUC_SEND_INTERRUPT, GUC_SEND_TRIGGER);
 }
 
+static void gen11_guc_raise_irq(struct intel_guc *guc)
+{
+       struct drm_i915_private *dev_priv = guc_to_i915(guc);
+
+       I915_WRITE(GEN11_GUC_HOST_INTERRUPT, 0);
+}
+
 static inline i915_reg_t guc_send_reg(struct intel_guc *guc, u32 i)
 {
        GEM_BUG_ON(!guc->send_regs.base);
@@ -63,6 +70,8 @@ void intel_guc_init_send_regs(struct intel_guc *guc)
 
 void intel_guc_init_early(struct intel_guc *guc)
 {
+       struct drm_i915_private *i915 = guc_to_i915(guc);
+
        intel_guc_fw_init_early(guc);
        intel_guc_ct_init_early(&guc->ct);
        intel_guc_log_init_early(&guc->log);
@@ -71,7 +80,10 @@ void intel_guc_init_early(struct intel_guc *guc)
        spin_lock_init(&guc->irq_lock);
        guc->send = intel_guc_send_nop;
        guc->handler = intel_guc_to_host_event_handler_nop;
-       guc->notify = gen8_guc_raise_irq;
+       if (INTEL_GEN(i915) >= 11)
+               guc->notify = gen11_guc_raise_irq;
+       else
+               guc->notify = gen8_guc_raise_irq;
 }
 
 static int guc_init_wq(struct intel_guc *guc)
index 57e7ad522c2fed3d0166b0e7fb6a79e73de572b4..aec02eddbaed03bd16a10d2610b643cdc5d2b136 100644 (file)
 
 #define GUC_SEND_INTERRUPT             _MMIO(0xc4c8)
 #define   GUC_SEND_TRIGGER               (1<<0)
+#define GEN11_GUC_HOST_INTERRUPT       _MMIO(0x1901f0)
 
 #define GUC_NUM_DOORBELLS              256