From 07e26682f5e9d505936b0fa7469447da39195a69 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: (cherry picked from commit 14dec0c1479aa149edead1e95b7feb1669ccc4c1) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_query.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 2703fa03eef..4d0093b376a 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2659,7 +2659,7 @@ "description": "iris: correctly set alignment to next power of two for struct size", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "c24a574e6c78db038d7aa6c4605bf6a8a892f7ab" }, 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))