summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2018-08-25 18:22:00 +0100
committerLionel Landwerlin <[email protected]>2018-08-27 18:33:18 +0100
commit440a988bd1478bb33dafcbb8575473bc643ae383 (patch)
tree15b08b78299b8188c34c477ac024311546e4bd98 /src
parente56e600bd36f562ccd654d4d51a32e054ff4352d (diff)
intel: decoder: handle 0 sized structs
Gen7.5 has a BLEND_STATE of size 0 which includes a variable length group. We did not deal with that very well, leading to an endless loop. Signed-off-by: Lionel Landwerlin <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107544 Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/intel/common/gen_decoder.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index 9e46f271633..ec22b545492 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -997,7 +997,7 @@ gen_field_iterator_init(struct gen_field_iterator *iter,
iter->p_bit = p_bit;
int length = gen_group_get_length(iter->group, iter->p);
- iter->p_end = length > 0 ? &p[length] : NULL;
+ iter->p_end = length >= 0 ? &p[length] : NULL;
iter->print_colors = print_colors;
}
@@ -1012,10 +1012,14 @@ gen_field_iterator_next(struct gen_field_iterator *iter)
iter_start_field(iter, iter->group->next->fields);
bool result = iter_decode_field(iter);
- if (iter->p_end)
- assert(result);
+ if (!result && iter->p_end) {
+ /* We're dealing with a non empty struct of length=0 (BLEND_STATE on
+ * Gen 7.5)
+ */
+ assert(iter->group->dw_length == 0);
+ }
- return true;
+ return result;
}
if (!iter_advance_field(iter))