diff options
author | Eric Anholt <eric@anholt.net> | 2012-01-04 12:06:44 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2012-01-27 13:21:19 -0800 |
commit | 3dcb2d47ee9f3fe15f075e7eb1b80c0c625b4d69 (patch) | |
tree | 4997bae910705e71f76ac96ed1f1070487a8b3cc /intel | |
parent | 5a1c10fe6a50c6b21e616bb77bfb00a9903cc517 (diff) |
intel: Add support for parsing 965 3d packets using helper functions.
I want to add packets, without contributing to the switch statement of
doom.
Diffstat (limited to 'intel')
-rw-r--r-- | intel/intel_decode.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/intel/intel_decode.c b/intel/intel_decode.c index 864d8027..1f01b114 100644 --- a/intel/intel_decode.c +++ b/intel/intel_decode.c @@ -2719,6 +2719,7 @@ decode_3d_965(struct drm_intel_decode *ctx) int unsigned max_len; const char *name; int gen; + int (*func)(struct drm_intel_decode *ctx); } opcodes_3d[] = { { 0x6000, 3, 3, "URB_FENCE" }, { 0x6001, 2, 2, "CS_URB_STATE" }, @@ -3341,7 +3342,12 @@ decode_3d_965(struct drm_intel_decode *ctx) if (opcode_3d->gen && opcode_3d->gen != ctx->gen) continue; - if ((data[0] & 0xffff0000) >> 16 == opcode_3d->opcode) { + if ((data[0] & 0xffff0000) >> 16 != opcode_3d->opcode) + continue; + + if (opcode_3d->func) { + return opcode_3d->func(ctx); + } else { unsigned int i; len = 1; |