From e856edb2794cba9d321486f602a9e07b917ce949 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 10 May 2007 17:45:27 +0000 Subject: r300: Moved some more of the emit code into r300_render.c. --- src/mesa/drivers/dri/r300/r300_emit.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_emit.h') diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index bccb84933a..b8242ad41e 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -227,20 +227,6 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) cmd[0].i = cmdwait(flags); } -/** - * fire vertex buffer - */ -static void inline fire_AOS(r300ContextPtr rmesa, int vertex_count, int type) -{ - int cmd_reserved = 0; - int cmd_written = 0; - drm_radeon_cmd_header_t *cmd = NULL; - - start_packet3(RADEON_CP_PACKET3_3D_DRAW_VBUF_2, 0); - e32(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (vertex_count << 16) - | type); -} - /** * These are followed by the corresponding data */ -- cgit v1.2.3 From 02e44e41c8bf4b4311b7d244543a0681db851bdd Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Thu, 10 May 2007 21:28:04 +0000 Subject: r300: Removed obsolete start_index16_packet/start_index32_packet. It's all in r300_render.c now. --- src/mesa/drivers/dri/r300/r300_emit.h | 22 ---------------------- 1 file changed, 22 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_emit.h') diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index b8242ad41e..ae084d4b1d 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -227,26 +227,4 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) cmd[0].i = cmdwait(flags); } -/** - * These are followed by the corresponding data - */ -#define start_index32_packet(vertex_count, type) \ - do { \ - int _vc; \ - _vc = (vertex_count); \ - start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, _vc); \ - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (_vc<<16) | \ - type | R300_VAP_VF_CNTL__INDEX_SIZE_32bit); \ - } while (0); - -#define start_index16_packet(vertex_count, type) \ - do { \ - int _vc, _n; \ - _vc = (vertex_count); \ - _n = (vertex_count+1)>>1; \ - start_packet3(RADEON_CP_PACKET3_3D_DRAW_INDX_2, _n); \ - e32(R300_VAP_VF_CNTL__PRIM_WALK_INDICES | (_vc<<16) | \ - type); \ - } while (0); - #endif -- cgit v1.2.3 From b63c70666fe3187ac17024f29ff7c2c49849c1e0 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 17:07:09 +0000 Subject: r300: Renamed r300_maos.c to r300_emit.c; it contains mostly emit code now. --- src/mesa/drivers/dri/r300/r300_emit.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mesa/drivers/dri/r300/r300_emit.h') diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index ae084d4b1d..5e3efcfcf0 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -227,4 +227,12 @@ void static inline cp_wait(r300ContextPtr rmesa, unsigned char flags) cmd[0].i = cmdwait(flags); } +extern int r300EmitArrays(GLcontext * ctx); + +#ifdef USER_BUFFERS +void r300UseArrays(GLcontext * ctx); +#endif + +extern void r300ReleaseArrays(GLcontext * ctx); + #endif -- cgit v1.2.3 From c729e67321e689e6109b36f64c9fc31f76c10e35 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Fri, 11 May 2007 20:09:01 +0000 Subject: r300: Use __FUNCTION__ not __func__. Just for consistency; most of the code already uses __FUNCTION__. --- src/mesa/drivers/dri/r300/r300_emit.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_emit.h') diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 5e3efcfcf0..7be098f743 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -134,7 +134,7 @@ static __inline__ uint32_t cmdpacify(void) cmd = (drm_radeon_cmd_header_t*) \ r300AllocCmdBuf(rmesa, \ (_n+2), \ - __func__); \ + __FUNCTION__); \ cmd_reserved=_n+2; \ cmd_written=1; \ cmd[0].i=cmdpacket0((reg), _n+1); \ @@ -169,7 +169,7 @@ static __inline__ uint32_t cmdpacify(void) cmd = (drm_radeon_cmd_header_t*) \ r300AllocCmdBuf(rmesa, \ (_n+1), \ - __func__); \ + __FUNCTION__); \ cmd_reserved = _n+2; \ cmd_written =1; \ cmd[0].i = cmdvpu((dest), _n/4); \ @@ -184,7 +184,7 @@ static __inline__ uint32_t cmdpacify(void) cmd = (drm_radeon_cmd_header_t*) \ r300AllocCmdBuf(rmesa, \ (_n+3), \ - __func__); \ + __FUNCTION__); \ cmd_reserved = _n+3; \ cmd_written = 2; \ if(_n > 0x3fff) { \ -- cgit v1.2.3 From 62b6eef0d72f42fa73210a67f2afc37547e7b8b5 Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Sat, 19 May 2007 05:41:55 +0000 Subject: r300: Just use "inline" rather than "__inline__". --- src/mesa/drivers/dri/r300/r300_emit.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_emit.h') diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 7be098f743..4f841a5413 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -59,7 +59,7 @@ #define CP_PACKET0(reg, n) (RADEON_CP_PACKET0 | ((n)<<16) | ((reg)>>2)) -static __inline__ uint32_t cmdpacket0(int reg, int count) +static inline uint32_t cmdpacket0(int reg, int count) { drm_r300_cmd_header_t cmd; @@ -71,7 +71,7 @@ static __inline__ uint32_t cmdpacket0(int reg, int count) return cmd.u; } -static __inline__ uint32_t cmdvpu(int addr, int count) +static inline uint32_t cmdvpu(int addr, int count) { drm_r300_cmd_header_t cmd; @@ -83,7 +83,7 @@ static __inline__ uint32_t cmdvpu(int addr, int count) return cmd.u; } -static __inline__ uint32_t cmdpacket3(int packet) +static inline uint32_t cmdpacket3(int packet) { drm_r300_cmd_header_t cmd; @@ -93,7 +93,7 @@ static __inline__ uint32_t cmdpacket3(int packet) return cmd.u; } -static __inline__ uint32_t cmdcpdelay(unsigned short count) +static inline uint32_t cmdcpdelay(unsigned short count) { drm_r300_cmd_header_t cmd; @@ -103,7 +103,7 @@ static __inline__ uint32_t cmdcpdelay(unsigned short count) return cmd.u; } -static __inline__ uint32_t cmdwait(unsigned char flags) +static inline uint32_t cmdwait(unsigned char flags) { drm_r300_cmd_header_t cmd; @@ -113,7 +113,7 @@ static __inline__ uint32_t cmdwait(unsigned char flags) return cmd.u; } -static __inline__ uint32_t cmdpacify(void) +static inline uint32_t cmdpacify(void) { drm_r300_cmd_header_t cmd; -- cgit v1.2.3 From 1baef2f080b2afe806e9dc85a5930cb0dfb4c66e Mon Sep 17 00:00:00 2001 From: Oliver McFadden Date: Mon, 28 May 2007 00:16:50 +0000 Subject: r300: Use the CP_PACKET3 macro for Type 3 packets. I haven't converted all of the Type 3 packets to the CP_PACKET3 macro yet because some of the Type 3 packet defines are missing from the R300 register definition file. These defines need to be copied from DRM and Mesa into the R300 register definition file then copied into both DRM and Mesa. --- src/mesa/drivers/dri/r300/r300_emit.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/mesa/drivers/dri/r300/r300_emit.h') diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 4f841a5413..2f79ee3a23 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -44,20 +44,11 @@ #include "r300_cmdbuf.h" #include "radeon_reg.h" -/* - * CP type-3 packets - */ -#define RADEON_CP_PACKET3_UNK1B 0xC0001B00 -#define RADEON_CP_PACKET3_INDX_BUFFER 0xC0003300 -#define RADEON_CP_PACKET3_3D_DRAW_VBUF_2 0xC0003400 -#define RADEON_CP_PACKET3_3D_DRAW_IMMD_2 0xC0003500 -#define RADEON_CP_PACKET3_3D_DRAW_INDX_2 0xC0003600 -#define RADEON_CP_PACKET3_3D_LOAD_VBPNTR 0xC0002F00 -#define RADEON_CP_PACKET3_3D_CLEAR_ZMASK 0xC0003202 -#define RADEON_CP_PACKET3_3D_CLEAR_CMASK 0xC0003802 -#define RADEON_CP_PACKET3_3D_CLEAR_HIZ 0xC0003702 - +/* TODO: move these defines (and the ones from DRM) into r300_reg.h and sync up + * with DRM */ #define CP_PACKET0(reg, n) (RADEON_CP_PACKET0 | ((n)<<16) | ((reg)>>2)) +#define CP_PACKET3( pkt, n ) \ + (RADEON_CP_PACKET3 | (pkt) | ((n) << 16)) static inline uint32_t cmdpacket0(int reg, int count) { -- cgit v1.2.3