Merge remote branch 'nouveau/gallium-0.1' into nouveau-gallium-0.1
authorBen Skeggs <skeggsb@gmail.com>
Sun, 2 Mar 2008 04:42:53 +0000 (15:42 +1100)
committerBen Skeggs <skeggsb@gmail.com>
Sun, 2 Mar 2008 04:42:53 +0000 (15:42 +1100)
src/gallium/drivers/nv30/nv30_state.c

index 5336856..aa3fe78 100644 (file)
@@ -537,7 +537,7 @@ nv30_set_framebuffer_state(struct pipe_context *pipe,
                           const struct pipe_framebuffer_state *fb)
 {
        struct nv30_context *nv30 = nv30_context(pipe);
-       struct pipe_surface *rt[4], *zeta;
+       struct pipe_surface *rt[4], *zeta = NULL;
        uint32_t rt_enable, rt_format, w, h;
        int i, colour_format = 0, zeta_format = 0;
 
@@ -603,13 +603,20 @@ nv30_set_framebuffer_state(struct pipe_context *pipe,
        }
 
        if (rt_enable & NV34TCL_RT_ENABLE_COLOR0) {
+               uint32_t pitch = rt[0]->pitch * rt[0]->cpp;
+               if (zeta) {
+                       pitch |= (zeta->pitch * zeta->cpp)<<16;
+               } else {
+                       pitch |= pitch<<16;
+               }
+
                BEGIN_RING(rankine, NV34TCL_COLOR0_PITCH, 1);
-               OUT_RING  ( (rt[0]->pitch * rt[0]->cpp) | ( (zeta->pitch * zeta->cpp) << 16) );
+               OUT_RING  ( pitch );
                nv30->rt[0] = rt[0]->buffer;
        }
 
        if (rt_enable & NV34TCL_RT_ENABLE_COLOR1) {
-               BEGIN_RING(rankine, NV34TCL_COLOR1_PITCH, 2);
+               BEGIN_RING(rankine, NV34TCL_COLOR1_PITCH, 1);
                OUT_RING  (rt[1]->pitch * rt[1]->cpp);
                nv30->rt[1] = rt[1]->buffer;
        }