[Mesa-dev] [PATCH 5/5] i965:gen7+ Remove tile_x and tile_y dependency in BLORP

Abdiel Janulgue abdiel.janulgue at linux.intel.com
Mon Dec 9 08:03:34 PST 2013


GEN7+-specific hw-support. This can be copied over to GEN8/Broadwell with few
modifications.

Signed-off-by: Abdiel Janulgue <abdiel.janulgue at linux.intel.com>
---
 src/mesa/drivers/dri/i965/gen7_blorp.cpp |   24 ++++++++----------------
 1 file changed, 8 insertions(+), 16 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
index 1af869b..94e4626 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
@@ -142,15 +142,13 @@ gen7_blorp_emit_surface_state(struct brw_context *brw,
                               bool is_render_target)
 {
    uint32_t wm_surf_offset;
-   uint32_t width = surface->width;
-   uint32_t height = surface->height;
+   bool is_source = (surface == &params->src);
    /* Note: since gen7 uses INTEL_MSAA_LAYOUT_CMS or INTEL_MSAA_LAYOUT_UMS for
     * color surfaces, width and height are measured in pixels; we don't need
     * to divide them by 2 as we do for Gen6 (see
     * gen6_blorp_emit_surface_state).
     */
    struct intel_region *region = surface->mt->region;
-   uint32_t tile_x, tile_y;
    const uint8_t mocs = GEN7_MOCS_L3;
 
    uint32_t tiling = surface->map_stencil_as_y_tiled
@@ -175,20 +173,14 @@ gen7_blorp_emit_surface_state(struct brw_context *brw,
       surf[0] |= GEN7_SURFACE_ARYSPC_FULL;
 
    /* reloc */
-   surf[1] =
-      surface->compute_tile_offsets(&tile_x, &tile_y) + region->bo->offset;
+   surf[1] = region->bo->offset;
 
-   /* Note that the low bits of these fields are missing, so
-    * there's the possibility of getting in trouble.
-    */
-   assert(tile_x % 4 == 0);
-   assert(tile_y % 2 == 0);
-   surf[5] = SET_FIELD(tile_x / 4, BRW_SURFACE_X_OFFSET) |
-             SET_FIELD(tile_y / 2, BRW_SURFACE_Y_OFFSET) |
-             SET_FIELD(mocs, GEN7_SURFACE_MOCS);
-
-   surf[2] = SET_FIELD(width - 1, GEN7_SURFACE_WIDTH) |
-             SET_FIELD(height - 1, GEN7_SURFACE_HEIGHT);
+   surf[5] = SET_FIELD(mocs, GEN7_SURFACE_MOCS) |
+             SET_FIELD(is_source? surface->level : 0, GEN7_SURFACE_MIN_LOD) |
+             (is_source ? 0 : surface->level);
+
+   surf[2] = SET_FIELD(surface->mt->logical_width0 - 1, GEN7_SURFACE_WIDTH) |
+             SET_FIELD(surface->mt->logical_height0 - 1, GEN7_SURFACE_HEIGHT);
 
    uint32_t pitch_bytes = region->pitch;
    if (surface->map_stencil_as_y_tiled)
-- 
1.7.9.5



More information about the mesa-dev mailing list