From 423add61e2d5b6ab6b5505d1feec01b93609f8fc Mon Sep 17 00:00:00 2001 From: Sean Anderson Date: Mon, 17 Jul 2023 17:37:32 -0400 Subject: [PATCH] gallium: lima: Don't round height when checking alignment Height does not affect alignment, so don't modify it. This fixes failures if the buffer height is not an exact multiple of 16. Signed-off-by: Sean Anderson Reviewed-by: Erico Nunes Part-of: --- src/gallium/drivers/lima/lima_resource.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/lima/lima_resource.c b/src/gallium/drivers/lima/lima_resource.c index d7fe9da69f7..8d8e3756de8 100644 --- a/src/gallium/drivers/lima/lima_resource.c +++ b/src/gallium/drivers/lima/lima_resource.c @@ -363,12 +363,11 @@ lima_resource_from_handle(struct pipe_screen *pscreen, /* check alignment for the buffer */ if (res->tiled || (pres->bind & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL))) { - unsigned width, height, stride, size; + unsigned width, stride, size; width = align(pres->width0, 16); - height = align(pres->height0, 16); stride = util_format_get_stride(pres->format, width); - size = util_format_get_2d_size(pres->format, stride, height); + size = util_format_get_2d_size(pres->format, stride, pres->height0); if (res->tiled && res->levels[0].stride != stride) { fprintf(stderr, "tiled imported buffer has mismatching stride: %d (BO) != %d (expected)",