failover: queiten compiler warnings
[mesa.git] / src / gallium / drivers / i915simple / i915_state_emit.c
index 8bcc26ad3561613338b32520627d4e6c8958b963..9bd6f92323d09129b85ff8f53c024159881e2a2d 100644 (file)
@@ -211,34 +211,43 @@ i915_emit_hardware_state(struct i915_context *i915 )
       struct pipe_surface *depth_surface = i915->framebuffer.zsbuf;
 
       if (cbuf_surface) {
-        unsigned pitch = (cbuf_surface->pitch * cbuf_surface->cpp);
+        unsigned cpitch = cbuf_surface->stride;
+        unsigned ctile = BUF_3D_USE_FENCE;
+        if (cbuf_surface->texture &&
+              ((struct i915_texture*)(cbuf_surface->texture))->tiled) {
+           ctile = BUF_3D_TILED_SURFACE;
+        }
 
         OUT_BATCH(_3DSTATE_BUF_INFO_CMD);
 
         OUT_BATCH(BUF_3D_ID_COLOR_BACK | 
-                  BUF_3D_PITCH(pitch) |  /* pitch in bytes */
-//                BUF_3D_TILED_SURFACE); /* JB: Used to force tileing */
-                  BUF_3D_USE_FENCE);
+                  BUF_3D_PITCH(cpitch) |  /* pitch in bytes */
+                  ctile);
 
         OUT_RELOC(cbuf_surface->buffer,
                   I915_BUFFER_ACCESS_WRITE,
-                  0);
+                  cbuf_surface->offset);
       }
 
       /* What happens if no zbuf??
        */
       if (depth_surface) {
-        unsigned zpitch = (depth_surface->pitch * depth_surface->cpp);
-                        
+        unsigned zpitch = depth_surface->stride;
+        unsigned ztile = BUF_3D_USE_FENCE;
+        if (depth_surface->texture &&
+              ((struct i915_texture*)(depth_surface->texture))->tiled) {
+           ztile = BUF_3D_TILED_SURFACE;
+        }
+
         OUT_BATCH(_3DSTATE_BUF_INFO_CMD);
 
         OUT_BATCH(BUF_3D_ID_DEPTH |
                   BUF_3D_PITCH(zpitch) |  /* pitch in bytes */
-                  BUF_3D_USE_FENCE);
+                  ztile);
 
         OUT_RELOC(depth_surface->buffer,
                   I915_BUFFER_ACCESS_WRITE,
-                  0);
+                  depth_surface->offset);
       }
    
       {
@@ -377,6 +386,7 @@ i915_emit_hardware_state(struct i915_context *i915 )
    {
       uint w, h;
       boolean k = framebuffer_size(&i915->framebuffer, &w, &h);
+      (void)k;
       assert(k);
 
       OUT_BATCH(_3DSTATE_DRAW_RECT_CMD);