[Mesa-dev] [PATCH 23/33] intel: decoder: group enum related declarations

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


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

diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index b0bd161fef3..1d57d350855 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -73,6 +73,14 @@ gen_group_get_opcode(struct gen_group *group)
    return group->opcode;
 }
 
+struct gen_group *
+gen_spec_find_instruction_by_name(struct gen_spec *spec, const char *name)
+{
+   struct hash_entry *entry = _mesa_hash_table_search(spec->commands,
+                                                      name);
+   return entry ? entry->data : NULL;
+}
+
 struct gen_group *
 gen_spec_find_struct(struct gen_spec *spec, const char *name)
 {
diff --git a/src/intel/common/gen_decoder.h b/src/intel/common/gen_decoder.h
index 81b5beb5baf..eeda899cb69 100644
--- a/src/intel/common/gen_decoder.h
+++ b/src/intel/common/gen_decoder.h
@@ -50,6 +50,7 @@ struct gen_spec *gen_spec_load_from_path(const struct gen_device_info *devinfo,
 void gen_spec_destroy(struct gen_spec *spec);
 uint32_t gen_spec_get_gen(struct gen_spec *spec);
 struct gen_group *gen_spec_find_instruction(struct gen_spec *spec, const uint32_t *p);
+struct gen_group *gen_spec_find_instruction_by_name(struct gen_spec *spec, const char *name);
 struct gen_group *gen_spec_find_register(struct gen_spec *spec, uint32_t offset);
 struct gen_group *gen_spec_find_register_by_name(struct gen_spec *spec, const char *name);
 struct gen_enum *gen_spec_find_enum(struct gen_spec *spec, const char *name);
@@ -57,7 +58,7 @@ struct gen_enum *gen_spec_find_enum(struct gen_spec *spec, const char *name);
 int gen_group_get_length(struct gen_group *group, const uint32_t *p);
 const char *gen_group_get_name(struct gen_group *group);
 uint32_t gen_group_get_opcode(struct gen_group *group);
-struct gen_enum *gen_spec_find_enum(struct gen_spec *spec, const char *name);
+
 bool gen_field_is_header(struct gen_field *field);
 
 struct gen_field_iterator {
-- 
2.15.0.rc2



More information about the mesa-dev mailing list