r200_context.h revision 98c791b543c4ba86b8bb54488bd872b33b10b1aa
1bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl/* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */
2bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl/*
3adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellCopyright (C) The Weather Channel, Inc.  2002.  All Rights Reserved.
4adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
5adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellThe Weather Channel (TM) funded Tungsten Graphics to develop the
6adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellinitial release of the Radeon 8500 driver under the XFree86 license.
7adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellThis notice must be preserved.
8adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
9adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellPermission is hereby granted, free of charge, to any person obtaining
10adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwella copy of this software and associated documentation files (the
11adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell"Software"), to deal in the Software without restriction, including
12adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellwithout limitation the rights to use, copy, modify, merge, publish,
13adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwelldistribute, sublicense, and/or sell copies of the Software, and to
14adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellpermit persons to whom the Software is furnished to do so, subject to
15adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellthe following conditions:
16adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
17adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellThe above copyright notice and this permission notice (including the
18adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellnext paragraph) shall be included in all copies or substantial
19adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellportions of the Software.
20adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
21adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellIN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
25adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27adbec39bbf671ad80f6c557801e274cac0d305faKeith WhitwellWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
29adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell**************************************************************************/
30adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
31adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/*
32adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell * Authors:
33adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell *   Keith Whitwell <keith@tungstengraphics.com>
34adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
35adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
36adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#ifndef __R200_CONTEXT_H__
37adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define __R200_CONTEXT_H__
38adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
39e946688edac5cdf153652defae3ef732a3487416Ian Romanick#include "tnl/t_vertex.h"
40ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl#include "drm.h"
41ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl#include "radeon_drm.h"
42adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#include "dri_util.h"
43adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#include "texmem.h"
44adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
45adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#include "macros.h"
46adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#include "mtypes.h"
47adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#include "colormac.h"
48adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#include "r200_reg.h"
4998c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#include "r200_vertprog.h"
50adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
5195a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick#define ENABLE_HW_3D_TEXTURE 1  /* XXX this is temporary! */
52adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
53adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_context;
54adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwelltypedef struct r200_context r200ContextRec;
55adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwelltypedef struct r200_context *r200ContextPtr;
56adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
5708e62a147618ac796f5e548bdaa3380342ec2a78Roland Scheidegger/* This union is used to avoid warnings/miscompilation
5808e62a147618ac796f5e548bdaa3380342ec2a78Roland Scheidegger   with float to uint32_t casts due to strict-aliasing */
5908e62a147618ac796f5e548bdaa3380342ec2a78Roland Scheideggertypedef union { GLfloat f; uint32_t ui32; } float_ui32_type;
6008e62a147618ac796f5e548bdaa3380342ec2a78Roland Scheidegger
61adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#include "r200_lock.h"
623a5626cb846ad767fe1c38fe35ebe4df3e3a0454Eric Anholt#include "radeon_screen.h"
63adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#include "mm.h"
64adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
65adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* Flags for software fallback cases */
66adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* See correponding strings in r200_swtcl.c */
67ef377c3c007611e57aef176cb66d8b4c18f1a6c3Eric Anholt#define R200_FALLBACK_TEXTURE           0x01
68ef377c3c007611e57aef176cb66d8b4c18f1a6c3Eric Anholt#define R200_FALLBACK_DRAW_BUFFER       0x02
69ef377c3c007611e57aef176cb66d8b4c18f1a6c3Eric Anholt#define R200_FALLBACK_STENCIL           0x04
70ef377c3c007611e57aef176cb66d8b4c18f1a6c3Eric Anholt#define R200_FALLBACK_RENDER_MODE       0x08
71ef377c3c007611e57aef176cb66d8b4c18f1a6c3Eric Anholt#define R200_FALLBACK_DISABLE           0x10
72ef377c3c007611e57aef176cb66d8b4c18f1a6c3Eric Anholt#define R200_FALLBACK_BORDER_MODE       0x20
73adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
74adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* The blit width for texture uploads
75adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
76adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define BLIT_WIDTH_BYTES 1024
77adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
78adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* Use the templated vertex format:
79adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
80adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define COLOR_IS_RGBA
81adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TAG(x) r200##x
82adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#include "tnl_dd/t_dd_vertex.h"
83adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#undef TAG
84adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
85adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwelltypedef void (*r200_tri_func)( r200ContextPtr,
86adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				 r200Vertex *,
87adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				 r200Vertex *,
88adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				 r200Vertex * );
89adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
90adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwelltypedef void (*r200_line_func)( r200ContextPtr,
91adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				  r200Vertex *,
92adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				  r200Vertex * );
93adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
94adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwelltypedef void (*r200_point_func)( r200ContextPtr,
95adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				   r200Vertex * );
96adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
97adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
9898c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheideggerstruct r200_vertex_program {
9998c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger        struct vertex_program mesa_program; /* Must be first */
10098c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger        int translated;
10198c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger        VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 2];
10298c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger        int pos_end;
10398c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger        int inputs[VERT_ATTRIB_MAX];
10498c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger        int native;
10598c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger};
10698c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger
107adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_colorbuffer_state {
108adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint clear;
109fcbfeb5d28aea87c60f2d02daa213d0c0c2516e8Brian Paul#if 000
110adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLint drawOffset, drawPitch;
111fcbfeb5d28aea87c60f2d02daa213d0c0c2516e8Brian Paul#endif
112273e52f86fa41564f573c8e84d013f995e01a8f0Alan Hourihane   int roundEnable;
113adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
114adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
115adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
116adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_depthbuffer_state {
117b31b7836d6e7abf80dd4feacce333d4b1fe6e4abRoland Scheidegger   GLuint clear;
118adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLfloat scale;
119adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
120adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
121fcbfeb5d28aea87c60f2d02daa213d0c0c2516e8Brian Paul#if 000
122adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_pixel_state {
123adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLint readOffset, readPitch;
124adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
125fcbfeb5d28aea87c60f2d02daa213d0c0c2516e8Brian Paul#endif
126adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
127adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_scissor_state {
128ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl   drm_clip_rect_t rect;
129adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean enabled;
130adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
131adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint numClipRects;			/* Cliprects active */
132adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint numAllocedClipRects;		/* Cliprects available */
133ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl   drm_clip_rect_t *pClipRects;
134adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
135adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
136adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_stencilbuffer_state {
137adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean hwBuffer;
138adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint clear;			/* rb3d_stencilrefmask value */
139adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
140adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
141adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_stipple_state {
142adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint mask[32];
143adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
144adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
145adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
146adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
147adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TEX_0   0x1
148adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TEX_1   0x2
14948ccaf200940613032dfaaafe71382947f398004Roland Scheidegger#define TEX_2	0x4
15048ccaf200940613032dfaaafe71382947f398004Roland Scheidegger#define TEX_3	0x8
15148ccaf200940613032dfaaafe71382947f398004Roland Scheidegger#define TEX_4	0x10
15248ccaf200940613032dfaaafe71382947f398004Roland Scheidegger#define TEX_5	0x20
15348ccaf200940613032dfaaafe71382947f398004Roland Scheidegger#define TEX_ALL 0x3f
154adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
155adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwelltypedef struct r200_tex_obj r200TexObj, *r200TexObjPtr;
156adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
157adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* Texture object in locally shared texture space.
158adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
159adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_tex_obj {
160adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   driTextureObject   base;
161adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
162adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint bufAddr;			/* Offset to start of locally
163adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					   shared texture block */
164adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
165adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint dirty_state;		        /* Flags (1 per texunit) for
166adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					   whether or not this texobj
167adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					   has dirty hardware state
168adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					   (pp_*) that needs to be
169adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					   brought into the
170adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					   texunit. */
171adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
172ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl   drm_radeon_tex_image_t image[6][RADEON_MAX_TEXTURE_LEVELS];
173adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					/* Six, for the cube faces */
174adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
175adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint pp_txfilter;		        /* hardware register values */
176adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint pp_txformat;
177adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint pp_txformat_x;
178adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint pp_txoffset;		        /* Image location in texmem.
179adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					   All cube faces follow. */
180adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint pp_txsize;		        /* npot only */
181adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint pp_txpitch;		        /* npot only */
182adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint pp_border_color;
183adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint pp_cubic_faces;	        /* cube face 1,2,3,4 log2 sizes */
184adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
185adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean  border_fallback;
1864837ea30208d002bc36a836d2117f826d40c8bfaRoland Scheidegger
1874837ea30208d002bc36a836d2117f826d40c8bfaRoland Scheidegger   GLuint tile_bits;			/* hw texture tile bits used on this texture */
188adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
189adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
190adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
191adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_texture_env_state {
192adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   r200TexObjPtr texobj;
19336603539ccdb1c507724d8a1c314e6c9cc9863d9Roland Scheidegger   GLuint outputreg;
19436603539ccdb1c507724d8a1c314e6c9cc9863d9Roland Scheidegger   GLuint unitneeded;
195adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
196adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
19748ccaf200940613032dfaaafe71382947f398004Roland Scheidegger#define R200_MAX_TEXTURE_UNITS 6
198adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
199adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_texture_state {
200adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_texture_env_state unit[R200_MAX_TEXTURE_UNITS];
201adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
202adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
203adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
204adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_state_atom {
205adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom *next, *prev;
206adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   const char *name;		         /* for debug */
207adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int cmd_size;		         /* size in bytes */
208adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint idx;
209adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int *cmd;			         /* one or more cmd's */
210adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int *lastcmd;			 /* one or more cmd's */
211a05b1549f7b6da7d9313b9addf2d01b9c61f34d7Keith Whitwell   GLboolean dirty;
212adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean (*check)( GLcontext *, int );    /* is this state active? */
213adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
214adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
215adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
216adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
217adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* Trying to keep these relatively short as the variables are becoming
218adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell * extravagently long.  Drop the driver name prefix off the front of
219adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell * everything - I think we know which driver we're in by now, and keep the
220adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell * prefix to 3 letters unless absolutely impossible.
221adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
222adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
223adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_CMD_0             0
224adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_PP_MISC           1
225adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_PP_FOG_COLOR      2
226adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_RE_SOLID_COLOR    3
227adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_RB3D_BLENDCNTL    4
228adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_RB3D_DEPTHOFFSET  5
229adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_RB3D_DEPTHPITCH   6
230adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_RB3D_ZSTENCILCNTL 7
231adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_CMD_1             8
232adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_PP_CNTL           9
233adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_RB3D_CNTL         10
234adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_RB3D_COLOROFFSET  11
235adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_CMD_2             12 /* why */
236adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CTX_RB3D_COLORPITCH   13 /* why */
237033728555cb2f39d8c77f228e1eccc45329bb40aRoland Scheidegger#define CTX_STATE_SIZE_OLDDRM 14
238033728555cb2f39d8c77f228e1eccc45329bb40aRoland Scheidegger#define CTX_CMD_3             14
239033728555cb2f39d8c77f228e1eccc45329bb40aRoland Scheidegger#define CTX_RB3D_BLENDCOLOR   15
240033728555cb2f39d8c77f228e1eccc45329bb40aRoland Scheidegger#define CTX_RB3D_ABLENDCNTL   16
241033728555cb2f39d8c77f228e1eccc45329bb40aRoland Scheidegger#define CTX_RB3D_CBLENDCNTL   17
242033728555cb2f39d8c77f228e1eccc45329bb40aRoland Scheidegger#define CTX_STATE_SIZE_NEWDRM 18
243adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
244adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define SET_CMD_0               0
245adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define SET_SE_CNTL             1
246adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define SET_RE_CNTL             2 /* replace se_coord_fmt */
247adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define SET_STATE_SIZE          3
248adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
249adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTE_CMD_0               0
250adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTE_SE_VTE_CNTL         1
251adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTE_STATE_SIZE          2
252adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
253adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIN_CMD_0               0
254adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIN_RE_LINE_PATTERN     1
255adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIN_RE_LINE_STATE       2
256adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIN_CMD_1               3
257adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIN_SE_LINE_WIDTH       4
258adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIN_STATE_SIZE          5
259adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
260adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSK_CMD_0               0
261adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSK_RB3D_STENCILREFMASK 1
262adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSK_RB3D_ROPCNTL        2
263adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSK_RB3D_PLANEMASK      3
264adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSK_STATE_SIZE          4
265adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
266adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VPT_CMD_0           0
267adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VPT_SE_VPORT_XSCALE          1
268adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VPT_SE_VPORT_XOFFSET         2
269adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VPT_SE_VPORT_YSCALE          3
270adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VPT_SE_VPORT_YOFFSET         4
271adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VPT_SE_VPORT_ZSCALE          5
272adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VPT_SE_VPORT_ZOFFSET         6
273adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VPT_STATE_SIZE      7
274adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
275adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define ZBS_CMD_0               0
276adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define ZBS_SE_ZBIAS_FACTOR     1
277adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define ZBS_SE_ZBIAS_CONSTANT   2
278adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define ZBS_STATE_SIZE          3
279adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
280adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSC_CMD_0               0
281adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSC_RE_MISC             1
282adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSC_STATE_SIZE          2
283adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
284adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TAM_CMD_0               0
285adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TAM_DEBUG3              1
286adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TAM_STATE_SIZE          2
287adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
288adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TEX_CMD_0                   0
289adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TEX_PP_TXFILTER             1  /*2c00*/
290adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TEX_PP_TXFORMAT             2  /*2c04*/
291adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TEX_PP_TXFORMAT_X           3  /*2c08*/
292adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TEX_PP_TXSIZE               4  /*2c0c*/
293adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TEX_PP_TXPITCH              5  /*2c10*/
294adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TEX_PP_BORDER_COLOR         6  /*2c14*/
295f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define TEX_CMD_1_OLDDRM            7
296f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define TEX_PP_TXOFFSET_OLDDRM      8  /*2d00 */
297f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define TEX_STATE_SIZE_OLDDRM       9
298f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define TEX_PP_CUBIC_FACES          7
299f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define TEX_PP_TXMULTI_CTL          8
300f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define TEX_CMD_1_NEWDRM            9
301f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define TEX_PP_TXOFFSET_NEWDRM     10
302f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define TEX_STATE_SIZE_NEWDRM      11
303f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger
304f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define CUBE_CMD_0                  0  /* 1 register follows */ /* this command unnecessary */
305f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define CUBE_PP_CUBIC_FACES         1  /* 0x2c18 */             /* with new enough drm */
306adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CUBE_CMD_1                  2  /* 5 registers follow */
307adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CUBE_PP_CUBIC_OFFSET_F1     3  /* 0x2d04 */
308adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CUBE_PP_CUBIC_OFFSET_F2     4  /* 0x2d08 */
309adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CUBE_PP_CUBIC_OFFSET_F3     5  /* 0x2d0c */
310adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CUBE_PP_CUBIC_OFFSET_F4     6  /* 0x2d10 */
311adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CUBE_PP_CUBIC_OFFSET_F5     7  /* 0x2d14 */
312adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CUBE_STATE_SIZE             8
313adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
314adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define PIX_CMD_0                   0
315adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define PIX_PP_TXCBLEND             1
316adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define PIX_PP_TXCBLEND2            2
317adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define PIX_PP_TXABLEND             3
318adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define PIX_PP_TXABLEND2            4
319adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define PIX_STATE_SIZE              5
320adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
321adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TF_CMD_0                    0
322adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TF_TFACTOR_0                1
323adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TF_TFACTOR_1                2
324adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TF_TFACTOR_2                3
325adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TF_TFACTOR_3                4
326adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TF_TFACTOR_4                5
327adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TF_TFACTOR_5                6
328adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TF_STATE_SIZE               7
329adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
330f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_CMD_0                   0
331f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_TFACTOR_0               1
332f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_TFACTOR_1               2
333f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_TFACTOR_2               3
334f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_TFACTOR_3               4
335f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_TFACTOR_4               5
336f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_TFACTOR_5               6
337f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_TFACTOR_6               7
338f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_TFACTOR_7               8
339f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define ATF_STATE_SIZE              9
340f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger
341f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger/* ATI_FRAGMENT_SHADER */
342f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define AFS_CMD_0                 0
343f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define AFS_IC0                   1 /* 2f00 */
344f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define AFS_IC1                   2 /* 2f04 */
345f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define AFS_IA0                   3 /* 2f08 */
346f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define AFS_IA1                   4 /* 2f0c */
347f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger#define AFS_STATE_SIZE           33
348f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger
34998c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define PVS_CMD_0                 0
35098c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define PVS_CNTL_1                1
35198c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define PVS_CNTL_2                2
35298c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define PVS_STATE_SIZE            3
35398c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger
35498c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger/* those are quite big... */
35598c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_CMD_0                 0
35698c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_OPDST_0               1
35798c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_SRC0_0                2
35898c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_SRC1_0                3
35998c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_SRC2_0                4
36098c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_OPDST_63              253
36198c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_SRC0_63               254
36298c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_SRC1_63               255
36398c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_SRC2_63               256
36498c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPI_STATE_SIZE            257
36598c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger
36698c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_CMD_0                0
36798c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_PARAM0_0             1
36898c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_PARAM1_0             2
36998c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_PARAM2_0             3
37098c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_PARAM3_0             4
37198c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_PARAM0_95            381
37298c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_PARAM1_95            382
37398c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_PARAM2_95            383
37498c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_PARAM3_95            384
37598c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger#define VPP_STATE_SIZE           385
37698c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger
377adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_CMD_0                 0
378adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_LIGHT_MODEL_CTL_0     1
379adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_LIGHT_MODEL_CTL_1     2
380adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_PER_LIGHT_CTL_0       3
381adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_PER_LIGHT_CTL_1       4
382adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_PER_LIGHT_CTL_2       5
383adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_PER_LIGHT_CTL_3       6
384adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_CMD_1                 7
385adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_UCP_VERT_BLEND_CTL    8
386adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCL_STATE_SIZE            9
387adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
388adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSL_CMD_0                     0
389adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSL_MATRIX_SELECT_0           1
390adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSL_MATRIX_SELECT_1           2
391adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSL_MATRIX_SELECT_2           3
392adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSL_MATRIX_SELECT_3           4
393adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSL_MATRIX_SELECT_4           5
394adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MSL_STATE_SIZE                6
395adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
396adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCG_CMD_0                 0
397adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCG_TEX_PROC_CTL_2            1
398adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCG_TEX_PROC_CTL_3            2
399adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCG_TEX_PROC_CTL_0            3
400adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCG_TEX_PROC_CTL_1            4
401adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCG_TEX_CYL_WRAP_CTL      5
402adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define TCG_STATE_SIZE            6
403adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
404adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_CMD_0            0
405adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_EMMISSIVE_RED    1
406adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_EMMISSIVE_GREEN  2
407adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_EMMISSIVE_BLUE   3
408adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_EMMISSIVE_ALPHA  4
409adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_AMBIENT_RED      5
410adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_AMBIENT_GREEN    6
411adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_AMBIENT_BLUE     7
412adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_AMBIENT_ALPHA    8
413adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_DIFFUSE_RED      9
414adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_DIFFUSE_GREEN    10
415adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_DIFFUSE_BLUE     11
416adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_DIFFUSE_ALPHA    12
417adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_SPECULAR_RED     13
418adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_SPECULAR_GREEN   14
419adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_SPECULAR_BLUE    15
420adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_SPECULAR_ALPHA   16
421adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_CMD_1            17
422adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_SHININESS        18
423adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MTL_STATE_SIZE       19
424adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
425adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VAP_CMD_0                   0
426adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VAP_SE_VAP_CNTL             1
427adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VAP_STATE_SIZE              2
428adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
429adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* Replaces a lot of packet info from radeon
430adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
431adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_CMD_0                   0
432adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_VTXFMT_0            1
433adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_VTXFMT_1            2
434adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_TCL_OUTPUT_VTXFMT_0 3
435adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_TCL_OUTPUT_VTXFMT_1 4
436adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_CMD_1               5
437adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_TCL_OUTPUT_COMPSEL  6
438adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_CMD_2               7
439adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_STATE_CNTL          8
440adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_STATE_SIZE          9
441adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
44244dace86eaf9eded8e6465adfadf6345658686ddRoland Scheidegger/* SPR - point sprite state
44344dace86eaf9eded8e6465adfadf6345658686ddRoland Scheidegger */
44444dace86eaf9eded8e6465adfadf6345658686ddRoland Scheidegger#define SPR_CMD_0             0
44544dace86eaf9eded8e6465adfadf6345658686ddRoland Scheidegger#define SPR_POINT_SPRITE_CNTL 1
44644dace86eaf9eded8e6465adfadf6345658686ddRoland Scheidegger#define SPR_STATE_SIZE        2
447adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
448adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define VTX_COLOR(v,n)   (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\
449adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell                         R200_VTX_COLOR_MASK)
450adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
45195a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick/**
45295a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick * Given the \c R200_SE_VTX_FMT_1 for the current vertex state, determine
45395a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick * how many components are in texture coordinate \c n.
45495a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick */
45595a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick#define VTX_TEXn_COUNT(v,n)   (((v) >> (3 * n)) & 0x07)
45695a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick
457adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MAT_CMD_0              0
458adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MAT_ELT_0              1
459adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define MAT_STATE_SIZE         17
460adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
461adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GRD_CMD_0                  0
462adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GRD_VERT_GUARD_CLIP_ADJ    1
463adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GRD_VERT_GUARD_DISCARD_ADJ 2
464adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GRD_HORZ_GUARD_CLIP_ADJ    3
465adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GRD_HORZ_GUARD_DISCARD_ADJ 4
466adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GRD_STATE_SIZE             5
467adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
468adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* position changes frequently when lighting in modelpos - separate
469adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell * out to new state item?
470adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
471adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_CMD_0                  0
472adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_AMBIENT_RED            1
473adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_AMBIENT_GREEN          2
474adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_AMBIENT_BLUE           3
475adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_AMBIENT_ALPHA          4
476adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_DIFFUSE_RED            5
477adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_DIFFUSE_GREEN          6
478adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_DIFFUSE_BLUE           7
479adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_DIFFUSE_ALPHA          8
480adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_SPECULAR_RED           9
481adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_SPECULAR_GREEN         10
482adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_SPECULAR_BLUE          11
483adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_SPECULAR_ALPHA         12
484adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_POSITION_X             13
485adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_POSITION_Y             14
486adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_POSITION_Z             15
487adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_POSITION_W             16
488adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_DIRECTION_X            17
489adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_DIRECTION_Y            18
490adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_DIRECTION_Z            19
491adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_DIRECTION_W            20
4925d00e131d8a264498b8d050c3eded093ee5c42f2Michel Dänzer#define LIT_ATTEN_QUADRATIC        21
493adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_ATTEN_LINEAR           22
4945d00e131d8a264498b8d050c3eded093ee5c42f2Michel Dänzer#define LIT_ATTEN_CONST            23
495adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_ATTEN_XXX              24
496adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_CMD_1                  25
497adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_SPOT_DCD               26
498adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_SPOT_DCM               27
499adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_SPOT_EXPONENT          28
500adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_SPOT_CUTOFF            29
501adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_SPECULAR_THRESH        30
502adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_RANGE_CUTOFF           31 /* ? */
5035d00e131d8a264498b8d050c3eded093ee5c42f2Michel Dänzer#define LIT_ATTEN_CONST_INV        32
504adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define LIT_STATE_SIZE             33
505adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
506adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* Fog
507adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
508adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define FOG_CMD_0      0
509adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define FOG_R          1
510adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define FOG_C          2
511adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define FOG_D          3
512adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define FOG_PAD        4
513adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define FOG_STATE_SIZE 5
514adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
515adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* UCP
516adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
517adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define UCP_CMD_0      0
518adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define UCP_X          1
519adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define UCP_Y          2
520adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define UCP_Z          3
521adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define UCP_W          4
522adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define UCP_STATE_SIZE 5
523adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
524adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* GLT - Global ambient
525adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
526adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GLT_CMD_0      0
527adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GLT_RED        1
528adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GLT_GREEN      2
529adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GLT_BLUE       3
530adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GLT_ALPHA      4
531adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define GLT_STATE_SIZE 5
532adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
533adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* EYE
534adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
535adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define EYE_CMD_0          0
536adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define EYE_X              1
537adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define EYE_Y              2
538adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define EYE_Z              3
539adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define EYE_RESCALE_FACTOR 4
540adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define EYE_STATE_SIZE     5
541adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
542adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* CST - constant state
543adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
544adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_CMD_0                             0
545adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_PP_CNTL_X                         1
546adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_CMD_1                             2
547adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_RB3D_DEPTHXY_OFFSET               3
548adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_CMD_2                             4
549adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_RE_AUX_SCISSOR_CNTL               5
550adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_CMD_3                             6
551adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_RE_SCISSOR_TL_0                   7
552adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_RE_SCISSOR_BR_0                   8
553adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_CMD_4                             9
554adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_SE_VAP_CNTL_STATUS                10
555adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_CMD_5                             11
556adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_RE_POINTSIZE                      12
557adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_CMD_6                             13
558adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_SE_TCL_INPUT_VTX_0                14
559adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_SE_TCL_INPUT_VTX_1                15
560adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_SE_TCL_INPUT_VTX_2                16
561adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_SE_TCL_INPUT_VTX_3                17
562adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define CST_STATE_SIZE                        18
563adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
564fbe5296d1463e1052590b744f3d62ebb9e5d5dd4Roland Scheidegger#define PRF_CMD_0         0
565fbe5296d1463e1052590b744f3d62ebb9e5d5dd4Roland Scheidegger#define PRF_PP_TRI_PERF   1
566fbe5296d1463e1052590b744f3d62ebb9e5d5dd4Roland Scheidegger#define PRF_PP_PERF_CNTL  2
567fbe5296d1463e1052590b744f3d62ebb9e5d5dd4Roland Scheidegger#define PRF_STATE_SIZE    3
568adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
569adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
570adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_hw_state {
5710c8f8d3dc9d60ed34eeca7f3606651420a81753cEric Anholt   /* Head of the linked list of state atoms. */
5720c8f8d3dc9d60ed34eeca7f3606651420a81753cEric Anholt   struct r200_state_atom atomlist;
573adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
574adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Hardware state, stored as cmdbuf commands:
575adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    *   -- Need to doublebuffer for
576adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    *           - reviving state after loss of context
577adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    *           - eliding noop statechange loops? (except line stipple count)
578adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
579adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom ctx;
580adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom set;
581adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom vte;
582adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom lin;
583adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom msk;
584adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom vpt;
585adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom vap;
586adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom vtx;
587adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom tcl;
588adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom msl;
589adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom tcg;
590adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom msc;
591adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom cst;
592adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom tam;
593adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom tf;
59448ccaf200940613032dfaaafe71382947f398004Roland Scheidegger   struct r200_state_atom tex[6];
59548ccaf200940613032dfaaafe71382947f398004Roland Scheidegger   struct r200_state_atom cube[6];
596adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom zbs;
597fbe5296d1463e1052590b744f3d62ebb9e5d5dd4Roland Scheidegger   struct r200_state_atom mtl[2];
598fbe5296d1463e1052590b744f3d62ebb9e5d5dd4Roland Scheidegger   struct r200_state_atom mat[9];
599adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom lit[8]; /* includes vec, scl commands */
600adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom ucp[6];
601adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom pix[6]; /* pixshader stages */
602adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom eye; /* eye pos */
603adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state_atom grd; /* guard band clipping */
604fbe5296d1463e1052590b744f3d62ebb9e5d5dd4Roland Scheidegger   struct r200_state_atom fog;
605fbe5296d1463e1052590b744f3d62ebb9e5d5dd4Roland Scheidegger   struct r200_state_atom glt;
606fbe5296d1463e1052590b744f3d62ebb9e5d5dd4Roland Scheidegger   struct r200_state_atom prf;
607f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger   struct r200_state_atom afs[2];
60898c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger   struct r200_state_atom pvs;
60998c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger   struct r200_state_atom vpi[2];
61098c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger   struct r200_state_atom vpp[2];
611f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger   struct r200_state_atom atf;
61244dace86eaf9eded8e6465adfadf6345658686ddRoland Scheidegger   struct r200_state_atom spr;
6136f3cc6a5226fd4b5d44cca91e2f76216ecaff831Eric Anholt
6146f3cc6a5226fd4b5d44cca91e2f76216ecaff831Eric Anholt   int max_state_size;	/* Number of bytes necessary for a full state emit. */
6150c8f8d3dc9d60ed34eeca7f3606651420a81753cEric Anholt   GLboolean is_dirty, all_dirty;
616adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
617adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
618adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_state {
619adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Derived state for internal purposes:
620adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
621adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_colorbuffer_state color;
622adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_depthbuffer_state depth;
623fcbfeb5d28aea87c60f2d02daa213d0c0c2516e8Brian Paul#if 00
624adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_pixel_state pixel;
625fcbfeb5d28aea87c60f2d02daa213d0c0c2516e8Brian Paul#endif
626adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_scissor_state scissor;
627adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_stencilbuffer_state stencil;
628adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_stipple_state stipple;
629adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_texture_state texture;
63036603539ccdb1c507724d8a1c314e6c9cc9863d9Roland Scheidegger   GLuint envneeded;
631adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
632adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
633adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* Need refcounting on dma buffers:
634adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
635adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_dma_buffer {
636adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int refcount;		/* the number of retained regions in buf */
637adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   drmBufPtr buf;
638adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
639adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
640bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl#define GET_START(rvb) (rmesa->r200Screen->gart_buffer_offset +		\
641adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell			(rvb)->address - rmesa->dma.buf0_address +	\
642adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell			(rvb)->start)
643adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
644adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* A retained region, eg vertices for indexed vertices.
645adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
646adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_dma_region {
647adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_buffer *buf;
648adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   char *address;		/* == buf->address */
649adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int start, end, ptr;		/* offsets from start of buf */
650adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int aos_start;
651adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int aos_stride;
652adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int aos_size;
653adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
654adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
655adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
656adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_dma {
657adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Active dma region.  Allocations for vertices and retained
658adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    * regions come from here.  Also used for emitting random vertices,
659adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    * these may be flushed by calling flush_current();
660adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
661adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_region current;
662adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
663adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   void (*flush)( r200ContextPtr );
664adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
665adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   char *buf0_address;		/* start of buf[0], for index calcs */
666adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint nr_released_bufs;	/* flush after so many buffers released */
667adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
668adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
669adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_dri_mirror {
670adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   __DRIcontextPrivate	*context;	/* DRI context */
671adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   __DRIscreenPrivate	*screen;	/* DRI screen */
672adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   __DRIdrawablePrivate	*drawable;	/* DRI drawable bound to this ctx */
673adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
674c06b25594e5effe34a90c067e1a3da0f61cf2b13Ian Romanick   drm_context_t hwContext;
675ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl   drm_hw_lock_t *hwLock;
676adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int fd;
677adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int drmMinor;
678adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
679adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
680adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
6818a6182105772280e2727de4a00809c8fb7b13c87Roland Scheidegger#define R200_CMD_BUF_SZ  (16*1024)
682adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
683adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_store {
684adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint statenr;
685adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint primnr;
686adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   char cmd_buf[R200_CMD_BUF_SZ];
687adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int cmd_used;
688adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int elts_start;
689adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
690adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
691adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
692adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* r200_tcl.c
693adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
694adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_tcl_info {
695adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint vertex_format;
696adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLint last_offset;
697adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint hw_primitive;
698adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
6996ff023fe3a3fab14c33d20218155f82e1ed76b7eRoland Scheidegger/* FIXME: what's the maximum number of components? */
7006ff023fe3a3fab14c33d20218155f82e1ed76b7eRoland Scheidegger   struct r200_dma_region *aos_components[11];
701adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint nr_aos_components;
702adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
703adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint *Elts;
704adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
705adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_region indexed_verts;
706adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_region obj;
707adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_region rgba;
708adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_region spec;
709adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_region fog;
710adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_region tex[R200_MAX_TEXTURE_UNITS];
711adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_region norm;
712adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
713adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
714adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
715adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* r200_swtcl.c
716adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
717adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_swtcl_info {
718adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint RenderIndex;
719e946688edac5cdf153652defae3ef732a3487416Ian Romanick
720e946688edac5cdf153652defae3ef732a3487416Ian Romanick   /**
721e946688edac5cdf153652defae3ef732a3487416Ian Romanick    * Size of a hardware vertex.  This is calculated when \c ::vertex_attrs is
722e946688edac5cdf153652defae3ef732a3487416Ian Romanick    * installed in the Mesa state vector.
723e946688edac5cdf153652defae3ef732a3487416Ian Romanick    */
724adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint vertex_size;
725e946688edac5cdf153652defae3ef732a3487416Ian Romanick
726e946688edac5cdf153652defae3ef732a3487416Ian Romanick   /**
727e946688edac5cdf153652defae3ef732a3487416Ian Romanick    * Attributes instructing the Mesa TCL pipeline where / how to put vertex
728e946688edac5cdf153652defae3ef732a3487416Ian Romanick    * data in the hardware buffer.
729e946688edac5cdf153652defae3ef732a3487416Ian Romanick    */
730e946688edac5cdf153652defae3ef732a3487416Ian Romanick   struct tnl_attr_map vertex_attrs[VERT_ATTRIB_MAX];
731e946688edac5cdf153652defae3ef732a3487416Ian Romanick
732e946688edac5cdf153652defae3ef732a3487416Ian Romanick   /**
733e946688edac5cdf153652defae3ef732a3487416Ian Romanick    * Number of elements of \c ::vertex_attrs that are actually used.
734e946688edac5cdf153652defae3ef732a3487416Ian Romanick    */
735e946688edac5cdf153652defae3ef732a3487416Ian Romanick   GLuint vertex_attr_count;
736e946688edac5cdf153652defae3ef732a3487416Ian Romanick
737e946688edac5cdf153652defae3ef732a3487416Ian Romanick   /**
738e946688edac5cdf153652defae3ef732a3487416Ian Romanick    * Cached pointer to the buffer where Mesa will store vertex data.
739e946688edac5cdf153652defae3ef732a3487416Ian Romanick    */
7405df82c82bd53db90eb72c5aad4dd20cf6f1116b1Brian Paul   GLubyte *verts;
741adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
742adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Fallback rasterization functions
743adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
744adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   r200_point_func draw_point;
745adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   r200_line_func draw_line;
746adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   r200_tri_func draw_tri;
747adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
748adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint hw_primitive;
749adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLenum render_primitive;
750adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint numverts;
751adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
752e946688edac5cdf153652defae3ef732a3487416Ian Romanick   /**
753e946688edac5cdf153652defae3ef732a3487416Ian Romanick    * Offset of the 4UB color data within a hardware (swtcl) vertex.
754e946688edac5cdf153652defae3ef732a3487416Ian Romanick    */
755e946688edac5cdf153652defae3ef732a3487416Ian Romanick   GLuint coloroffset;
756e946688edac5cdf153652defae3ef732a3487416Ian Romanick
757e946688edac5cdf153652defae3ef732a3487416Ian Romanick   /**
758e946688edac5cdf153652defae3ef732a3487416Ian Romanick    * Offset of the 3UB specular color data within a hardware (swtcl) vertex.
759e946688edac5cdf153652defae3ef732a3487416Ian Romanick    */
760e946688edac5cdf153652defae3ef732a3487416Ian Romanick   GLuint specoffset;
761e946688edac5cdf153652defae3ef732a3487416Ian Romanick
762e946688edac5cdf153652defae3ef732a3487416Ian Romanick   /**
763e946688edac5cdf153652defae3ef732a3487416Ian Romanick    * Should Mesa project vertex data or will the hardware do it?
764e946688edac5cdf153652defae3ef732a3487416Ian Romanick    */
765e946688edac5cdf153652defae3ef732a3487416Ian Romanick   GLboolean needproj;
766e946688edac5cdf153652defae3ef732a3487416Ian Romanick
767adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma_region indexed_verts;
768adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
769adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
770adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
771adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_ioctl {
772adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint vertex_offset;
773adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint vertex_size;
774adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
775adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
776adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
777adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
778adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define R200_MAX_PRIMS 64
779adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
780adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
781adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* Want to keep a cache of these around.  Each is parameterized by
782adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell * only a single value which has only a small range.  Only expect a
783adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell * few, so just rescan the list each time?
784adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
785adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct dynfn {
786adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *next, *prev;
787adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int key[2];
788adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   char *code;
789adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
790adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
791adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct dfn_lists {
792adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Vertex2f;
793adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Vertex2fv;
794adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Vertex3f;
795adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Vertex3fv;
796adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Color4ub;
797adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Color4ubv;
798adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Color3ub;
799adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Color3ubv;
800adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Color4f;
801adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Color4fv;
802adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Color3f;
803adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Color3fv;
804adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn SecondaryColor3ubEXT;
805adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn SecondaryColor3ubvEXT;
806adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn SecondaryColor3fEXT;
807adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn SecondaryColor3fvEXT;
808adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Normal3f;
809adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn Normal3fv;
81095a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick   struct dynfn TexCoord3f;
81195a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick   struct dynfn TexCoord3fv;
812adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn TexCoord2f;
813adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn TexCoord2fv;
814adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn TexCoord1f;
815adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn TexCoord1fv;
81695a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick   struct dynfn MultiTexCoord3fARB;
81795a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick   struct dynfn MultiTexCoord3fvARB;
818adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn MultiTexCoord2fARB;
819adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn MultiTexCoord2fvARB;
820adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn MultiTexCoord1fARB;
821adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn MultiTexCoord1fvARB;
822d294f79190a5b25ef0fbbbf3ac94b15c9402d009Roland Scheidegger   struct dynfn FogCoordfEXT;
823d294f79190a5b25ef0fbbbf3ac94b15c9402d009Roland Scheidegger   struct dynfn FogCoordfvEXT;
824adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
825adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
826adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct dfn_generators {
827adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Vertex2f)( GLcontext *, const int * );
828adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Vertex2fv)( GLcontext *, const int * );
829adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Vertex3f)( GLcontext *, const int * );
830adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Vertex3fv)( GLcontext *, const int * );
831adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Color4ub)( GLcontext *, const int * );
832adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Color4ubv)( GLcontext *, const int * );
833adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Color3ub)( GLcontext *, const int * );
834adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Color3ubv)( GLcontext *, const int * );
835adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Color4f)( GLcontext *, const int * );
836adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Color4fv)( GLcontext *, const int * );
837adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Color3f)( GLcontext *, const int * );
838adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Color3fv)( GLcontext *, const int * );
839adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*SecondaryColor3ubEXT)( GLcontext *, const int * );
840adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*SecondaryColor3ubvEXT)( GLcontext *, const int * );
841adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*SecondaryColor3fEXT)( GLcontext *, const int * );
842adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*SecondaryColor3fvEXT)( GLcontext *, const int * );
843adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Normal3f)( GLcontext *, const int * );
844adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*Normal3fv)( GLcontext *, const int * );
84595a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick   struct dynfn *(*TexCoord3f)( GLcontext *, const int * );
84695a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick   struct dynfn *(*TexCoord3fv)( GLcontext *, const int * );
847adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*TexCoord2f)( GLcontext *, const int * );
848adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*TexCoord2fv)( GLcontext *, const int * );
849adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*TexCoord1f)( GLcontext *, const int * );
850adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*TexCoord1fv)( GLcontext *, const int * );
85195a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick   struct dynfn *(*MultiTexCoord3fARB)( GLcontext *, const int * );
85295a0bd6762737bb25bdf5c4147da9d1372f6aac3Ian Romanick   struct dynfn *(*MultiTexCoord3fvARB)( GLcontext *, const int * );
853adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*MultiTexCoord2fARB)( GLcontext *, const int * );
854adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*MultiTexCoord2fvARB)( GLcontext *, const int * );
855adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*MultiTexCoord1fARB)( GLcontext *, const int * );
856adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dynfn *(*MultiTexCoord1fvARB)( GLcontext *, const int * );
857d294f79190a5b25ef0fbbbf3ac94b15c9402d009Roland Scheidegger   struct dynfn *(*FogCoordfEXT)( GLcontext *, const int * );
858d294f79190a5b25ef0fbbbf3ac94b15c9402d009Roland Scheidegger   struct dynfn *(*FogCoordfvEXT)( GLcontext *, const int * );
859adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
860adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
861adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
862adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
863adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_prim {
864adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint start;
865adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint end;
866adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint prim;
867adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
868adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
86948ccaf200940613032dfaaafe71382947f398004Roland Scheidegger   /* A maximum total of 29 elements per vertex:  3 floats for position, 3
870adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    * floats for normal, 4 floats for color, 4 bytes for secondary color,
87148ccaf200940613032dfaaafe71382947f398004Roland Scheidegger    * 3 floats for each texture unit (18 floats total).
872adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    *
87348ccaf200940613032dfaaafe71382947f398004Roland Scheidegger    * we maybe need add. 4 to prevent segfault if someone specifies
87448ccaf200940613032dfaaafe71382947f398004Roland Scheidegger    * GL_TEXTURE6/GL_TEXTURE7 (esp. for the codegen-path) (FIXME: )
875adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    *
876adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    * The position data is never actually stored here, so 3 elements could be
877adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    * trimmed out of the buffer.
878adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
87948ccaf200940613032dfaaafe71382947f398004Roland Scheidegger
88048ccaf200940613032dfaaafe71382947f398004Roland Scheidegger#define R200_MAX_VERTEX_SIZE ((3*6)+11)
88148ccaf200940613032dfaaafe71382947f398004Roland Scheidegger
88248ccaf200940613032dfaaafe71382947f398004Roland Scheideggerstruct r200_vbinfo {
88348ccaf200940613032dfaaafe71382947f398004Roland Scheidegger   GLint counter, initial_counter;
88448ccaf200940613032dfaaafe71382947f398004Roland Scheidegger   GLint *dmaptr;
88548ccaf200940613032dfaaafe71382947f398004Roland Scheidegger   void (*notify)( void );
88648ccaf200940613032dfaaafe71382947f398004Roland Scheidegger   GLint vertex_size;
88748ccaf200940613032dfaaafe71382947f398004Roland Scheidegger
88848ccaf200940613032dfaaafe71382947f398004Roland Scheidegger   union { float f; int i; r200_color_t color; } vertex[R200_MAX_VERTEX_SIZE];
889adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
890adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLfloat *normalptr;
891adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLfloat *floatcolorptr;
892d294f79190a5b25ef0fbbbf3ac94b15c9402d009Roland Scheidegger   GLfloat *fogptr;
893adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   r200_color_t *colorptr;
894adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLfloat *floatspecptr;
895adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   r200_color_t *specptr;
89648ccaf200940613032dfaaafe71382947f398004Roland Scheidegger   GLfloat *texcoordptr[8];	/* 6 (TMU) + 2 for r200_vtxfmt_c.c when GL_TEXTURE6/7 */
897adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
898adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
899adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLenum *prim;		/* &ctx->Driver.CurrentExecPrimitive */
900adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint primflags;
901adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean enabled;		/* *_NO_VTXFMT / *_NO_TCL env vars */
902adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean installed;
903adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean fell_back;
904adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean recheck;
905adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLint nrverts;
906adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint vtxfmt_0, vtxfmt_1;
907adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
908adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint installed_vertex_format;
909adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint installed_color_3f_sz;
910adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
911adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_prim primlist[R200_MAX_PRIMS];
912adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   int nrprims;
913adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
914adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dfn_lists dfn_cache;
915adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct dfn_generators codegen;
916adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLvertexformat vtxfmt;
917adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
918adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
919adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
920adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstruct r200_context {
921adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLcontext *glCtx;			/* Mesa context */
922adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
923adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Driver and hardware state management
924adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
925adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_hw_state hw;
926adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_state state;
92798c791b543c4ba86b8bb54488bd872b33b10b1aaRoland Scheidegger   struct r200_vertex_program *curr_vp_hw;
928adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
929adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Texture object bookkeeping
930adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
931adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   unsigned              nr_heaps;
9323a5626cb846ad767fe1c38fe35ebe4df3e3a0454Eric Anholt   driTexHeap          * texture_heaps[ RADEON_NR_TEX_HEAPS ];
933adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   driTextureObject      swapped;
934d907a75498360fb96ec2314bb0abb105be74d500Alan Hourihane   int                   texture_depth;
935d3fd7ba8af15bead2f770d68a893449adeb11397Brian Paul   float                 initialMaxAnisotropy;
936adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
937adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Rasterization and vertex state:
938adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
939adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint TclFallback;
940adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint Fallback;
941adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint NewGLState;
942bb38cadb1c5f2dc13096a091bdaf61dc3e3cfa4dMichal Krol   DECLARE_RENDERINPUTS(tnl_index_bitset);	/* index of bits for last tnl_install_attrs */
943adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
944adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Vertex buffers
945adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
946adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_ioctl ioctl;
947adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dma dma;
948adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_store store;
9497a086dc05e665a78f7e9d069aa4fc70e844b8988Eric Anholt   /* A full state emit as of the first state emit in the main store, in case
9507a086dc05e665a78f7e9d069aa4fc70e844b8988Eric Anholt    * the context is lost.
9517a086dc05e665a78f7e9d069aa4fc70e844b8988Eric Anholt    */
9527a086dc05e665a78f7e9d069aa4fc70e844b8988Eric Anholt   struct r200_store backup_store;
953adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
954adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Page flipping
955adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
956adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint doPageFlip;
957adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
958adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Busy waiting
959adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
960adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint do_usleeps;
961adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint do_irqs;
962adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint irqsEmitted;
963ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl   drm_radeon_irq_wait_t iw;
964adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
965adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Clientdata textures;
966adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
967bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl   GLuint prefer_gart_client_texturing;
968adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
969adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Drawable, cliprect and scissor information
970adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
971adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint numClipRects;			/* Cliprects for the draw buffer */
972ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl   drm_clip_rect_t *pClipRects;
973adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   unsigned int lastStamp;
974adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean lost_context;
9757a086dc05e665a78f7e9d069aa4fc70e844b8988Eric Anholt   GLboolean save_on_next_emit;
9763a5626cb846ad767fe1c38fe35ebe4df3e3a0454Eric Anholt   radeonScreenPtr r200Screen;	/* Screen private DRI data */
977ae4a1cc0666860bf5cc37a5cb549afc9aa5448b0Jon Smirl   drm_radeon_sarea_t *sarea;		/* Private SAREA data */
978adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
979adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* TCL stuff
980adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
981adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLmatrix TexGenMatrix[R200_MAX_TEXTURE_UNITS];
982adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean recheck_texgen[R200_MAX_TEXTURE_UNITS];
983adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLboolean TexGenNeedNormals[R200_MAX_TEXTURE_UNITS];
98424a44d74b6e9880dfc019bd1cfa9ce0351377c85Roland Scheidegger   GLuint TexMatEnabled;
985adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint TexMatCompSel;
986adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint TexGenEnabled;
987adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint TexGenCompSel;
988adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLmatrix tmpmat;
989adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
990adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* VBI / buffer swap
991adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
992adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint vbl_seq;
993adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint vblank_flags;
994adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
995afa446db83ecf5dcb38ce46648fb12911628de32Ian Romanick   int64_t swap_ust;
996afa446db83ecf5dcb38ce46648fb12911628de32Ian Romanick   int64_t swap_missed_ust;
997adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
998adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint swap_count;
999adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   GLuint swap_missed_count;
1000adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1001adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1002adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* r200_tcl.c
1003adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
1004adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_tcl_info tcl;
1005adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1006adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* r200_swtcl.c
1007adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
1008adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_swtcl_info swtcl;
1009adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1010adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* r200_vtxfmt.c
1011adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
1012adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_vbinfo vb;
1013adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1014adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   /* Mirrors of some DRI state
1015adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell    */
1016adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   struct r200_dri_mirror dri;
1017bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl
1018bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl   /* Configuration cache
1019bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl    */
1020bcc6eddd335e97d49ed2ef3a1440f94d58dce12dJon Smirl   driOptionCache optionCache;
1021b31b7836d6e7abf80dd4feacce333d4b1fe6e4abRoland Scheidegger
1022b31b7836d6e7abf80dd4feacce333d4b1fe6e4abRoland Scheidegger   GLboolean using_hyperz;
10234837ea30208d002bc36a836d2117f826d40c8bfaRoland Scheidegger   GLboolean texmicrotile;
1024f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger
1025f20917de5bd2b1fc152e74304d3649a1f6042422Roland Scheidegger  struct ati_fragment_shader *afs_loaded;
1026adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell};
1027adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1028adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define R200_CONTEXT(ctx)		((r200ContextPtr)(ctx->DriverCtx))
1029adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1030adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1031adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellstatic __inline GLuint r200PackColor( GLuint cpp,
1032adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					GLubyte r, GLubyte g,
1033adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell					GLubyte b, GLubyte a )
1034adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell{
1035adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   switch ( cpp ) {
1036adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   case 2:
1037adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell      return PACK_COLOR_565( r, g, b );
1038adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   case 4:
1039adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell      return PACK_COLOR_8888( a, r, g, b );
1040adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   default:
1041adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell      return 0;
1042adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell   }
1043adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell}
1044adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1045adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1046adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellextern void r200DestroyContext( __DRIcontextPrivate *driContextPriv );
1047adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellextern GLboolean r200CreateContext( const __GLcontextModes *glVisual,
1048adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				    __DRIcontextPrivate *driContextPriv,
1049adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				    void *sharedContextPrivate);
1050adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellextern void r200SwapBuffers( __DRIdrawablePrivate *dPriv );
1051f2ad1b60c0da11283b399008f491792790cea294Brian Paulextern void r200CopySubBuffer( __DRIdrawablePrivate * dPriv,
1052f2ad1b60c0da11283b399008f491792790cea294Brian Paul			       int x, int y, int w, int h );
1053adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellextern GLboolean r200MakeCurrent( __DRIcontextPrivate *driContextPriv,
1054adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				  __DRIdrawablePrivate *driDrawPriv,
1055adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell				  __DRIdrawablePrivate *driReadPriv );
1056adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellextern GLboolean r200UnbindContext( __DRIcontextPrivate *driContextPriv );
1057adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1058adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell/* ================================================================
1059adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell * Debugging:
1060adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell */
1061adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DO_DEBUG		1
1062adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1063adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#if DO_DEBUG
1064adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwellextern int R200_DEBUG;
1065adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#else
1066adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define R200_DEBUG		0
1067adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#endif
1068adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1069adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_TEXTURE	0x001
1070adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_STATE	0x002
1071adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_IOCTL	0x004
1072adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_PRIMS	0x008
1073adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_VERTS	0x010
1074adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_FALLBACKS	0x020
1075adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_VFMT	0x040
1076adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_CODEGEN	0x080
1077adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_VERBOSE	0x100
1078adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_DRI       0x200
1079adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_DMA       0x400
1080adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_SANITY    0x800
1081adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_SYNC      0x1000
1082adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_PIXEL     0x2000
1083adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#define DEBUG_MEMORY    0x4000
1084adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell
1085adbec39bbf671ad80f6c557801e274cac0d305faKeith Whitwell#endif /* __R200_CONTEXT_H__ */
1086