From 2b42adff1421babe402e8c9269c435ea49608006 Mon Sep 17 00:00:00 2001
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Date: Thu, 23 Aug 2018 17:07:08 +0100
Subject: intel/aub_read: reuse defines from gen_context

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rafael Antognolli <rafael.antognolli@intel.com>
---
 src/intel/tools/aub_read.c | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/intel/tools/aub_read.c b/src/intel/tools/aub_read.c
index 513da3bf847..07cee073f53 100644
--- a/src/intel/tools/aub_read.c
+++ b/src/intel/tools/aub_read.c
@@ -31,6 +31,7 @@
 #include "util/macros.h"
 
 #include "aub_read.h"
+#include "gen_context.h"
 #include "intel_aub.h"
 
 #define TYPE(dw)       (((dw) >> 29) & 7)
@@ -186,7 +187,7 @@ handle_memtrace_reg_write(struct aub_read *read, const uint32_t *p)
    uint64_t context_descriptor;
 
    switch (offset) {
-   case 0x2230: /* render elsp */
+   case EXECLIST_SUBMITPORT_RCSUNIT: /* render elsp */
       read->render_elsp[read->render_elsp_index++] = value;
       if (read->render_elsp_index < 4)
          return;
@@ -196,7 +197,7 @@ handle_memtrace_reg_write(struct aub_read *read, const uint32_t *p)
       context_descriptor = (uint64_t)read->render_elsp[2] << 32 |
          read->render_elsp[3];
       break;
-   case 0x12230: /* video elsp */
+   case EXECLIST_SUBMITPORT_VCSUNIT0: /* video elsp */
       read->video_elsp[read->video_elsp_index++] = value;
       if (read->video_elsp_index < 4)
          return;
@@ -206,7 +207,7 @@ handle_memtrace_reg_write(struct aub_read *read, const uint32_t *p)
       context_descriptor = (uint64_t)read->video_elsp[2] << 32 |
          read->video_elsp[3];
       break;
-   case 0x22230: /* blitter elsp */
+   case EXECLIST_SUBMITPORT_BCSUNIT: /* blitter elsp */
       read->blitter_elsp[read->blitter_elsp_index++] = value;
       if (read->blitter_elsp_index < 4)
          return;
@@ -216,35 +217,35 @@ handle_memtrace_reg_write(struct aub_read *read, const uint32_t *p)
       context_descriptor = (uint64_t)read->blitter_elsp[2] << 32 |
          read->blitter_elsp[3];
       break;
-   case 0x2510: /* render elsq0 lo */
+   case EXECLIST_SQ_CONTENTS0_RCSUNIT: /* render elsq0 lo */
       read->render_elsp[3] = value;
       return;
-   case 0x2514: /* render elsq0 hi */
+   case (EXECLIST_SQ_CONTENTS0_RCSUNIT + 4): /* render elsq0 hi */
       read->render_elsp[2] = value;
       return;
-   case 0x12510: /* video elsq0 lo */
+   case EXECLIST_SQ_CONTENTS0_VCSUNIT0: /* video elsq0 lo */
       read->video_elsp[3] = value;
       return;
-   case 0x12514: /* video elsq0 hi */
+   case EXECLIST_SQ_CONTENTS0_VCSUNIT0 + 4: /* video elsq0 hi */
       read->video_elsp[2] = value;
       return;
-   case 0x22510: /* blitter elsq0 lo */
+   case EXECLIST_SQ_CONTENTS0_BCSUNIT: /* blitter elsq0 lo */
       read->blitter_elsp[3] = value;
       return;
-   case 0x22514: /* blitter elsq0 hi */
+   case (EXECLIST_SQ_CONTENTS0_BCSUNIT + 4): /* blitter elsq0 hi */
       read->blitter_elsp[2] = value;
       return;
-   case 0x2550: /* render elsc */
+   case EXECLIST_CONTROL_RCSUNIT: /* render elsc */
       engine = I915_ENGINE_CLASS_RENDER;
       context_descriptor = (uint64_t)read->render_elsp[2] << 32 |
          read->render_elsp[3];
       break;
-   case 0x12550: /* video_elsc */
+   case EXECLIST_CONTROL_VCSUNIT0: /* video_elsc */
       engine = I915_ENGINE_CLASS_VIDEO;
       context_descriptor = (uint64_t)read->video_elsp[2] << 32 |
          read->video_elsp[3];
       break;
-   case 0x22550: /* blitter elsc */
+   case EXECLIST_CONTROL_BCSUNIT: /* blitter elsc */
       engine = I915_ENGINE_CLASS_COPY;
       context_descriptor = (uint64_t)read->blitter_elsp[2] << 32 |
          read->blitter_elsp[3];
-- 
cgit v1.2.3