From e0859f5ca17d2887bfbc018936c2fca949df34da Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Wed, 18 Feb 2026 08:47:51 -0500 Subject: [PATCH] intel/isl: Use a fixed alignment for single slices We're going to start changing the surface format during blorp_copy(). Changing the surface format could lead to incorrect image alignment parameters, so return a fixed halign and valign for images with a single subresource. That's all that will be needed for the upcoming blorp_copy() changes. Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/blorp/blorp_blit.c | 21 --------------------- src/intel/isl/isl_genX_helpers.h | 7 +++++++ 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c index 66d3f6e7d6a..4bf170b26cc 100644 --- a/src/intel/blorp/blorp_blit.c +++ b/src/intel/blorp/blorp_blit.c @@ -1750,15 +1750,6 @@ blorp_surf_retile_w_to_y(const struct isl_device *isl_dev, blorp_surf_fake_interleaved_msaa(isl_dev, info); } - if (isl_dev->info->ver == 6 || isl_dev->info->ver == 7) { - /* Gfx6-7 stencil buffers have a very large alignment coming in from the - * miptree. It's out-of-bounds for what the surface state can handle. - * Since we have a single layer and level, it doesn't really matter as - * long as we don't pass a bogus value into isl_surf_fill_state(). - */ - info->surf.image_alignment_el = isl_extent3d(4, 2, 1); - } - /* Now that we've converted everything to a simple 2-D surface with only * one miplevel, we can go about retiling it. */ @@ -1885,18 +1876,6 @@ surf_fake_rgb_with_red(const struct isl_device *isl_dev, isl_format_get_layout(info->view.format)->channels.r.bits); info->surf.format = info->view.format = red_format; - - if (isl_dev->info->verx10 >= 125) { - /* The horizontal alignment is in units of texels for NPOT formats, and - * bytes for other formats. Since the only allowed alignment units are - * powers of two, there's no way to convert the alignment. - * - * Thankfully, the value doesn't matter since we're only a single slice. - * Pick one allowed by isl_gfx125_choose_image_alignment_el. - */ - info->surf.image_alignment_el.w = - 128 / (isl_format_get_layout(red_format)->bpb / 8); - } } enum blit_shrink_status { diff --git a/src/intel/isl/isl_genX_helpers.h b/src/intel/isl/isl_genX_helpers.h index 89b16500210..3a171d948a9 100644 --- a/src/intel/isl/isl_genX_helpers.h +++ b/src/intel/isl/isl_genX_helpers.h @@ -81,6 +81,13 @@ isl_encode_valign(uint8_t valign) UNUSED static struct isl_extent3d isl_get_image_alignment(const struct isl_surf *surf) { + if (surf->levels == 1 && + surf->logical_level0_px.depth == 1 && + surf->logical_level0_px.array_len == 1) { + /* This alignment value is unused for single slice surfaces. */ + return isl_extent3d(GFX_VERx10 >= 125 ? 128 : 4, 4, 1); + } + if (GFX_VERx10 >= 125) { if (isl_tiling_is_64(surf->tiling)) { /* The hardware ignores the alignment values. Anyway, the surface's