summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2011-04-09 18:25:29 +0200
committerChristoph Bumiller <[email protected]>2011-04-10 14:06:52 +0200
commit7b4e478496cf45f527f72c39d72efe2e94fe2386 (patch)
treefd67fddaab6acd8c5e2c8882f1136e3d01908c50 /src/gallium/drivers/nvc0
parentd9ef97696770c8a6b04e4adf9a813614f9b3c741 (diff)
nv50-nvc0: make use of COLOR_MASK,BLEND_ENABLE_COMMON
Diffstat (limited to 'src/gallium/drivers/nvc0')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_3d.xml.h8
-rw-r--r--src/gallium/drivers/nvc0/nvc0_graph_macros.h13
-rw-r--r--src/gallium/drivers/nvc0/nvc0_screen.c7
-rw-r--r--src/gallium/drivers/nvc0/nvc0_state.c4
-rw-r--r--src/gallium/drivers/nvc0/nvc0_stateobj.h2
5 files changed, 14 insertions, 20 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_3d.xml.h b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
index 9a64e3ff6af..63efc74d4a9 100644
--- a/src/gallium/drivers/nvc0/nvc0_3d.xml.h
+++ b/src/gallium/drivers/nvc0/nvc0_3d.xml.h
@@ -344,6 +344,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_VERTEX_RUNOUT_ADDRESS_LOW 0x00000f88
+#define NVC0_3D_COLOR_MASK_COMMON 0x00000f90
+
#define NVC0_3D_DEPTH_BOUNDS(i0) (0x00000f9c + 0x4*(i0))
#define NVC0_3D_DEPTH_BOUNDS__ESIZE 0x00000004
#define NVC0_3D_DEPTH_BOUNDS__LEN 0x00000002
@@ -563,6 +565,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_TEX_CACHE_CTL_UNK1__MASK 0x00000030
#define NVC0_3D_TEX_CACHE_CTL_UNK1__SHIFT 4
+#define NVC0_3D_BLEND_SEPARATE_ALPHA 0x0000133c
+
#define NVC0_3D_BLEND_EQUATION_RGB 0x00001340
#define NVC0_3D_BLEND_EQUATION_RGB_FUNC_ADD 0x00008006
#define NVC0_3D_BLEND_EQUATION_RGB_MIN 0x00008007
@@ -585,6 +589,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_BLEND_FUNC_DST_ALPHA 0x00001358
+#define NVC0_3D_BLEND_ENABLE_COMMON 0x0000135c
+
#define NVC0_3D_BLEND_ENABLE(i0) (0x00001360 + 0x4*(i0))
#define NVC0_3D_BLEND_ENABLE__ESIZE 0x00000004
#define NVC0_3D_BLEND_ENABLE__LEN 0x00000008
@@ -1226,8 +1232,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define NVC0_3D_TFB_VARYING_LOCS__ESIZE 0x00000004
#define NVC0_3D_TFB_VARYING_LOCS__LEN 0x00000020
-#define NVC0_3D_COLOR_MASK_BROADCAST 0x00003808
-
#define NVC0_3D_VERTEX_ARRAY_SELECT 0x00003820
#define NVC0_3D_BLEND_ENABLES 0x00003858
diff --git a/src/gallium/drivers/nvc0/nvc0_graph_macros.h b/src/gallium/drivers/nvc0/nvc0_graph_macros.h
index b7d0d3eafa4..a0a875fe627 100644
--- a/src/gallium/drivers/nvc0/nvc0_graph_macros.h
+++ b/src/gallium/drivers/nvc0/nvc0_graph_macros.h
@@ -68,19 +68,6 @@ static const uint32_t nvc0_9097_vertex_array_select[] =
0x00001841, /* 0x0b: send $r3 */
};
-static const uint32_t nvc0_9097_color_mask_brdc[] =
-{
- 0x05a00021, /* maddr [NVC0_3D_COLOR_MASK(0), increment = 4] */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x00000841, /* send $r1 */
- 0x000008c1, /* exit send $r1 */
- 0x00000841, /* send $r1 */
-};
-
/*
* [GL_POLYGON_MODE_FRONT] = arg;
*
diff --git a/src/gallium/drivers/nvc0/nvc0_screen.c b/src/gallium/drivers/nvc0/nvc0_screen.c
index 17f42e6fc6c..7f01a5eea32 100644
--- a/src/gallium/drivers/nvc0/nvc0_screen.c
+++ b/src/gallium/drivers/nvc0/nvc0_screen.c
@@ -313,8 +313,6 @@ nvc0_magic_3d_init(struct nouveau_channel *chan)
BEGIN_RING(chan, RING_3D_(0x0fac), 1);
OUT_RING (chan, 0);
- BEGIN_RING(chan, RING_3D_(0x0f90), 1);
- OUT_RING (chan, 0);
}
static void
@@ -450,6 +448,10 @@ nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
OUT_RING (chan, 1);
BEGIN_RING(chan, RING_3D(LINE_LAST_PIXEL), 1);
OUT_RING (chan, 0);
+ BEGIN_RING(chan, RING_3D(BLEND_SEPARATE_ALPHA), 1);
+ OUT_RING (chan, 1);
+ BEGIN_RING(chan, RING_3D(BLEND_ENABLE_COMMON), 1);
+ OUT_RING (chan, 0);
nvc0_magic_3d_init(chan);
@@ -582,7 +584,6 @@ nvc0_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev)
MK_MACRO(NVC0_3D_GP_SELECT, nvc0_9097_gp_select);
MK_MACRO(NVC0_3D_POLYGON_MODE_FRONT, nvc0_9097_poly_mode_front);
MK_MACRO(NVC0_3D_POLYGON_MODE_BACK, nvc0_9097_poly_mode_back);
- MK_MACRO(NVC0_3D_COLOR_MASK_BROADCAST, nvc0_9097_color_mask_brdc);
BEGIN_RING(chan, RING_3D(RASTERIZE_ENABLE), 1);
OUT_RING (chan, 1);
diff --git a/src/gallium/drivers/nvc0/nvc0_state.c b/src/gallium/drivers/nvc0/nvc0_state.c
index 85a4d991687..b0b2065167e 100644
--- a/src/gallium/drivers/nvc0/nvc0_state.c
+++ b/src/gallium/drivers/nvc0/nvc0_state.c
@@ -117,7 +117,8 @@ nvc0_blend_state_create(struct pipe_context *pipe,
SB_DATA (so, nvc0_blend_fac(cso->rt[0].alpha_dst_factor));
}
- SB_BEGIN_3D(so, COLOR_MASK_BROADCAST, 1);
+ SB_IMMED_3D(so, COLOR_MASK_COMMON, 1);
+ SB_BEGIN_3D(so, COLOR_MASK(0), 1);
SB_DATA (so, nvc0_colormask(cso->rt[0].colormask));
} else {
uint8_t en = 0;
@@ -137,6 +138,7 @@ nvc0_blend_state_create(struct pipe_context *pipe,
}
SB_IMMED_3D(so, BLEND_ENABLES, en);
+ SB_IMMED_3D(so, COLOR_MASK_COMMON, 0);
SB_BEGIN_3D(so, COLOR_MASK(0), 8);
for (i = 0; i < 8; ++i)
SB_DATA(so, nvc0_colormask(cso->rt[i].colormask));
diff --git a/src/gallium/drivers/nvc0/nvc0_stateobj.h b/src/gallium/drivers/nvc0/nvc0_stateobj.h
index b300ec9097c..e0fe9df25d7 100644
--- a/src/gallium/drivers/nvc0/nvc0_stateobj.h
+++ b/src/gallium/drivers/nvc0/nvc0_stateobj.h
@@ -19,7 +19,7 @@
struct nvc0_blend_stateobj {
struct pipe_blend_state pipe;
int size;
- uint32_t state[69];
+ uint32_t state[70];
};
struct nvc0_rasterizer_stateobj {