Correct a couple of packet length calculations.
authorKeith Whitwell <keith@tungstengraphics.com>
Fri, 23 Jul 2004 16:12:27 +0000 (16:12 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Fri, 23 Jul 2004 16:12:27 +0000 (16:12 +0000)
shared-core/i915_dma.c
shared/i915_dma.c

index 80f643c..6d85e05 100644 (file)
@@ -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;
index 80f643c..6d85e05 100644 (file)
@@ -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;