i965/hsw+: Add support for copying a register
authorJordan Justen <jordan.l.justen@intel.com>
Tue, 19 Apr 2016 16:34:40 +0000 (09:34 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Wed, 4 May 2016 18:23:17 +0000 (11:23 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_context.h
src/mesa/drivers/dri/i965/intel_batchbuffer.c
src/mesa/drivers/dri/i965/intel_reg.h

index e628564f14a345e96296801c762ea556f8b91946..ba42aa95b09edddca679c71c0f2e6789f6f96476 100644 (file)
@@ -1452,6 +1452,8 @@ void brw_store_register_mem32(struct brw_context *brw,
                               drm_intel_bo *bo, uint32_t reg, uint32_t offset);
 void brw_store_register_mem64(struct brw_context *brw,
                               drm_intel_bo *bo, uint32_t reg, uint32_t offset);
+void brw_load_register_reg(struct brw_context *brw, uint32_t src,
+                           uint32_t dest);
 void brw_store_data_imm32(struct brw_context *brw, drm_intel_bo *bo,
                           uint32_t offset, uint32_t imm);
 void brw_store_data_imm64(struct brw_context *brw, drm_intel_bo *bo,
index 334be0c427d6a4b3b921a5a2bddac9c15491616c..33927af2a6a0db3ff68eeb8454896281afdb6b72 100644 (file)
@@ -601,6 +601,21 @@ brw_store_register_mem64(struct brw_context *brw,
    }
 }
 
+/*
+ * Copies a 32-bit register.
+ */
+void
+brw_load_register_reg(struct brw_context *brw, uint32_t src, uint32_t dest)
+{
+   assert(brw->gen >= 8 || brw->is_haswell);
+
+   BEGIN_BATCH(3);
+   OUT_BATCH(MI_LOAD_REGISTER_REG | (3 - 2));
+   OUT_BATCH(src);
+   OUT_BATCH(dest);
+   ADVANCE_BATCH();
+}
+
 /*
  * Write 32-bits of immediate data to a GPU memory buffer.
  */
index c0d28746875e7833f4bdde430d73f8d6097581de..40931b397a95c7a093d9b4298934fd0ca93173cf 100644 (file)
@@ -37,6 +37,7 @@
 
 #define MI_STORE_DATA_IMM              (CMD_MI | (0x20 << 23))
 #define MI_LOAD_REGISTER_IMM           (CMD_MI | (0x22 << 23))
+#define MI_LOAD_REGISTER_REG           (CMD_MI | (0x2A << 23))
 
 #define MI_FLUSH_DW                    (CMD_MI | (0x26 << 23) | 2)