[Mesa-dev] [PATCH 14/33] intel: decoder: extract instruction/structs length

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Oct 30 16:58:27 UTC 2017


Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
---
 src/intel/common/gen_decoder.c | 7 +++++++
 src/intel/common/gen_decoder.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index cd18580aea8..2562aa56175 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -162,6 +162,13 @@ create_group(struct parser_context *ctx,
    group->spec = ctx->spec;
    group->variable = false;
 
+   for (int i = 0; atts[i]; i += 2) {
+      char *p;
+      if (strcmp(atts[i], "length") == 0) {
+         group->dw_length = strtoul(atts[i + 1], &p, 0);
+      }
+   }
+
    if (parent) {
       group->parent = parent;
       get_group_offset_count(atts,
diff --git a/src/intel/common/gen_decoder.h b/src/intel/common/gen_decoder.h
index 2637c42e7d3..dc1f92ab6a3 100644
--- a/src/intel/common/gen_decoder.h
+++ b/src/intel/common/gen_decoder.h
@@ -85,6 +85,7 @@ struct gen_group {
 
    struct gen_field *fields; /* linked list of fields */
 
+   uint32_t dw_length;
    uint32_t group_offset, group_count;
    uint32_t group_size;
    bool variable;
-- 
2.15.0.rc2



More information about the mesa-dev mailing list