diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2002-07-06 00:46:10 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2002-07-06 00:46:10 +0000 |
commit | deb296f395bb16ef7cf4bfe48f6e6c2cbacea0bc (patch) | |
tree | 29c6c88d89bdcd3418f67080bbd7be0efdf421c9 /linux | |
parent | d8a234d2a853714ca9fd97139511e5326287290e (diff) |
Another state packet.r200-0-1-20020714-freeze
Diffstat (limited to 'linux')
-rw-r--r-- | linux/drm_os_linux.h | 56 | ||||
-rw-r--r-- | linux/radeon_drm.h | 3 | ||||
-rw-r--r-- | linux/radeon_drv.h | 7 | ||||
-rw-r--r-- | linux/radeon_state.c | 10 |
4 files changed, 63 insertions, 13 deletions
diff --git a/linux/drm_os_linux.h b/linux/drm_os_linux.h new file mode 100644 index 000000000..8c073f0ba --- /dev/null +++ b/linux/drm_os_linux.h @@ -0,0 +1,56 @@ +#define __NO_VERSION__ + +#include <linux/interrupt.h> /* For task queue support */ +#include <linux/delay.h> + +#define DRM_IOCTL_ARGS struct inode *inode, struct file *filp, unsigned int cmd, unsigned long data +#define DRM_ERR(d) -(d) +#define DRM_CURRENTPID current->pid +#define DRM_UDELAY(d) udelay(d) +#define DRM_READ8(addr) readb(addr) +#define DRM_READ32(addr) readl(addr) +#define DRM_WRITE8(addr, val) writeb(val, addr) +#define DRM_WRITE32(addr, val) writel(val, addr) +#define DRM_READMEMORYBARRIER() mb() +#define DRM_WRITEMEMORYBARRIER() wmb() +#define DRM_DEVICE drm_file_t *priv = filp->private_data; \ + drm_device_t *dev = priv->dev + +/* For data going from/to the kernel through the ioctl argument */ +#define DRM_COPY_FROM_USER_IOCTL(arg1, arg2, arg3) \ + if ( copy_from_user(&arg1, arg2, arg3) ) \ + return -EFAULT +#define DRM_COPY_TO_USER_IOCTL(arg1, arg2, arg3) \ + if ( copy_to_user(arg1, &arg2, arg3) ) \ + return -EFAULT +/* Other copying of data from/to kernel space */ +#define DRM_COPY_FROM_USER(arg1, arg2, arg3) \ + copy_from_user(arg1, arg2, arg3) +#define DRM_COPY_TO_USER(arg1, arg2, arg3) \ + copy_to_user(arg1, arg2, arg3) +/* Macros for copyfrom user, but checking readability only once */ +#define DRM_VERIFYAREA_READ( uaddr, size ) \ + verify_area( VERIFY_READ, uaddr, size ) +#define DRM_COPY_FROM_USER_UNCHECKED(arg1, arg2, arg3) \ + __copy_from_user(arg1, arg2, arg3) +#define DRM_GET_USER_UNCHECKED(val, uaddr) \ + __get_user(val, uaddr) + + +/* malloc/free without the overhead of DRM(alloc) */ +#define DRM_MALLOC(x) kmalloc(x, GFP_KERNEL) +#define DRM_FREE(x) kfree(x) + +#define DRM_GETSAREA() \ +do { \ + struct list_head *list; \ + list_for_each( list, &dev->maplist->head ) { \ + drm_map_list_t *entry = (drm_map_list_t *)list; \ + if ( entry->map && \ + entry->map->type == _DRM_SHM && \ + (entry->map->flags & _DRM_CONTAINS_LOCK) ) { \ + dev_priv->sarea = entry->map; \ + break; \ + } \ + } \ +} while (0) diff --git a/linux/radeon_drm.h b/linux/radeon_drm.h index 1a6657cf0..b7a83804b 100644 --- a/linux/radeon_drm.h +++ b/linux/radeon_drm.h @@ -128,7 +128,8 @@ #define R200_EMIT_SE_VAP_CNTL_STATUS 57 /* cst/1 */ #define R200_EMIT_SE_VTX_STATE_CNTL 58 /* cst/1 */ #define R200_EMIT_RE_POINTSIZE 59 /* cst/1 */ -#define RADEON_MAX_STATE_PACKETS 60 +#define R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0 60 /* cst/4 */ +#define RADEON_MAX_STATE_PACKETS 61 /* Commands understood by cmd_buffer ioctl. More can be added but diff --git a/linux/radeon_drv.h b/linux/radeon_drv.h index 80fa75964..2f0524ed2 100644 --- a/linux/radeon_drv.h +++ b/linux/radeon_drv.h @@ -568,9 +568,10 @@ extern int radeon_cp_flip( struct inode *inode, struct file *filp, #define R200_RE_SCISSOR_TL_1 0x1ce0 #define R200_RE_SCISSOR_TL_2 0x1ce8 #define R200_RB3D_DEPTHXY_OFFSET 0x1d60 -#define R200_RE_AUX_SCISSOR_CNTL 0x26f0 -#define R200_SE_VTX_STATE_CNTL 0x2180 -#define R200_RE_POINTSIZE 0x2648 +#define R200_RE_AUX_SCISSOR_CNTL 0x26f0 +#define R200_SE_VTX_STATE_CNTL 0x2180 +#define R200_RE_POINTSIZE 0x2648 +#define R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0 0x2554 #define SE_VAP_CNTL__TCL_ENA_MASK 0x00000001 diff --git a/linux/radeon_state.c b/linux/radeon_state.c index 7790236a8..f199d2cbe 100644 --- a/linux/radeon_state.c +++ b/linux/radeon_state.c @@ -48,7 +48,6 @@ static inline void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv, DRM_DEBUG( " box: x1=%d y1=%d x2=%d y2=%d\n", box->x1, box->y1, box->x2, box->y2 ); -#if 1 BEGIN_RING( 4 ); OUT_RING( CP_PACKET0( RADEON_RE_TOP_LEFT, 0 ) ); OUT_RING( (box->y1 << 16) | box->x1 ); @@ -56,13 +55,6 @@ static inline void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv, /* OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );*/ OUT_RING( (box->y2 << 16) | box->x2 ); ADVANCE_RING(); -#else - BEGIN_RING( 3 ); - OUT_RING( CP_PACKET3( RADEON_CCE_SET_SCISSORS, 1 )); - OUT_RING( (box->y1 << 16) | box->x1 ); - OUT_RING( (box->y2 << 16) | box->x2 ); - ADVANCE_RING(); -#endif } /* Emit 1.1 state @@ -289,6 +281,7 @@ static struct { { R200_SE_VAP_CNTL_STATUS, 1, "R200_SE_VAP_CNTL_STATUS" }, { R200_SE_VTX_STATE_CNTL, 1, "R200_SE_VTX_STATE_CNTL" }, { R200_RE_POINTSIZE, 1, "R200_RE_POINTSIZE" }, + { R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0, 4, "R200_SE_TCL_INPUT_VTX_VECTOR_ADDR_0" }, }; @@ -385,7 +378,6 @@ static void radeon_cp_dispatch_clear( drm_device_t *dev, if ( tmp & RADEON_BACK ) flags |= RADEON_FRONT; } - if ( flags & (RADEON_FRONT | RADEON_BACK) ) { BEGIN_RING( 4 ); |