From 1e5354e867d1dde8c86273e7434f49b57779ef36 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 23 Jul 2004 16:12:27 +0000 Subject: [PATCH] Correct a couple of packet length calculations. --- shared-core/i915_dma.c | 9 ++++++++- shared/i915_dma.c | 9 ++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c index 80f643cd..6d85e050 100644 --- a/shared-core/i915_dma.c +++ b/shared-core/i915_dma.c @@ -306,7 +306,14 @@ static int do_validate_cmd( int cmd ) case 0x1c: return 1; case 0x1d: - return (cmd & 0xffff) + 2; + switch ((cmd>>16)&0xff) { + case 0x3: + return (cmd & 0x1f) + 2; + case 0x4: + return (cmd & 0xf) + 2; + default: + return (cmd & 0xffff) + 2; + } case 0x1e: if (cmd & (1<<23)) return (cmd & 0xffff) + 1; diff --git a/shared/i915_dma.c b/shared/i915_dma.c index 80f643cd..6d85e050 100644 --- a/shared/i915_dma.c +++ b/shared/i915_dma.c @@ -306,7 +306,14 @@ static int do_validate_cmd( int cmd ) case 0x1c: return 1; case 0x1d: - return (cmd & 0xffff) + 2; + switch ((cmd>>16)&0xff) { + case 0x3: + return (cmd & 0x1f) + 2; + case 0x4: + return (cmd & 0xf) + 2; + default: + return (cmd & 0xffff) + 2; + } case 0x1e: if (cmd & (1<<23)) return (cmd & 0xffff) + 1;