freedreno: set alignment to next POT
authorRohan Garg <rohan.garg@intel.com>
Fri, 20 Jan 2023 10:33:16 +0000 (11:33 +0100)
committerMarge Bot <emma+marge@anholt.net>
Thu, 25 May 2023 21:24:45 +0000 (21:24 +0000)
Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20153>

src/gallium/drivers/freedreno/a5xx/fd5_emit.c

index 5886645..e0335be 100644 (file)
@@ -310,8 +310,10 @@ emit_border_color(struct fd_context *ctx, struct fd_ringbuffer *ring) assert_dt
 
    STATIC_ASSERT(sizeof(struct bcolor_entry) == FD5_BORDER_COLOR_SIZE);
 
+   const unsigned int alignment =
+      util_next_power_of_two(FD5_BORDER_COLOR_UPLOAD_SIZE);
    u_upload_alloc(fd5_ctx->border_color_uploader, 0,
-                  FD5_BORDER_COLOR_UPLOAD_SIZE, FD5_BORDER_COLOR_UPLOAD_SIZE,
+                  FD5_BORDER_COLOR_UPLOAD_SIZE, alignment,
                   &off, &fd5_ctx->border_color_buf, &ptr);
 
    entries = ptr;