Support loop, conditional update fix
[mesa.git] / src / mesa / drivers / dri / i965 / brw_aub.h
1 /*
2 Copyright (C) Intel Corp. 2006. All Rights Reserved.
3 Intel funded Tungsten Graphics (http://www.tungstengraphics.com) to
4 develop this 3D driver.
5
6 Permission is hereby granted, free of charge, to any person obtaining
7 a copy of this software and associated documentation files (the
8 "Software"), to deal in the Software without restriction, including
9 without limitation the rights to use, copy, modify, merge, publish,
10 distribute, sublicense, and/or sell copies of the Software, and to
11 permit persons to whom the Software is furnished to do so, subject to
12 the following conditions:
13
14 The above copyright notice and this permission notice (including the
15 next paragraph) shall be included in all copies or substantial
16 portions of the Software.
17
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
22 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
26 **********************************************************************/
27 /*
28 * Authors:
29 * Keith Whitwell <keith@tungstengraphics.com>
30 */
31
32 #ifndef BRW_AUB_H
33 #define BRW_AUB_H
34
35 struct aub_file_header {
36 unsigned int instruction_type;
37 unsigned int pad0:16;
38 unsigned int minor:8;
39 unsigned int major:8;
40 unsigned char application[8*4];
41 unsigned int day:8;
42 unsigned int month:8;
43 unsigned int year:16;
44 unsigned int timezone:8;
45 unsigned int second:8;
46 unsigned int minute:8;
47 unsigned int hour:8;
48 unsigned int comment_length:16;
49 unsigned int pad1:16;
50 };
51
52 struct aub_block_header {
53 unsigned int instruction_type;
54 unsigned int operation:8;
55 unsigned int type:8;
56 unsigned int address_space:8;
57 unsigned int pad0:8;
58 unsigned int general_state_type:8;
59 unsigned int surface_state_type:8;
60 unsigned int pad1:16;
61 unsigned int address;
62 unsigned int length;
63 };
64
65 struct aub_dump_bmp {
66 unsigned int instruction_type;
67 unsigned int xmin:16;
68 unsigned int ymin:16;
69 unsigned int pitch:16;
70 unsigned int bpp:8;
71 unsigned int format:8;
72 unsigned int xsize:16;
73 unsigned int ysize:16;
74 unsigned int addr;
75 unsigned int unknown;
76 };
77
78 enum bh_operation {
79 BH_COMMENT,
80 BH_DATA_WRITE,
81 BH_COMMAND_WRITE,
82 BH_MMI0_WRITE32,
83 BH_END_SCENE,
84 BH_CONFIG_MEMORY_MAP,
85 BH_MAX_OPERATION
86 };
87
88 enum command_write_type {
89 CW_HWB_RING = 1,
90 CW_PRIMARY_RING_A,
91 CW_PRIMARY_RING_B, /* XXX - disagreement with listaub! */
92 CW_PRIMARY_RING_C,
93 CW_MAX_TYPE
94 };
95
96 enum data_write_type {
97 DW_NOTYPE,
98 DW_BATCH_BUFFER,
99 DW_BIN_BUFFER,
100 DW_BIN_POINTER_LIST,
101 DW_SLOW_STATE_BUFFER,
102 DW_VERTEX_BUFFER,
103 DW_2D_MAP,
104 DW_CUBE_MAP,
105 DW_INDIRECT_STATE_BUFFER,
106 DW_VOLUME_MAP,
107 DW_1D_MAP,
108 DW_CONSTANT_BUFFER,
109 DW_CONSTANT_URB_ENTRY,
110 DW_INDEX_BUFFER,
111 DW_GENERAL_STATE,
112 DW_SURFACE_STATE,
113 DW_MEDIA_OBJECT_INDIRECT_DATA,
114 DW_MAX_TYPE
115 };
116
117 enum data_write_general_state_type {
118 DWGS_NOTYPE,
119 DWGS_VERTEX_SHADER_STATE,
120 DWGS_GEOMETRY_SHADER_STATE ,
121 DWGS_CLIPPER_STATE,
122 DWGS_STRIPS_FANS_STATE,
123 DWGS_WINDOWER_IZ_STATE,
124 DWGS_COLOR_CALC_STATE,
125 DWGS_CLIPPER_VIEWPORT_STATE, /* was 0x7 */
126 DWGS_STRIPS_FANS_VIEWPORT_STATE,
127 DWGS_COLOR_CALC_VIEWPORT_STATE, /* was 0x9 */
128 DWGS_SAMPLER_STATE,
129 DWGS_KERNEL_INSTRUCTIONS,
130 DWGS_SCRATCH_SPACE,
131 DWGS_SAMPLER_DEFAULT_COLOR,
132 DWGS_INTERFACE_DESCRIPTOR,
133 DWGS_VLD_STATE,
134 DWGS_VFE_STATE,
135 DWGS_MAX_TYPE
136 };
137
138 enum data_write_surface_state_type {
139 DWSS_NOTYPE,
140 DWSS_BINDING_TABLE_STATE,
141 DWSS_SURFACE_STATE,
142 DWSS_MAX_TYPE
143 };
144
145 enum memory_map_type {
146 MM_DEFAULT,
147 MM_DYNAMIC,
148 MM_MAX_TYPE
149 };
150
151 enum address_space {
152 ADDR_GTT,
153 ADDR_LOCAL,
154 ADDR_MAIN,
155 ADDR_MAX
156 };
157
158
159 #define AUB_FILE_HEADER 0xe085000b
160 #define AUB_BLOCK_HEADER 0xe0c10003
161 #define AUB_DUMP_BMP 0xe09e0004
162
163 struct brw_context;
164 struct intel_context;
165
166 int brw_aub_init( struct brw_context *brw );
167 void brw_aub_destroy( struct brw_context *brw );
168
169 int brw_playback_aubfile(struct brw_context *brw,
170 const char *filename);
171
172 #endif