[Mesa-dev] [PATCH 21/32] i965: Allocate tile aligned height

Ben Widawsky ben at bwidawsk.net
Tue Jan 3 02:37:12 UTC 2017


This patch shouldn't actually do anything because the libdrm function
should already do this alignment. However, it preps us for a future
patch where we add in the CCS AUX size, and in the process it serves as
a good place to find bisectable issues if libdrm or kernel does
something incorrectly.

Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
Acked-by: Daniel Stone <daniels at collabora.com>
---
 src/mesa/drivers/dri/i965/intel_screen.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index ba968bee17..153542c1d1 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -548,13 +548,16 @@ create_image_with_modifier(struct intel_screen *screen,
 {
    uint32_t requested_tiling = 0, tiling = 0;
    unsigned long pitch;
+   unsigned tiled_height = 0;
 
    switch (modifier) {
    case I915_FORMAT_MOD_Y_TILED:
       requested_tiling = tiling = I915_TILING_Y;
+      tiled_height = ALIGN(height, 32);
       break;
    case I915_FORMAT_MOD_X_TILED:
       requested_tiling = tiling = I915_TILING_X;
+      tiled_height = height;
       break;
    default:
       unreachable("Unknown modifier");
@@ -565,7 +568,7 @@ create_image_with_modifier(struct intel_screen *screen,
 
    cpp = _mesa_get_format_bytes(image->format);
    image->bo = drm_intel_bo_alloc_tiled(screen->bufmgr, "image+mod",
-                                        width, height, cpp, &tiling,
+                                        width, tiled_height, cpp, &tiling,
                                         &pitch, 0);
    if (image->bo == NULL)
       return false;
-- 
2.11.0



More information about the mesa-dev mailing list