From 14dec0c1479aa149edead1e95b7feb1669ccc4c1 Mon Sep 17 00:00:00 2001 From: Rohan Garg Date: Fri, 2 Dec 2022 21:09:33 +0530 Subject: [PATCH] iris: correctly set alignment to next power of two for struct size We're currently aligning the offset to the size of the data structure itself when the upload manager actually expects a POT. Ideally this would be the next POT that's greater than the size of the structure. Fixes: c24a574e6c78 ("iris: Don't allocate a BO per query object") Signed-off-by: Rohan Garg Reviewed-by: Sagar Ghuge Part-of: --- src/gallium/drivers/iris/iris_query.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_query.c b/src/gallium/drivers/iris/iris_query.c index a5c4c94ad0b..2d2c5bc86f1 100644 --- a/src/gallium/drivers/iris/iris_query.c +++ b/src/gallium/drivers/iris/iris_query.c @@ -521,7 +521,8 @@ iris_begin_query(struct pipe_context *ctx, struct pipe_query *query) size = sizeof(struct iris_query_snapshots); u_upload_alloc(ice->query_buffer_uploader, 0, - size, size, &q->query_state_ref.offset, + size, util_next_power_of_two(size), + &q->query_state_ref.offset, &q->query_state_ref.res, &ptr); if (!iris_resource_bo(q->query_state_ref.res))