Module: Mesa
Branch: main
Commit: 08b6f786acf4fd9705625d3a1576b87b0dd64281
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=08b6f786acf4fd9705625d3a1576b87b0dd64281

Author: Yonggang Luo <luoyongg...@gmail.com>
Date:   Thu Jun 29 11:34:46 2023 +0800

nouveau: Use align64 instead of ALIGN for 64 bit value parameter

Signed-off-by: Yonggang Luo <luoyongg...@gmail.com>
Reviewed-by: Faith Ekstrand <faith.ekstr...@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26868>

---

 src/nouveau/nil/nil_image.c     | 2 +-
 src/nouveau/vulkan/nvk_device.c | 6 +++---
 src/nouveau/winsys/nouveau_bo.c | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/nouveau/nil/nil_image.c b/src/nouveau/nil/nil_image.c
index 7294ff25e6e..e7f1e8f3517 100644
--- a/src/nouveau/nil/nil_image.c
+++ b/src/nouveau/nil/nil_image.c
@@ -483,7 +483,7 @@ nil_image_init(struct nv_device_info *dev,
       image->align_B = MAX2(image->align_B, 128);
    }
 
-   image->size_B = ALIGN(image->size_B, image->align_B);
+   image->size_B = align64(image->size_B, image->align_B);
    return true;
 }
 
diff --git a/src/nouveau/vulkan/nvk_device.c b/src/nouveau/vulkan/nvk_device.c
index 58b133f13c3..c92a53ce316 100644
--- a/src/nouveau/vulkan/nvk_device.c
+++ b/src/nouveau/vulkan/nvk_device.c
@@ -67,7 +67,7 @@ nvk_slm_area_ensure(struct nvk_device *dev,
    /* The hardware seems to require this alignment for
     * NV9097_SET_SHADER_LOCAL_MEMORY_E_DEFAULT_SIZE_PER_WARP
     */
-   bytes_per_warp = ALIGN(bytes_per_warp, 0x200);
+   bytes_per_warp = align64(bytes_per_warp, 0x200);
 
    uint64_t bytes_per_mp = bytes_per_warp * dev->pdev->info.max_warps_per_mp;
    uint64_t bytes_per_tpc = bytes_per_mp * dev->pdev->info.mp_per_tpc;
@@ -75,7 +75,7 @@ nvk_slm_area_ensure(struct nvk_device *dev,
    /* The hardware seems to require this alignment for
     * NVA0C0_SET_SHADER_LOCAL_MEMORY_NON_THROTTLED_A_SIZE_LOWER.
     */
-   bytes_per_tpc = ALIGN(bytes_per_tpc, 0x8000);
+   bytes_per_tpc = align64(bytes_per_tpc, 0x8000);
 
    /* nvk_slm_area::bytes_per_mp only ever increases so we can check this
     * outside the lock and exit early in the common case.  We only need to
@@ -92,7 +92,7 @@ nvk_slm_area_ensure(struct nvk_device *dev,
    /* The hardware seems to require this alignment for
     * NV9097_SET_SHADER_LOCAL_MEMORY_D_SIZE_LOWER.
     */
-   size = ALIGN(size, 0x20000);
+   size = align64(size, 0x20000);
 
    struct nouveau_ws_bo *bo =
       nouveau_ws_bo_new(dev->ws_dev, size, 0,
diff --git a/src/nouveau/winsys/nouveau_bo.c b/src/nouveau/winsys/nouveau_bo.c
index 5df3e773d76..6ee022b14a3 100644
--- a/src/nouveau/winsys/nouveau_bo.c
+++ b/src/nouveau/winsys/nouveau_bo.c
@@ -181,7 +181,7 @@ nouveau_ws_bo_new_locked(struct nouveau_ws_device *dev,
       align = 0x1000;
 
    /* Align the size */
-   size = ALIGN(size, align);
+   size = align64(size, align);
 
    req.info.domain = 0;
 
@@ -300,7 +300,7 @@ nouveau_ws_bo_from_dma_buf_locked(struct nouveau_ws_device 
*dev, int fd)
    if (info.domain & NOUVEAU_GEM_DOMAIN_VRAM)
       align = (1ULL << 16);
 
-   assert(bo->size == ALIGN(bo->size, align));
+   assert(bo->size == align64(bo->size, align));
 
    bo->offset = nouveau_ws_alloc_vma(dev, 0, bo->size, align, false, false);
    if (bo->offset == 0)

Reply via email to