[Mesa-dev] [PATCH 11/16] i965/miptree: Pass flags instead of explicit tiling to surface creator

Topi Pohjolainen topi.pohjolainen at gmail.com
Mon Jul 17 13:35:02 UTC 2017


allowing one to isl tiling filter.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index b2ae807ae9..b692d55abb 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -734,7 +734,7 @@ static struct intel_mipmap_tree *
 make_surface(struct brw_context *brw, GLenum target, mesa_format format,
              unsigned first_level, unsigned last_level,
              unsigned width0, unsigned height0, unsigned depth0,
-             unsigned num_samples, enum isl_tiling isl_tiling,
+             unsigned num_samples, isl_tiling_flags_t tiling_flags,
              isl_surf_usage_flags_t isl_usage_flags, uint32_t alloc_flags,
              unsigned row_pitch, struct brw_bo *bo)
 {
@@ -772,7 +772,7 @@ make_surface(struct brw_context *brw, GLenum target, mesa_format format,
       .samples = MAX2(num_samples, 1),
       .row_pitch = row_pitch,
       .usage = isl_usage_flags, 
-      .tiling_flags = 1u << isl_tiling
+      .tiling_flags = tiling_flags,
    };
 
    if (!isl_surf_init_s(&brw->isl_dev, &mt->surf, &init_info))
@@ -783,7 +783,8 @@ make_surface(struct brw_context *brw, GLenum target, mesa_format format,
    if (!bo) {
       mt->bo = brw_bo_alloc_tiled(brw->bufmgr, "isl-miptree",
                                   mt->surf.size,
-                                  isl_tiling_to_bufmgr_tiling(isl_tiling),
+                                  isl_tiling_to_bufmgr_tiling(
+                                     mt->surf.tiling),
                                   mt->surf.row_pitch, alloc_flags);
       if (!mt->bo)
          goto fail;
@@ -818,7 +819,8 @@ miptree_create(struct brw_context *brw,
 {
    if (brw->gen == 6 && format == MESA_FORMAT_S_UINT8)
       return make_surface(brw, target, format, first_level, last_level,
-                          width0, height0, depth0, num_samples, ISL_TILING_W,
+                          width0, height0, depth0, num_samples,
+                          ISL_TILING_W_BIT,
                           ISL_SURF_USAGE_STENCIL_BIT |
                           ISL_SURF_USAGE_TEXTURE_BIT,
                           BO_ALLOC_FOR_RENDER, 0, NULL);
@@ -942,7 +944,8 @@ intel_miptree_create_for_bo(struct brw_context *brw,
 
    if (brw->gen == 6 && format == MESA_FORMAT_S_UINT8) {
       mt = make_surface(brw, target, MESA_FORMAT_S_UINT8,
-                        0, 0, width, height, depth, 1, ISL_TILING_W,
+                        0, 0, width, height, depth, 1,
+                        ISL_TILING_W_BIT,
                         ISL_SURF_USAGE_STENCIL_BIT |
                         ISL_SURF_USAGE_TEXTURE_BIT,
                         BO_ALLOC_FOR_RENDER, pitch, bo);
-- 
2.11.0



More information about the mesa-dev mailing list