diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2001-11-29 14:44:51 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2001-11-29 14:44:51 +0000 |
commit | e7ce909f8f0d886d4afba6be340d08dca0b55730 (patch) | |
tree | c454bc4b92c5c1c26c487eae5e1982b6f1c54a22 | |
parent | 3f1341a7fb8f76d950deae6f8b0f49e2098dfc27 (diff) |
fix PR_* definitions to match original definitions
-rw-r--r-- | linux-core/i810_dma.c | 11 | ||||
-rw-r--r-- | linux-core/i810_drm.h | 17 | ||||
-rw-r--r-- | linux/i810_dma.c | 11 | ||||
-rw-r--r-- | linux/i810_drm.h | 17 |
4 files changed, 24 insertions, 32 deletions
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c index 7e6a48fd..67cb12e5 100644 --- a/linux-core/i810_dma.c +++ b/linux-core/i810_dma.c @@ -790,12 +790,10 @@ static void i810_dma_dispatch_vertex(drm_device_t *dev, if (sarea_priv->dirty) i810EmitState( dev ); - DRM_DEBUG("dispatch vertex addr 0x%lx, used 0x%x nbox %d\n", - address, used, nbox); - if (buf_priv->currently_mapped == I810_BUF_MAPPED) { - *(u32 *)buf_priv->virtual = (GFX_OP_PRIMITIVE | - sarea_priv->vertex_prim | + unsigned int prim = (sarea_priv->vertex_prim & PR_MASK); + + *(u32 *)buf_priv->virtual = (GFX_OP_PRIMITIVE | prim | ((used/4)-2)); if (used & 4) { @@ -965,9 +963,6 @@ int i810_dma_vertex(struct inode *inode, struct file *filp, return -EINVAL; } - DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n", - vertex.idx, vertex.used, vertex.discard); - if(vertex.idx < 0 || vertex.idx > dma->buf_count) return -EINVAL; i810_dma_dispatch_vertex( dev, diff --git a/linux-core/i810_drm.h b/linux-core/i810_drm.h index 3eb632d1..80835975 100644 --- a/linux-core/i810_drm.h +++ b/linux-core/i810_drm.h @@ -191,14 +191,15 @@ typedef struct _drm_i810_copy_t { void *address; /* Address to copy from */ } drm_i810_copy_t; -#define PR_TRIANGLES (0x0) -#define PR_TRISTRIP_0 (0x1) -#define PR_TRISTRIP_1 (0x2) -#define PR_TRIFAN (0x3) -#define PR_POLYGON (0x4) -#define PR_LINES (0x5) -#define PR_LINESTRIP (0x6) -#define PR_RECTS (0x7) +#define PR_TRIANGLES (0x0<<18) +#define PR_TRISTRIP_0 (0x1<<18) +#define PR_TRISTRIP_1 (0x2<<18) +#define PR_TRIFAN (0x3<<18) +#define PR_POLYGON (0x4<<18) +#define PR_LINES (0x5<<18) +#define PR_LINESTRIP (0x6<<18) +#define PR_RECTS (0x7<<18) +#define PR_MASK (0x7<<18) typedef struct drm_i810_dma { diff --git a/linux/i810_dma.c b/linux/i810_dma.c index 7e6a48fd..67cb12e5 100644 --- a/linux/i810_dma.c +++ b/linux/i810_dma.c @@ -790,12 +790,10 @@ static void i810_dma_dispatch_vertex(drm_device_t *dev, if (sarea_priv->dirty) i810EmitState( dev ); - DRM_DEBUG("dispatch vertex addr 0x%lx, used 0x%x nbox %d\n", - address, used, nbox); - if (buf_priv->currently_mapped == I810_BUF_MAPPED) { - *(u32 *)buf_priv->virtual = (GFX_OP_PRIMITIVE | - sarea_priv->vertex_prim | + unsigned int prim = (sarea_priv->vertex_prim & PR_MASK); + + *(u32 *)buf_priv->virtual = (GFX_OP_PRIMITIVE | prim | ((used/4)-2)); if (used & 4) { @@ -965,9 +963,6 @@ int i810_dma_vertex(struct inode *inode, struct file *filp, return -EINVAL; } - DRM_DEBUG("i810 dma vertex, idx %d used %d discard %d\n", - vertex.idx, vertex.used, vertex.discard); - if(vertex.idx < 0 || vertex.idx > dma->buf_count) return -EINVAL; i810_dma_dispatch_vertex( dev, diff --git a/linux/i810_drm.h b/linux/i810_drm.h index 3eb632d1..80835975 100644 --- a/linux/i810_drm.h +++ b/linux/i810_drm.h @@ -191,14 +191,15 @@ typedef struct _drm_i810_copy_t { void *address; /* Address to copy from */ } drm_i810_copy_t; -#define PR_TRIANGLES (0x0) -#define PR_TRISTRIP_0 (0x1) -#define PR_TRISTRIP_1 (0x2) -#define PR_TRIFAN (0x3) -#define PR_POLYGON (0x4) -#define PR_LINES (0x5) -#define PR_LINESTRIP (0x6) -#define PR_RECTS (0x7) +#define PR_TRIANGLES (0x0<<18) +#define PR_TRISTRIP_0 (0x1<<18) +#define PR_TRISTRIP_1 (0x2<<18) +#define PR_TRIFAN (0x3<<18) +#define PR_POLYGON (0x4<<18) +#define PR_LINES (0x5<<18) +#define PR_LINESTRIP (0x6<<18) +#define PR_RECTS (0x7<<18) +#define PR_MASK (0x7<<18) typedef struct drm_i810_dma { |