1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**************************************************************************
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * All Rights Reserved.
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining a
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * copy of this software and associated documentation files (the
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * "Software"), to deal in the Software without restriction, including
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * without limitation the rights to use, copy, modify, merge, publish,
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * distribute, sub license, and/or sell copies of the Software, and to
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * permit persons to whom the Software is furnished to do so, subject to
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the following conditions:
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice (including the
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * next paragraph) shall be included in all copies or substantial portions
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * of the Software.
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org **************************************************************************/
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef _I915_REG_H_
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _I915_REG_H_
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "intel_reg.h"
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define I915_SET_FIELD( var, mask, value ) (var &= ~(mask), var |= value)
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_INLINE		(CMD_3D | (0x1f<<24))
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_TRILIST		(0x0<<18)
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_TRISTRIP 	(0x1<<18)
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_TRISTRIP_RVRSE	(0x2<<18)
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_TRIFAN		(0x3<<18)
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_POLY		(0x4<<18)
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_LINELIST 	(0x5<<18)
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_LINESTRIP	(0x6<<18)
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_RECTLIST 	(0x7<<18)
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_POINTLIST	(0x8<<18)
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_DIB		(0x9<<18)
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_CLEAR_RECT	(0xa<<18)
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_ZONE_INIT	(0xd<<18)
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRIM3D_MASK		(0x1f<<18)
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p137 */
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_AA_CMD			(CMD_3D | (0x06<<24))
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_ECAAR_WIDTH_ENABLE	(1<<16)
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_ECAAR_WIDTH_0_5 	0
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_ECAAR_WIDTH_1_0		(1<<14)
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_ECAAR_WIDTH_2_0 	(2<<14)
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_ECAAR_WIDTH_4_0 	(3<<14)
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_REGION_WIDTH_ENABLE	(1<<8)
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_REGION_WIDTH_0_5	0
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_REGION_WIDTH_1_0	(1<<6)
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_REGION_WIDTH_2_0	(2<<6)
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AA_LINE_REGION_WIDTH_4_0	(3<<6)
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_BACKFACE_STENCIL_OPS, p138*/
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_BACKFACE_STENCIL_OPS    (CMD_3D | (0x8<<24))
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_ENABLE_STENCIL_REF          (1<<23)
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_REF_SHIFT           15
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_REF_MASK            (0xff<<15)
70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_ENABLE_STENCIL_FUNCS        (1<<14)
71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_TEST_SHIFT          11
72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_TEST_MASK           (0x7<<11)
73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_FAIL_SHIFT          8
74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_FAIL_MASK           (0x7<<8)
75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_PASS_Z_FAIL_SHIFT   5
76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_PASS_Z_FAIL_MASK    (0x7<<5)
77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_PASS_Z_PASS_SHIFT   2
78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_PASS_Z_PASS_MASK    (0x7<<2)
79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_ENABLE_STENCIL_TWO_SIDE     (1<<1)
80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFO_STENCIL_TWO_SIDE            (1<<0)
81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_BACKFACE_STENCIL_MASKS, p140 */
84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_BACKFACE_STENCIL_MASKS    (CMD_3D | (0x9<<24))
85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFM_ENABLE_STENCIL_TEST_MASK      (1<<17)
86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFM_ENABLE_STENCIL_WRITE_MASK     (1<<16)
87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFM_STENCIL_TEST_MASK_SHIFT       8
88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFM_STENCIL_TEST_MASK_MASK        (0xff<<8)
89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFM_STENCIL_TEST_MASK(x)	  (((x)&0xff) << 8)
90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFM_STENCIL_WRITE_MASK_SHIFT      0
91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFM_STENCIL_WRITE_MASK_MASK       (0xff<<0)
92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BFM_STENCIL_WRITE_MASK(x)	  ((x)&0xff)
93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_BIN_CONTROL p141 */
97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_CHROMA_KEY */
99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_CLEAR_PARAMETERS, p150 */
101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Sets the color, depth and stencil clear values used by the
103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * CLEAR_RECT and ZONE_INIT primitive types, respectively.  These
104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * primitives set override most 3d state and only take a minimal x/y
105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * vertex.  The color/z/stencil information is supplied here and
106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * therefore cannot vary per vertex.
107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_CLEAR_PARAMETERS	(CMD_3D | (0x1d<<24) | (0x9c<<16) | 5)
109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 1 */
110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CLEARPARAM_CLEAR_RECT		(1 << 16)
111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CLEARPARAM_ZONE_INIT		(0 << 16)
112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CLEARPARAM_WRITE_COLOR		(1 << 2)
113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CLEARPARAM_WRITE_DEPTH		(1 << 1)
114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CLEARPARAM_WRITE_STENCIL	(1 << 0)
115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_CONSTANT_BLEND_COLOR, p153 */
117f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_CONST_BLEND_COLOR_CMD	(CMD_3D | (0x1d<<24) | (0x88<<16))
118f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
119f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
120f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
121f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_COORD_SET_BINDINGS, p154 */
122f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_COORD_SET_BINDINGS      (CMD_3D | (0x16<<24))
123f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CSB_TCB(iunit, eunit)           ((eunit)<<(iunit*3))
124f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
125f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p156 */
126f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DFLT_DIFFUSE_CMD	(CMD_3D | (0x1d<<24) | (0x99<<16))
127f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
128f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p157 */
129f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DFLT_SPEC_CMD		(CMD_3D | (0x1d<<24) | (0x9a<<16))
130f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
131f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p158 */
132f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DFLT_Z_CMD		(CMD_3D | (0x1d<<24) | (0x98<<16))
133f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
134f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
135f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_DEPTH_OFFSET_SCALE, p159 */
136f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DEPTH_OFFSET_SCALE       (CMD_3D | (0x1d<<24) | (0x97<<16))
137f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* scale in dword 1 */
138f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
139f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
140f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_DEPTH_SUBRECT_DISABLE, p160 */
141f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DEPTH_SUBRECT_DISABLE    (CMD_3D | (0x1c<<24) | (0x11<<19) | 0x2)
142f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
143f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p161 */
144f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DST_BUF_VARS_CMD	(CMD_3D | (0x1d<<24) | (0x85<<16))
145f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 1 */
146f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CLASSIC_EARLY_DEPTH		(1<<31)
147f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_DEFAULT_COLOR_OGL           (0<<30)
148f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_DEFAULT_COLOR_D3D           (1<<30)
149f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ZR_EARLY_DEPTH                  (1<<29)
150f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LOD_PRECLAMP_OGL                (1<<28)
151f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LOD_PRECLAMP_D3D                (0<<28)
152f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DITHER_FULL_ALWAYS              (0<<26)
153f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DITHER_FULL_ON_FB_BLEND         (1<<26)
154f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DITHER_CLAMPED_ALWAYS           (2<<26)
155f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LINEAR_GAMMA_BLEND_32BPP        (1<<25)
156f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DEBUG_DISABLE_ENH_DITHER        (1<<24)
157f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DSTORG_HORT_BIAS(x)		((x)<<20)
158f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DSTORG_VERT_BIAS(x)		((x)<<16)
159f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define COLOR_4_2_2_CHNL_WRT_ALL	0
160f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define COLOR_4_2_2_CHNL_WRT_Y		(1<<12)
161f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define COLOR_4_2_2_CHNL_WRT_CR		(2<<12)
162f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define COLOR_4_2_2_CHNL_WRT_CB		(3<<12)
163f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define COLOR_4_2_2_CHNL_WRT_CRCB	(4<<12)
164f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define COLR_BUF_8BIT			0
165f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define COLR_BUF_RGB555 		(1<<8)
166f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define COLR_BUF_RGB565 		(2<<8)
167f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define COLR_BUF_ARGB8888		(3<<8)
168f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DEPTH_FRMT_16_FIXED		0
169f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DEPTH_FRMT_16_FLOAT		(1<<2)
170f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DEPTH_FRMT_24_FIXED_8_OTHER	(2<<2)
171f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VERT_LINE_STRIDE_1		(1<<1)
172f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VERT_LINE_STRIDE_0		(0<<1)
173f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VERT_LINE_STRIDE_OFS_1		1
174f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VERT_LINE_STRIDE_OFS_0		0
175f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
176f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p166 */
177f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DRAW_RECT_CMD		(CMD_3D|(0x1d<<24)|(0x80<<16)|3)
178f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 1 */
179f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_RECT_DIS_DEPTH_OFS 	(1<<30)
180f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_DITHER_OFS_X(x)		((x)<<26)
181f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_DITHER_OFS_Y(x)		((x)<<24)
182f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 2 */
183f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_YMIN(x)			((x)<<16)
184f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_XMIN(x)			(x)
185f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 3 */
186f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_YMAX(x)			((x)<<16)
187f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_XMAX(x)			(x)
188f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 4 */
189f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_YORG(x)			((x)<<16)
190f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DRAW_XORG(x)			(x)
191f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
192f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
193f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_FILTER_COEFFICIENTS_4X4, p170 */
194f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
195f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_FILTER_COEFFICIENTS_6X5, p172 */
196f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
197f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
198f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* _3DSTATE_FOG_COLOR, p173 */
199f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_FOG_COLOR_CMD		(CMD_3D|(0x15<<24))
200f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FOG_COLOR_RED(x)		((x)<<16)
201f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FOG_COLOR_GREEN(x)		((x)<<8)
202f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FOG_COLOR_BLUE(x)		(x)
203f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
204f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* _3DSTATE_FOG_MODE, p174 */
205f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_FOG_MODE_CMD		(CMD_3D|(0x1d<<24)|(0x89<<16)|2)
206f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 1 */
207f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_FOGFUNC_MODIFY_ENABLE	(1<<31)
208f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_FOGFUNC_VERTEX		(0<<28)
209f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_FOGFUNC_PIXEL_EXP		(1<<28)
210f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_FOGFUNC_PIXEL_EXP2		(2<<28)
211f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_FOGFUNC_PIXEL_LINEAR	(3<<28)
212f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_FOGFUNC_MASK		(3<<28)
213f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_FOGINDEX_MODIFY_ENABLE     (1<<27)
214f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_FOGINDEX_Z		        (0<<25)
215f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_FOGINDEX_W   		(1<<25)
216f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_C1_C2_MODIFY_ENABLE	(1<<24)
217f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_DENSITY_MODIFY_ENABLE	(1<<23)
218f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_C1_ONE      	        (1<<13)
219f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC1_C1_MASK		        (0xffff<<4)
220f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 2 */
221f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC2_C2_ONE		        (1<<16)
222f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 3 */
223f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FMC3_D_ONE      		(1<<16)
224f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
225f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
226f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
227f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* _3DSTATE_INDEPENDENT_ALPHA_BLEND, p177 */
228f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_INDEPENDENT_ALPHA_BLEND_CMD	(CMD_3D|(0x0b<<24))
229f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_MODIFY_ENABLE	        (1<<23)
230f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_ENABLE       	        (1<<22)
231f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_MODIFY_FUNC         	(1<<21)
232f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_FUNC_SHIFT          	16
233f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_MODIFY_SRC_FACTOR   	(1<<11)
234f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_SRC_FACTOR_SHIFT		6
235f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_SRC_FACTOR_MASK		(BLENDFACT_MASK<<6)
236f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_MODIFY_DST_FACTOR	        (1<<5)
237f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_DST_FACTOR_SHIFT		0
238f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define IAB_DST_FACTOR_MASK		(BLENDFACT_MASK<<0)
239f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
240f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
241f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BLENDFUNC_ADD			0x0
242f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BLENDFUNC_SUBTRACT		0x1
243f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BLENDFUNC_REVERSE_SUBTRACT	0x2
244f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BLENDFUNC_MIN			0x3
245f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BLENDFUNC_MAX			0x4
246f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define BLENDFUNC_MASK			0x7
247f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
248f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_LOAD_INDIRECT, p180 */
249f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
250f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_LOAD_INDIRECT	        (CMD_3D|(0x1d<<24)|(0x7<<16))
251f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LI0_STATE_STATIC_INDIRECT       (0x01<<8)
252f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LI0_STATE_DYNAMIC_INDIRECT      (0x02<<8)
253f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LI0_STATE_SAMPLER               (0x04<<8)
254f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LI0_STATE_MAP                   (0x08<<8)
255f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LI0_STATE_PROGRAM               (0x10<<8)
256f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LI0_STATE_CONSTANTS             (0x20<<8)
257f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
258f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SIS0_BUFFER_ADDRESS(x)          ((x)&~0x3)
259f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SIS0_FORCE_LOAD                 (1<<1)
260f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SIS0_BUFFER_VALID               (1<<0)
261f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SIS1_BUFFER_LENGTH(x)           ((x)&0xff)
262f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
263f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DIS0_BUFFER_ADDRESS(x)          ((x)&~0x3)
264f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DIS0_BUFFER_RESET               (1<<1)
265f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DIS0_BUFFER_VALID               (1<<0)
266f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
267f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SSB0_BUFFER_ADDRESS(x)          ((x)&~0x3)
268f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SSB0_FORCE_LOAD                 (1<<1)
269f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SSB0_BUFFER_VALID               (1<<0)
270f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SSB1_BUFFER_LENGTH(x)           ((x)&0xff)
271f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
272f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSB0_BUFFER_ADDRESS(x)          ((x)&~0x3)
273f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSB0_FORCE_LOAD                 (1<<1)
274f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSB0_BUFFER_VALID               (1<<0)
275f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSB1_BUFFER_LENGTH(x)           ((x)&0xff)
276f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
277f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PSP0_BUFFER_ADDRESS(x)          ((x)&~0x3)
278f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PSP0_FORCE_LOAD                 (1<<1)
279f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PSP0_BUFFER_VALID               (1<<0)
280f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PSP1_BUFFER_LENGTH(x)           ((x)&0xff)
281f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
282f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PSC0_BUFFER_ADDRESS(x)          ((x)&~0x3)
283f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PSC0_FORCE_LOAD                 (1<<1)
284f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PSC0_BUFFER_VALID               (1<<0)
285f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PSC1_BUFFER_LENGTH(x)           ((x)&0xff)
286f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
287f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
288f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
289f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
290f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
291f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* _3DSTATE_RASTERIZATION_RULES */
292f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_RASTER_RULES_CMD	(CMD_3D|(0x07<<24))
293f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ENABLE_POINT_RASTER_RULE	(1<<15)
294f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define OGL_POINT_RASTER_RULE		(1<<13)
295f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ENABLE_TEXKILL_3D_4D            (1<<10)
296f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEXKILL_3D                      (0<<9)
297f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEXKILL_4D                      (1<<9)
298f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ENABLE_LINE_STRIP_PROVOKE_VRTX	(1<<8)
299f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ENABLE_TRI_FAN_PROVOKE_VRTX	(1<<5)
300f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LINE_STRIP_PROVOKE_VRTX_MASK	(3 << 6)
301f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LINE_STRIP_PROVOKE_VRTX(x)	((x)<<6)
302f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TRI_FAN_PROVOKE_VRTX_MASK	(3 << 3)
303f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TRI_FAN_PROVOKE_VRTX(x) 	((x)<<3)
304f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
305f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* _3DSTATE_SCISSOR_ENABLE, p256 */
306f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_SCISSOR_ENABLE_CMD	(CMD_3D|(0x1c<<24)|(0x10<<19))
307f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ENABLE_SCISSOR_RECT		((1<<1) | 1)
308f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DISABLE_SCISSOR_RECT		(1<<1)
309f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
310f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* _3DSTATE_SCISSOR_RECTANGLE_0, p257 */
311f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_SCISSOR_RECT_0_CMD	(CMD_3D|(0x1d<<24)|(0x81<<16)|1)
312f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 1 */
313f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SCISSOR_RECT_0_YMIN(x)		((x)<<16)
314f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SCISSOR_RECT_0_XMIN(x)		(x)
315f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Dword 2 */
316f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SCISSOR_RECT_0_YMAX(x)		((x)<<16)
317f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SCISSOR_RECT_0_XMAX(x)		(x)
318f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
319f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Helper macros for blend factors
320f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
321f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DST_BLND_FACT(f) ((f)<<S6_CBUF_DST_BLEND_FACT_SHIFT)
322f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SRC_BLND_FACT(f) ((f)<<S6_CBUF_SRC_BLEND_FACT_SHIFT)
323f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define DST_ABLND_FACT(f) ((f)<<IAB_DST_FACTOR_SHIFT)
324f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SRC_ABLND_FACT(f) ((f)<<IAB_SRC_FACTOR_SHIFT)
325f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
326f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
327f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
328f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
329f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_MAP_DEINTERLACER_PARAMETERS */
330f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
331f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_MAP_PALETTE_LOAD_32, p206 */
332f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_MAP_PALETTE_LOAD_32    (CMD_3D|(0x1d<<24)|(0x8f<<16))
333f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* subsequent dwords up to length (max 16) are ARGB8888 color values */
334f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
335f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* _3DSTATE_MODES_4, p218 */
336f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_MODES_4_CMD		(CMD_3D|(0x0d<<24))
337f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ENABLE_LOGIC_OP_FUNC		(1<<23)
338f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LOGIC_OP_FUNC(x)		((x)<<18)
339f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LOGICOP_MASK			(0xf<<18)
340f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MODE4_ENABLE_STENCIL_TEST_MASK	((1<<17)|(0xff00))
341f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ENABLE_STENCIL_TEST_MASK	(1<<17)
342f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define STENCIL_TEST_MASK(x)		(((x)&0xff)<<8)
343f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MODE4_ENABLE_STENCIL_WRITE_MASK	((1<<16)|(0x00ff))
344f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ENABLE_STENCIL_WRITE_MASK	(1<<16)
345f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define STENCIL_WRITE_MASK(x)		((x)&0xff)
346f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
347f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* _3DSTATE_MODES_5, p220 */
348f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_MODES_5_CMD		(CMD_3D|(0x0c<<24))
349f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PIPELINE_FLUSH_RENDER_CACHE	(1<<18)
350f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PIPELINE_FLUSH_TEXTURE_CACHE	(1<<16)
351f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
352f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
353f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p221 */
354f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_PIXEL_SHADER_CONSTANTS  (CMD_3D|(0x1d<<24)|(0x6<<16))
355f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PS1_REG(n)                      (1<<(n))
356f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PS2_CONST_X(n)                  (n)
357f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PS3_CONST_Y(n)                  (n)
358f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PS4_CONST_Z(n)                  (n)
359f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PS5_CONST_W(n)                  (n)
360f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
361f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p222 */
362f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
363f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
364f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Each instruction is 3 dwords long, though most don't require all
365f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * this space.  Maximum of 123 instructions.  Smaller maxes per insn
366f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * type.
367f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
368f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_PIXEL_SHADER_PROGRAM    (CMD_3D|(0x1d<<24)|(0x5<<16))
369f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
370f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define REG_TYPE_R                 0    /* temporary regs, no need to
371f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * dcl, must be written before
372f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * read -- Preserved between
373f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * phases.
374f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         */
375f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define REG_TYPE_T                 1    /* Interpolated values, must be
376f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * dcl'ed before use.
377f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         *
378f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * 0..7: texture coord,
379f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * 8: diffuse spec,
380f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * 9: specular color,
381f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * 10: fog parameter in w.
382f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         */
383f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define REG_TYPE_CONST             2    /* Restriction: only one const
384f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * can be referenced per
385f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * instruction, though it may be
386f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * selected for multiple inputs.
387f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * Constants not initialized
388f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * default to zero.
389f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         */
390f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define REG_TYPE_S                 3    /* sampler */
391f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define REG_TYPE_OC                4    /* output color (rgba) */
392f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define REG_TYPE_OD                5    /* output depth (w), xyz are
393f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * temporaries.  If not written,
394f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         * interpolated depth is used?
395f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                         */
396f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define REG_TYPE_U                 6    /* unpreserved temporaries */
397f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define REG_TYPE_MASK              0x7
398f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define REG_NR_MASK                0xf
399f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
400f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
401f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* REG_TYPE_T:
402f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
403f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_TEX0     0
404f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_TEX1     1
405f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_TEX2     2
406f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_TEX3     3
407f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_TEX4     4
408f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_TEX5     5
409f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_TEX6     6
410f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_TEX7     7
411f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_DIFFUSE  8
412f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_SPECULAR 9
413f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T_FOG_W    10           /* interpolated fog is in W coord */
414f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
415f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Arithmetic instructions */
416f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
417f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* .replicate_swizzle == selection and replication of a particular
418f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * scalar channel, ie., .xxxx, .yyyy, .zzzz or .wwww
419f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
420f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_NOP    (0x0<<24)     /* no operation */
421f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_ADD    (0x1<<24)     /* dst = src0 + src1 */
422f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_MOV    (0x2<<24)     /* dst = src0 */
423f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_MUL    (0x3<<24)     /* dst = src0 * src1 */
424f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_MAD    (0x4<<24)     /* dst = src0 * src1 + src2 */
425f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DP2ADD (0x5<<24)     /* dst.xyzw = src0.xy dot src1.xy + src2.replicate_swizzle */
426f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DP3    (0x6<<24)     /* dst.xyzw = src0.xyz dot src1.xyz */
427f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DP4    (0x7<<24)     /* dst.xyzw = src0.xyzw dot src1.xyzw */
428f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_FRC    (0x8<<24)     /* dst = src0 - floor(src0) */
429f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_RCP    (0x9<<24)     /* dst.xyzw = 1/(src0.replicate_swizzle) */
430f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_RSQ    (0xa<<24)     /* dst.xyzw = 1/(sqrt(abs(src0.replicate_swizzle))) */
431f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_EXP    (0xb<<24)     /* dst.xyzw = exp2(src0.replicate_swizzle) */
432f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_LOG    (0xc<<24)     /* dst.xyzw = log2(abs(src0.replicate_swizzle)) */
433f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_CMP    (0xd<<24)     /* dst = (src0 >= 0.0) ? src1 : src2 */
434f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_MIN    (0xe<<24)     /* dst = (src0 < src1) ? src0 : src1 */
435f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_MAX    (0xf<<24)     /* dst = (src0 >= src1) ? src0 : src1 */
436f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_FLR    (0x10<<24)    /* dst = floor(src0) */
437f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_MOD    (0x11<<24)    /* dst = src0 fmod 1.0 */
438f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_TRC    (0x12<<24)    /* dst = int(src0) */
439f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_SGE    (0x13<<24)    /* dst = src0 >= src1 ? 1.0 : 0.0 */
440f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_SLT    (0x14<<24)    /* dst = src0 < src1 ? 1.0 : 0.0 */
441f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_SATURATE                 (1<<22)
442f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_TYPE_SHIFT                19
443f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Allow: R, OC, OD, U */
444f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_NR_SHIFT                 14
445f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */
446f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_CHANNEL_X                (1<<10)
447f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_CHANNEL_Y                (2<<10)
448f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_CHANNEL_Z                (4<<10)
449f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_CHANNEL_W                (8<<10)
450f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_CHANNEL_ALL              (0xf<<10)
451f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_CHANNEL_SHIFT            10
452f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_SRC0_TYPE_SHIFT               7
453f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_SRC0_NR_SHIFT                 2
454f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
455f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_CHANNEL_XY              (A0_DEST_CHANNEL_X|A0_DEST_CHANNEL_Y)
456f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A0_DEST_CHANNEL_XYZ             (A0_DEST_CHANNEL_XY|A0_DEST_CHANNEL_Z)
457f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
458f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
459f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SRC_X        0
460f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SRC_Y        1
461f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SRC_Z        2
462f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SRC_W        3
463f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SRC_ZERO     4
464f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SRC_ONE      5
465f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
466f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC0_CHANNEL_X_NEGATE         (1<<31)
467f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC0_CHANNEL_X_SHIFT          28
468f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC0_CHANNEL_Y_NEGATE         (1<<27)
469f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC0_CHANNEL_Y_SHIFT          24
470f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC0_CHANNEL_Z_NEGATE         (1<<23)
471f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC0_CHANNEL_Z_SHIFT          20
472f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC0_CHANNEL_W_NEGATE         (1<<19)
473f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC0_CHANNEL_W_SHIFT          16
474f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC1_TYPE_SHIFT               13
475f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC1_NR_SHIFT                 8
476f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC1_CHANNEL_X_NEGATE         (1<<7)
477f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC1_CHANNEL_X_SHIFT          4
478f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC1_CHANNEL_Y_NEGATE         (1<<3)
479f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A1_SRC1_CHANNEL_Y_SHIFT          0
480f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
481f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC1_CHANNEL_Z_NEGATE         (1<<31)
482f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC1_CHANNEL_Z_SHIFT          28
483f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC1_CHANNEL_W_NEGATE         (1<<27)
484f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC1_CHANNEL_W_SHIFT          24
485f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_TYPE_SHIFT               21
486f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_NR_SHIFT                 16
487f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_CHANNEL_X_NEGATE         (1<<15)
488f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_CHANNEL_X_SHIFT          12
489f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_CHANNEL_Y_NEGATE         (1<<11)
490f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_CHANNEL_Y_SHIFT          8
491f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_CHANNEL_Z_NEGATE         (1<<7)
492f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_CHANNEL_Z_SHIFT          4
493f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_CHANNEL_W_NEGATE         (1<<3)
494f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define A2_SRC2_CHANNEL_W_SHIFT          0
495f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
496f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
497f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
498f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Texture instructions */
499f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T0_TEXLD     (0x15<<24) /* Sample texture using predeclared
500f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * sampler and address, and output
501f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * filtered texel data to destination
502f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * register */
503f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T0_TEXLDP    (0x16<<24) /* Same as texld but performs a
504f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * perspective divide of the texture
505f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * coordinate .xyz values by .w before
506f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * sampling. */
507f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T0_TEXLDB    (0x17<<24) /* Same as texld but biases the
508f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * computed LOD by w.  Only S4.6 two's
509f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * comp is used.  This implies that a
510f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * float to fixed conversion is
511f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * done. */
512f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T0_TEXKILL   (0x18<<24) /* Does not perform a sampling
513f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * operation.  Simply kills the pixel
514f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * if any channel of the address
515f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * register is < 0.0. */
516f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T0_DEST_TYPE_SHIFT                19
517f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Allow: R, OC, OD, U */
518f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Note: U (unpreserved) regs do not retain their values between
519f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * phases (cannot be used for feedback)
520f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
521f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Note: oC and OD registers can only be used as the destination of a
522f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * texture instruction once per phase (this is an implementation
523f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * restriction).
524f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
525f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T0_DEST_NR_SHIFT                 14
526f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Allow R: 0..15, OC,OD: 0..0, U: 0..2 */
527f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T0_SAMPLER_NR_SHIFT              0      /* This field ignored for TEXKILL */
528f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T0_SAMPLER_NR_MASK               (0xf<<0)
529f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
530f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T1_ADDRESS_REG_TYPE_SHIFT        24     /* Reg to use as texture coord */
531f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Allow R, T, OC, OD -- R, OC, OD are 'dependent' reads, new program phase */
532f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T1_ADDRESS_REG_NR_SHIFT          17
533f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define T2_MBZ                           0
534f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
535f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Declaration instructions */
536f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_DCL       (0x19<<24) /* Declare a t (interpolated attrib)
537f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * register or an s (sampler)
538f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                 * register. */
539f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_SAMPLE_TYPE_SHIFT              22
540f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_SAMPLE_TYPE_2D                 (0x0<<22)
541f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_SAMPLE_TYPE_CUBE               (0x1<<22)
542f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_SAMPLE_TYPE_VOLUME             (0x2<<22)
543f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_SAMPLE_TYPE_MASK               (0x3<<22)
544f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
545f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_TYPE_SHIFT                19
546f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Allow: T, S */
547f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_NR_SHIFT                  14
548f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Allow T: 0..10, S: 0..15 */
549f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_CHANNEL_X                (1<<10)
550f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_CHANNEL_Y                (2<<10)
551f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_CHANNEL_Z                (4<<10)
552f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_CHANNEL_W                (8<<10)
553f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_CHANNEL_ALL              (0xf<<10)
554f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_CHANNEL_NONE             (0<<10)
555f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
556f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_CHANNEL_XY               (D0_CHANNEL_X|D0_CHANNEL_Y)
557f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D0_CHANNEL_XYZ              (D0_CHANNEL_XY|D0_CHANNEL_Z)
558f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
559f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* I915 Errata: Do not allow (xz), (xw), (xzw) combinations for diffuse
560f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * or specular declarations.
561f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
562f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * For T dcls, only allow: (x), (xy), (xyz), (w), (xyzw)
563f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
564f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Must be zero for S (sampler) dcls
565f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
566f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D1_MBZ                          0
567f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define D2_MBZ                          0
568f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
569f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
570f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
571f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p207 */
572f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_MAP_STATE               (CMD_3D|(0x1d<<24)|(0x0<<16))
573f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
574f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS1_MAPMASK_SHIFT               0
575f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS1_MAPMASK_MASK                (0x8fff<<0)
576f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
577f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS2_UNTRUSTED_SURFACE           (1<<31)
578f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS2_ADDRESS_MASK                0xfffffffc
579f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS2_VERTICAL_LINE_STRIDE        (1<<1)
580f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS2_VERTICAL_OFFSET             (1<<1)
581f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
582f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_HEIGHT_SHIFT              21
583f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_WIDTH_SHIFT               10
584f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_PALETTE_SELECT            (1<<9)
585f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_MAPSURF_FORMAT_SHIFT      7
586f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_MAPSURF_FORMAT_MASK       (0x7<<7)
587f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MAPSURF_8BIT		 	   (1<<7)
588f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MAPSURF_16BIT		   (2<<7)
589f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MAPSURF_32BIT		   (3<<7)
590f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MAPSURF_422			   (5<<7)
591f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MAPSURF_COMPRESSED		   (6<<7)
592f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MAPSURF_4BIT_INDEXED		   (7<<7)
593f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_MT_FORMAT_MASK         (0x7 << 3)
594f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_MT_FORMAT_SHIFT        3
595f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_4BIT_IDX_ARGB8888	           (7<<3)       /* SURFACE_4BIT_INDEXED */
596f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_8BIT_I8		           (0<<3)       /* SURFACE_8BIT */
597f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_8BIT_L8		           (1<<3)
598f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_8BIT_A8		           (4<<3)
599f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_8BIT_MONO8	           (5<<3)
600f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_16BIT_RGB565 		   (0<<3)       /* SURFACE_16BIT */
601f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_16BIT_ARGB1555		   (1<<3)
602f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_16BIT_ARGB4444		   (2<<3)
603f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_16BIT_AY88		   (3<<3)
604f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_16BIT_88DVDU	           (5<<3)
605f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_16BIT_BUMP_655LDVDU	   (6<<3)
606f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_16BIT_I16	                   (7<<3)
607f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_16BIT_L16	                   (8<<3)
608f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_16BIT_A16	                   (9<<3)
609f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_ARGB8888		   (0<<3)       /* SURFACE_32BIT */
610f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_ABGR8888		   (1<<3)
611f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_XRGB8888		   (2<<3)
612f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_XBGR8888		   (3<<3)
613f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_QWVU8888		   (4<<3)
614f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_AXVU8888		   (5<<3)
615f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_LXVU8888	           (6<<3)
616f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_XLVU8888	           (7<<3)
617f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_ARGB2101010	           (8<<3)
618f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_ABGR2101010	           (9<<3)
619f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_AWVU2101010	           (0xA<<3)
620f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_GR1616	           (0xB<<3)
621f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_VU1616	           (0xC<<3)
622f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_x8I24	           (0xD<<3)
623f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_x8L24	           (0xE<<3)
624f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_32BIT_x8A24	           (0xF<<3)
625f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_422_YCRCB_SWAPY	           (0<<3)       /* SURFACE_422 */
626f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_422_YCRCB_NORMAL	           (1<<3)
627f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_422_YCRCB_SWAPUV	           (2<<3)
628f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_422_YCRCB_SWAPUVY	           (3<<3)
629f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_COMPRESS_DXT1		   (0<<3)       /* SURFACE_COMPRESSED */
630f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_COMPRESS_DXT2_3	           (1<<3)
631f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_COMPRESS_DXT4_5	           (2<<3)
632f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_COMPRESS_FXT1		   (3<<3)
633f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define    MT_COMPRESS_DXT1_RGB		   (4<<3)
634f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_USE_FENCE_REGS              (1<<2)
635f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_TILED_SURFACE             (1<<1)
636f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS3_TILE_WALK                 (1<<0)
637f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
638f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_PITCH_SHIFT                 21
639f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_CUBE_FACE_ENA_NEGX          (1<<20)
640f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_CUBE_FACE_ENA_POSX          (1<<19)
641f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_CUBE_FACE_ENA_NEGY          (1<<18)
642f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_CUBE_FACE_ENA_POSY          (1<<17)
643f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_CUBE_FACE_ENA_NEGZ          (1<<16)
644f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_CUBE_FACE_ENA_POSZ          (1<<15)
645f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_CUBE_FACE_ENA_MASK          (0x3f<<15)
646f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_MAX_LOD_SHIFT		9
647f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_MAX_LOD_MASK		(0x3f<<9)
648f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_MIP_LAYOUT_LEGACY           (0<<8)
649f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_MIP_LAYOUT_BELOW_LPT        (0<<8)
650f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_MIP_LAYOUT_RIGHT_LPT        (1<<8)
651f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_VOLUME_DEPTH_SHIFT          0
652f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MS4_VOLUME_DEPTH_MASK           (0xff<<0)
653f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
654f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* p244 */
655f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_SAMPLER_STATE         (CMD_3D|(0x1d<<24)|(0x1<<16))
656f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
657f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS1_MAPMASK_SHIFT               0
658f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS1_MAPMASK_MASK                (0x8fff<<0)
659f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
660f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_REVERSE_GAMMA_ENABLE        (1<<31)
661f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_PACKED_TO_PLANAR_ENABLE     (1<<30)
662f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_COLORSPACE_CONVERSION       (1<<29)
663f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_CHROMAKEY_SHIFT             27
664f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_BASE_MIP_LEVEL_SHIFT        22
665f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_BASE_MIP_LEVEL_MASK         (0x1f<<22)
666f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_MIP_FILTER_SHIFT            20
667f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_MIP_FILTER_MASK             (0x3<<20)
668f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   MIPFILTER_NONE       	0
669f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   MIPFILTER_NEAREST	1
670f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   MIPFILTER_LINEAR	3
671f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_MAG_FILTER_SHIFT          17
672f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_MAG_FILTER_MASK           (0x7<<17)
673f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   FILTER_NEAREST	0
674f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   FILTER_LINEAR		1
675f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   FILTER_ANISOTROPIC	2
676f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   FILTER_4X4_1    	3
677f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   FILTER_4X4_2    	4
678f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   FILTER_4X4_FLAT 	5
679f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   FILTER_6X5_MONO   	6       /* XXX - check */
680f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_MIN_FILTER_SHIFT          14
681f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_MIN_FILTER_MASK           (0x7<<14)
682f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_LOD_BIAS_SHIFT            5
683f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_LOD_BIAS_ONE              (0x10<<5)
684f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_LOD_BIAS_MASK             (0x1ff<<5)
685f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Shadow requires:
686f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *  MT_X8{I,L,A}24 or MT_{I,L,A}16 texture format
687f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *  FILTER_4X4_x  MIN and MAG filters
688f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
689f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_SHADOW_ENABLE             (1<<4)
690f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_MAX_ANISO_MASK            (1<<3)
691f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_MAX_ANISO_2               (0<<3)
692f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_MAX_ANISO_4               (1<<3)
693f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_SHADOW_FUNC_SHIFT         0
694f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS2_SHADOW_FUNC_MASK          (0x7<<0)
695f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* SS2_SHADOW_FUNC values: see COMPAREFUNC_* */
696f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
697f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_MIN_LOD_SHIFT            24
698f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_MIN_LOD_ONE              (0x10<<24)
699f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_MIN_LOD_MASK             (0xff<<24)
700f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_KILL_PIXEL_ENABLE        (1<<17)
701f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_TCX_ADDR_MODE_SHIFT      12
702f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_TCX_ADDR_MODE_MASK       (0x7<<12)
703f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   TEXCOORDMODE_WRAP		0
704f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   TEXCOORDMODE_MIRROR		1
705f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   TEXCOORDMODE_CLAMP_EDGE	2
706f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   TEXCOORDMODE_CUBE       	3
707f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   TEXCOORDMODE_CLAMP_BORDER	4
708f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define   TEXCOORDMODE_MIRROR_ONCE      5
709f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_TCY_ADDR_MODE_SHIFT      9
710f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_TCY_ADDR_MODE_MASK       (0x7<<9)
711f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_TCZ_ADDR_MODE_SHIFT      6
712f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_TCZ_ADDR_MODE_MASK       (0x7<<6)
713f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_NORMALIZED_COORDS        (1<<5)
714f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_TEXTUREMAP_INDEX_SHIFT   1
715f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_TEXTUREMAP_INDEX_MASK    (0xf<<1)
716f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS3_DEINTERLACER_ENABLE      (1<<0)
717f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
718f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SS4_BORDER_COLOR_MASK        (~0)
719f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
720f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 3DSTATE_SPAN_STIPPLE, p258
721f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
722f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_STIPPLE           ((0x3<<29)|(0x1d<<24)|(0x83<<16))
723f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ST1_ENABLE               (1<<16)
724f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ST1_MASK                 (0xffff)
725f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
726f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DEFAULT_Z          ((0x3<<29)|(0x1d<<24)|(0x98<<16))
727f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DEFAULT_DIFFUSE    ((0x3<<29)|(0x1d<<24)|(0x99<<16))
728f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define _3DSTATE_DEFAULT_SPECULAR   ((0x3<<29)|(0x1d<<24)|(0x9a<<16))
729f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
730f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif
731