drm/i915: Parametrize LRC registers
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 18 Sep 2015 17:03:15 +0000 (20:03 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 23 Sep 2015 15:13:01 +0000 (17:13 +0200)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_debugfs.c
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_lrc.h

index 72ae3472ddbec66190fa02002216ac0767d9eb31..5615d3d3ab59b90383216066a542ae6389dba5e2 100644 (file)
@@ -2069,8 +2069,8 @@ static int i915_execlists(struct seq_file *m, void *data)
 
                seq_printf(m, "%s\n", ring->name);
 
-               status = I915_READ(RING_EXECLIST_STATUS(ring));
-               ctx_id = I915_READ(RING_EXECLIST_STATUS(ring) + 4);
+               status = I915_READ(RING_EXECLIST_STATUS_LO(ring));
+               ctx_id = I915_READ(RING_EXECLIST_STATUS_HI(ring));
                seq_printf(m, "\tExeclist status: 0x%08X, context: %u\n",
                           status, ctx_id);
 
@@ -2085,8 +2085,8 @@ static int i915_execlists(struct seq_file *m, void *data)
                           read_pointer, write_pointer);
 
                for (i = 0; i < 6; i++) {
-                       status = I915_READ(RING_CONTEXT_STATUS_BUF(ring) + 8*i);
-                       ctx_id = I915_READ(RING_CONTEXT_STATUS_BUF(ring) + 8*i + 4);
+                       status = I915_READ(RING_CONTEXT_STATUS_BUF_LO(ring, i));
+                       ctx_id = I915_READ(RING_CONTEXT_STATUS_BUF_HI(ring, i));
 
                        seq_printf(m, "\tStatus buffer %d: 0x%08X, context: %u\n",
                                   i, status, ctx_id);
index ff9a481ed997bc45cb85a0b6f7dbf03f9282ad86..7417650ed9cfa7be3cbcd5f43137696a1af57562 100644 (file)
@@ -349,7 +349,7 @@ static void execlists_elsp_write(struct drm_i915_gem_request *rq0,
        I915_WRITE_FW(RING_ELSP(ring), lower_32_bits(desc[0]));
 
        /* ELSP is a wo register, use another nearby reg for posting */
-       POSTING_READ_FW(RING_EXECLIST_STATUS(ring));
+       POSTING_READ_FW(RING_EXECLIST_STATUS_LO(ring));
        intel_uncore_forcewake_put__locked(dev_priv, FORCEWAKE_ALL);
        spin_unlock(&dev_priv->uncore.lock);
 }
@@ -519,10 +519,8 @@ void intel_lrc_irq_handler(struct intel_engine_cs *ring)
 
        while (read_pointer < write_pointer) {
                read_pointer++;
-               status = I915_READ(RING_CONTEXT_STATUS_BUF(ring) +
-                               (read_pointer % 6) * 8);
-               status_id = I915_READ(RING_CONTEXT_STATUS_BUF(ring) +
-                               (read_pointer % 6) * 8 + 4);
+               status = I915_READ(RING_CONTEXT_STATUS_BUF_LO(ring, read_pointer % 6));
+               status_id = I915_READ(RING_CONTEXT_STATUS_BUF_HI(ring, read_pointer % 6));
 
                if (status & GEN8_CTX_STATUS_IDLE_ACTIVE)
                        continue;
index 69d99f0df4003672781862fd9758678284e6155c..8a08a278032158ce5704c6c76f19ff16db0edd33 100644 (file)
 
 /* Execlists regs */
 #define RING_ELSP(ring)                        ((ring)->mmio_base+0x230)
-#define RING_EXECLIST_STATUS(ring)     ((ring)->mmio_base+0x234)
+#define RING_EXECLIST_STATUS_LO(ring)  ((ring)->mmio_base+0x234)
+#define RING_EXECLIST_STATUS_HI(ring)  ((ring)->mmio_base+0x234 + 4)
 #define RING_CONTEXT_CONTROL(ring)     ((ring)->mmio_base+0x244)
 #define          CTX_CTRL_INHIBIT_SYN_CTX_SWITCH       (1 << 3)
 #define          CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT   (1 << 0)
 #define   CTX_CTRL_RS_CTX_ENABLE                (1 << 1)
-#define RING_CONTEXT_STATUS_BUF(ring)  ((ring)->mmio_base+0x370)
+#define RING_CONTEXT_STATUS_BUF_LO(ring, i)    ((ring)->mmio_base+0x370 + (i) * 8)
+#define RING_CONTEXT_STATUS_BUF_HI(ring, i)    ((ring)->mmio_base+0x370 + (i) * 8 + 4)
 #define RING_CONTEXT_STATUS_PTR(ring)  ((ring)->mmio_base+0x3a0)
 
 /* Logical Rings */