isl: Change the physical size of a W-tile to 128x32
authorJason Ekstrand <jason.ekstrand@intel.com>
Sat, 9 Jul 2016 00:24:19 +0000 (17:24 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 13 Jul 2016 18:47:37 +0000 (11:47 -0700)
Reviewed-by: Chad Versace <chad.versace@intel.com>
src/intel/isl/isl.c
src/intel/isl/isl_surface_state.c
src/intel/vulkan/anv_meta_blit2d.c
src/intel/vulkan/genX_cmd_buffer.c

index c710bca6d2985e1c04d5c938eb403ae656472fc2..4205c1c03a4649aa1107bfe1be0d0cf22aa0a624 100644 (file)
@@ -133,10 +133,20 @@ isl_tiling_get_info(const struct isl_device *dev,
       break;
 
    case ISL_TILING_W:
-      /* XXX: Should W tile be same as Y? */
       assert(bs == 1);
       logical_el = isl_extent2d(64, 64);
-      phys_B = isl_extent2d(64, 64);
+      /* From the Broadwell PRM Vol 2d, RENDER_SURFACE_STATE::SurfacePitch:
+       *
+       *    "If the surface is a stencil buffer (and thus has Tile Mode set
+       *    to TILEMODE_WMAJOR), the pitch must be set to 2x the value
+       *    computed based on width, as the stencil buffer is stored with two
+       *    rows interleaved."
+       *
+       * This, together with the fact that stencil buffers are referred to as
+       * being Y-tiled in the PRMs for older hardware implies that the
+       * physical size of a W-tile is actually the same as for a Y-tile.
+       */
+      phys_B = isl_extent2d(128, 32);
       break;
 
    case ISL_TILING_Yf:
index b2317d81bdc5d5f4b27375e1be271e9879e069c0..c65126db8801fdfe226e4bc5bb740a7994795257 100644 (file)
@@ -298,16 +298,7 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
    s.SurfaceVerticalAlignment = isl_to_gen_valign[image_align.height];
    s.SurfaceHorizontalAlignment = isl_to_gen_halign[image_align.width];
 
-   if (info->surf->tiling == ISL_TILING_W) {
-      /* From the Broadwell PRM documentation for this field:
-       *
-       *    "If the surface is a stencil buffer (and thus has Tile Mode set
-       *    to TILEMODE_WMAJOR), the pitch must be set to 2x the value
-       *    computed based on width, as the stencil buffer is stored with
-       *    two rows interleaved."
-       */
-      s.SurfacePitch = info->surf->row_pitch * 2 - 1;
-   } else if (info->surf->dim_layout == ISL_DIM_LAYOUT_GEN9_1D) {
+   if (info->surf->dim_layout == ISL_DIM_LAYOUT_GEN9_1D) {
       /* For gen9 1-D textures, surface pitch is ignored */
       s.SurfacePitch = 0;
    } else {
index 06e104329527e77b80bb78d08482a11fc060f045..d37d69d96b79a0dd13fdecd931d33ae6b30f17db 100644 (file)
@@ -540,7 +540,7 @@ anv_meta_blit2d_w_tiled_dst(struct anv_cmd_buffer *cmd_buffer,
          .tiling = ISL_TILING_Y0,
          .base_offset = dst->base_offset,
          .bs = 1,
-         .pitch = dst->pitch * 2,
+         .pitch = dst->pitch,
       };
 
       struct blit2d_dst_temps dst_temps;
index ed90a91499fe3b4f0cb6a6c3324649d442b0e467..648649fbb93f1f321cada75777ea644c9038ca3d 100644 (file)
@@ -1112,12 +1112,7 @@ cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer)
 #endif
          sb.StencilBufferObjectControlState = GENX(MOCS),
 
-         /* Stencil buffers have strange pitch. The PRM says:
-          *
-          *    The pitch must be set to 2x the value computed based on width,
-          *    as the stencil buffer is stored with two rows interleaved.
-          */
-         sb.SurfacePitch = 2 * image->stencil_surface.isl.row_pitch - 1,
+         sb.SurfacePitch = image->stencil_surface.isl.row_pitch - 1,
 
 #if GEN_GEN >= 8
          sb.SurfaceQPitch = isl_surf_get_array_pitch_el_rows(&image->stencil_surface.isl) >> 2,