summaryrefslogtreecommitdiffstats
path: root/src/intel
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2017-03-28 11:55:26 -0700
committerJordan Justen <[email protected]>2017-04-06 13:26:08 -0700
commit7c33372f82707d42293b1772d53ab50a2f56d6a3 (patch)
tree60f01ad94b5ecfd7c7b0d8e0831afb4c3c792dca /src/intel
parent3c77a5722252e01f2f5e4e320d2772f1f6c03f2c (diff)
intel/gen_decoder: Fix length for Media State/Object commands
From BDW PRM, Volume 6: Command Stream Programming, 'Render Command Header Format'. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r--src/intel/common/gen_decoder.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c
index 1ae78c88e3f..1244f4c4480 100644
--- a/src/intel/common/gen_decoder.c
+++ b/src/intel/common/gen_decoder.c
@@ -697,8 +697,16 @@ gen_group_get_length(struct gen_group *group, const uint32_t *p)
return field(h, 0, 7) + 2;
case 1:
return 1;
- case 2:
- return 2;
+ case 2: {
+ uint32_t opcode = field(h, 24, 26);
+ assert(opcode < 3 /* 3 and above currently reserved */);
+ if (opcode == 0)
+ return field(h, 0, 7) + 2;
+ else if (opcode < 3)
+ return field(h, 0, 15) + 2;
+ else
+ return 1; /* FIXME: if more opcodes are added */
+ }
case 3:
return field(h, 0, 7) + 2;
}