[Mesa-dev] [PATCH 5/7] i965/blorp: handle source tile offsets for w-tiled in the program

Topi Pohjolainen topi.pohjolainen at intel.com
Mon Feb 10 11:53:13 PST 2014


instead of using the surface state x/y-offsets. These are not
available in the gen8 anymore.

No regressions on IVB and SNB.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_blorp.cpp  | 7 +++++++
 src/mesa/drivers/dri/i965/gen6_blorp.cpp | 4 ++--
 src/mesa/drivers/dri/i965/gen7_blorp.cpp | 2 +-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.cpp b/src/mesa/drivers/dri/i965/brw_blorp.cpp
index ff590b5..5cff9b4 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp.cpp
@@ -202,6 +202,13 @@ brw_blorp_params::configure_miplevel_offsets()
       dst_tile_orig_space_y = dst.tile_y * 2;
    }
 
+   if (src.map_stencil_as_y_tiled) {
+      src.compute_tile_offsets(&src.tile_x, &src.tile_y);
+
+      src_tile_orig_space_x = src.tile_x / 2;
+      src_tile_orig_space_y = src.tile_y * 2;
+   }
+
    /* Compensate for the adjusted destination offsets when calculating the
     * corresponding sampling coordinates for the source.
     */
diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
index 5cd947b..e5b3d3c 100644
--- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
@@ -394,7 +394,7 @@ gen6_blorp_emit_surface_state(struct brw_context *brw,
    /* When the tile offsets are handled by the blorp program directly the
     * dimensions of the surface need to be updated to allow full access.
     */
-   if (surface->map_stencil_as_y_tiled && &params->dst == surface) {
+   if (surface->map_stencil_as_y_tiled) {
       width += surface->tile_x;
       height += surface->tile_y;
    }
@@ -416,7 +416,7 @@ gen6_blorp_emit_surface_state(struct brw_context *brw,
    surf[5] = (surface->mt->align_h == 4 ?
               BRW_SURFACE_VERTICAL_ALIGN_ENABLE : 0);
 
-   if (!surface->map_stencil_as_y_tiled || &params->dst != surface) {
+   if (!surface->map_stencil_as_y_tiled) {
       uint32_t tile_x, tile_y;
 
       surface->compute_tile_offsets(&tile_x, &tile_y);
diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
index 9e51b03..337b7b9 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
@@ -181,7 +181,7 @@ gen7_blorp_emit_surface_state(struct brw_context *brw,
    /* When the tile offsets are handled by the blorp program directly the
     * dimensions of the surface need to be updated to allow full access.
     */
-   if (surface->map_stencil_as_y_tiled && is_render_target) {
+   if (surface->map_stencil_as_y_tiled) {
       width += surface->tile_x;
       height += surface->tile_y;
    } else {
-- 
1.8.3.1



More information about the mesa-dev mailing list