From: Eric Anholt Subject: [PATCH 11/17] intel: Add support for parsing 965 3d packets using helper functions. Date: Wed, 4 Jan 2012 14:54:53 -0800 Message-ID: <1325717699-5953-12-git-send-email-eric@anholt.net> References: <1325717699-5953-1-git-send-email-eric@anholt.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1325717699-5953-1-git-send-email-eric@anholt.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org I want to add packets, without contributing to the switch statement of doom. --- 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 864d802..1f01b11 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; -- 1.7.7.3