From 1f62cddaf537cd6fcfead26ac297a85727790ba0 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Fri, 23 Jul 2021 09:02:06 -0700 Subject: [PATCH] intel/blorp: Fix faked RGB image alignment on XeHP On XeHP, NPOT and POT formatted surfaces will use different image alignment units when emitting surface states. When BLORP fakes an RGB image as RED, update the image alignment to prevent assert failures when emitting surface states. Reviewed-by: Jason Ekstrand Part-of: --- src/intel/blorp/blorp_blit.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c index 2597de8dfd3..cd29f65cd2e 100644 --- a/src/intel/blorp/blorp_blit.c +++ b/src/intel/blorp/blorp_blit.c @@ -1785,6 +1785,18 @@ 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 {