iris/resource: Use isl surface alignment during bo allocation
authorJordan Justen <jordan.l.justen@intel.com>
Fri, 31 May 2019 22:50:53 +0000 (15:50 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 18 Oct 2019 04:22:00 +0000 (21:22 -0700)
Reworks:
 * Change subject from "iris: Align main surface allocation to 64k on gen12+"
 * Make use of isl surf alignment. (Nanley)

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_resource.c

index eac329d9ba7a06be9289d886a34f075491bc6dc6..5e532e801001b986397878a1d712c51c670a26e9 100644 (file)
@@ -823,7 +823,9 @@ iris_resource_create_with_modifiers(struct pipe_screen *pscreen,
       bo_size = res->surf.size_B;
    }
 
-   res->bo = iris_bo_alloc_tiled(screen->bufmgr, name, bo_size, 4096, memzone,
+   uint32_t alignment = MAX2(4096, res->surf.alignment_B);
+   res->bo = iris_bo_alloc_tiled(screen->bufmgr, name, bo_size, alignment,
+                                 memzone,
                                  isl_tiling_to_i915_tiling(res->surf.tiling),
                                  res->surf.row_pitch_B, flags);