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

Author: Frank Binns <frank.bi...@imgtec.com>
Date:   Fri Jun  2 13:07:55 2023 +0100

pvr: rename some more instances of 'reserved' to 'carveout' for consistency

Signed-off-by: Frank Binns <frank.bi...@imgtec.com>
Reviewed-by: Karmjit Mahil <karmjit.ma...@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25910>

---

 src/imagination/vulkan/winsys/pvr_winsys_helper.c   | 14 +++++++-------
 src/imagination/vulkan/winsys/pvr_winsys_helper.h   |  6 +++---
 src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c    |  8 ++++----
 src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h    |  2 +-
 src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.c | 20 ++++++++++----------
 src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.h |  4 ++--
 6 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/src/imagination/vulkan/winsys/pvr_winsys_helper.c 
b/src/imagination/vulkan/winsys/pvr_winsys_helper.c
index 6af32b11be5..e13e09c557e 100644
--- a/src/imagination/vulkan/winsys/pvr_winsys_helper.c
+++ b/src/imagination/vulkan/winsys/pvr_winsys_helper.c
@@ -138,7 +138,7 @@ void pvr_winsys_helper_heap_free(struct pvr_winsys_vma 
*const vma)
  */
 static VkResult
 pvr_buffer_create_and_map(struct pvr_winsys *const ws,
-                          heap_alloc_reserved_func heap_alloc_reserved,
+                          heap_alloc_carveout_func heap_alloc_carveout,
                           struct pvr_winsys_heap *heap,
                           pvr_dev_addr_t dev_addr,
                           uint64_t size,
@@ -150,7 +150,7 @@ pvr_buffer_create_and_map(struct pvr_winsys *const ws,
    VkResult result;
 
    /* Address should not be NULL, this function is used to allocate and map
-    * reserved addresses and is only supposed to be used internally.
+    * carveout addresses and is only supposed to be used internally.
     */
    assert(dev_addr.addr);
 
@@ -163,7 +163,7 @@ pvr_buffer_create_and_map(struct pvr_winsys *const ws,
    if (result != VK_SUCCESS)
       goto err_out;
 
-   result = heap_alloc_reserved(heap, dev_addr, size, alignment, &vma);
+   result = heap_alloc_carveout(heap, dev_addr, size, alignment, &vma);
    if (result != VK_SUCCESS)
       goto err_pvr_winsys_buffer_destroy;
 
@@ -203,7 +203,7 @@ static void inline pvr_buffer_destroy_and_unmap(struct 
pvr_winsys_vma *vma)
 
 VkResult pvr_winsys_helper_allocate_static_memory(
    struct pvr_winsys *const ws,
-   heap_alloc_reserved_func heap_alloc_reserved,
+   heap_alloc_carveout_func heap_alloc_carveout,
    struct pvr_winsys_heap *const general_heap,
    struct pvr_winsys_heap *const pds_heap,
    struct pvr_winsys_heap *const usc_heap,
@@ -217,7 +217,7 @@ VkResult pvr_winsys_helper_allocate_static_memory(
    VkResult result;
 
    result = pvr_buffer_create_and_map(ws,
-                                      heap_alloc_reserved,
+                                      heap_alloc_carveout,
                                       general_heap,
                                       general_heap->static_data_carveout_addr,
                                       general_heap->static_data_carveout_size,
@@ -227,7 +227,7 @@ VkResult pvr_winsys_helper_allocate_static_memory(
       goto err_out;
 
    result = pvr_buffer_create_and_map(ws,
-                                      heap_alloc_reserved,
+                                      heap_alloc_carveout,
                                       pds_heap,
                                       pds_heap->static_data_carveout_addr,
                                       pds_heap->static_data_carveout_size,
@@ -237,7 +237,7 @@ VkResult pvr_winsys_helper_allocate_static_memory(
       goto err_pvr_buffer_destroy_and_unmap_general;
 
    result = pvr_buffer_create_and_map(ws,
-                                      heap_alloc_reserved,
+                                      heap_alloc_carveout,
                                       usc_heap,
                                       usc_heap->static_data_carveout_addr,
                                       pds_heap->static_data_carveout_size,
diff --git a/src/imagination/vulkan/winsys/pvr_winsys_helper.h 
b/src/imagination/vulkan/winsys/pvr_winsys_helper.h
index 79ab8d1b1db..295ea06517a 100644
--- a/src/imagination/vulkan/winsys/pvr_winsys_helper.h
+++ b/src/imagination/vulkan/winsys/pvr_winsys_helper.h
@@ -41,9 +41,9 @@ struct pvr_winsys_heap;
 struct pvr_winsys_static_data_offsets;
 struct pvr_winsys_vma;
 
-typedef VkResult (*const heap_alloc_reserved_func)(
+typedef VkResult (*const heap_alloc_carveout_func)(
    struct pvr_winsys_heap *const heap,
-   const pvr_dev_addr_t reserved_dev_addr,
+   const pvr_dev_addr_t carveout_dev_addr,
    uint64_t size,
    uint64_t alignment,
    struct pvr_winsys_vma **vma_out);
@@ -64,7 +64,7 @@ void pvr_winsys_helper_heap_free(struct pvr_winsys_vma *const 
vma);
 
 VkResult pvr_winsys_helper_allocate_static_memory(
    struct pvr_winsys *const ws,
-   heap_alloc_reserved_func heap_alloc_reserved,
+   heap_alloc_carveout_func heap_alloc_carveout,
    struct pvr_winsys_heap *const general_heap,
    struct pvr_winsys_heap *const pds_heap,
    struct pvr_winsys_heap *const usc_heap,
diff --git a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c 
b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c
index 17c130e16ca..3752569271e 100644
--- a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c
+++ b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c
@@ -140,7 +140,7 @@ static VkResult pvr_srv_heap_init(
 {
    pvr_dev_addr_t base_address;
    uint32_t log2_page_size;
-   uint64_t reserved_size;
+   uint64_t carveout_size;
    VkResult result;
    uint64_t size;
 
@@ -150,7 +150,7 @@ static VkResult pvr_srv_heap_init(
                                      NULL,
                                      &base_address,
                                      &size,
-                                     &reserved_size,
+                                     &carveout_size,
                                      &log2_page_size);
    if (result != VK_SUCCESS)
       return result;
@@ -159,7 +159,7 @@ static VkResult pvr_srv_heap_init(
                                  base_address,
                                  size,
                                  base_address,
-                                 reserved_size,
+                                 carveout_size,
                                  log2_page_size,
                                  static_data_offsets,
                                  &srv_heap->base);
@@ -342,7 +342,7 @@ static VkResult pvr_srv_memctx_init(struct pvr_srv_winsys 
*srv_ws)
 
    result =
       pvr_winsys_helper_allocate_static_memory(&srv_ws->base,
-                                               pvr_srv_heap_alloc_reserved,
+                                               pvr_srv_heap_alloc_carveout,
                                                &srv_ws->general_heap.base,
                                                &srv_ws->pds_heap.base,
                                                &srv_ws->usc_heap.base,
diff --git a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h 
b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h
index 88bb3b4d972..ce25ef0862a 100644
--- a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h
+++ b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h
@@ -90,7 +90,7 @@ struct pvr_srv_winsys {
    bool rgn_hdr_heap_present;
    struct pvr_srv_winsys_heap rgn_hdr_heap;
 
-   /* vma's for reserved memory regions */
+   /* vma's for carveout memory regions */
    struct pvr_winsys_vma *pds_vma;
    struct pvr_winsys_vma *usc_vma;
    struct pvr_winsys_vma *general_vma;
diff --git a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.c 
b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.c
index 0934ca95827..91c4e50d2d2 100644
--- a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.c
+++ b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.c
@@ -344,12 +344,12 @@ void pvr_srv_winsys_buffer_unmap(struct pvr_winsys_bo *bo)
    buffer_release(srv_bo);
 }
 
-/* This function must be used to allocate inside reserved region and must be
- * used internally only. This also means whoever is using it, must know what
- * they are doing.
+/* This function must be used to allocate from a heap carveout and must only be
+ * used within the winsys code. This also means whoever is using it, must know
+ * what they are doing.
  */
-VkResult pvr_srv_heap_alloc_reserved(struct pvr_winsys_heap *heap,
-                                     const pvr_dev_addr_t reserved_dev_addr,
+VkResult pvr_srv_heap_alloc_carveout(struct pvr_winsys_heap *heap,
+                                     const pvr_dev_addr_t carveout_dev_addr,
                                      uint64_t size,
                                      uint64_t alignment,
                                      struct pvr_winsys_vma **const vma_out)
@@ -380,10 +380,10 @@ VkResult pvr_srv_heap_alloc_reserved(struct 
pvr_winsys_heap *heap,
    /* Just check address is correct and aligned, locking is not required as
     * user is responsible to provide a distinct address.
     */
-   if (reserved_dev_addr.addr < heap->base_addr.addr ||
-       reserved_dev_addr.addr + size >
+   if (carveout_dev_addr.addr < heap->base_addr.addr ||
+       carveout_dev_addr.addr + size >
           heap->base_addr.addr + heap->static_data_carveout_size ||
-       reserved_dev_addr.addr & ((ws->page_size) - 1)) {
+       carveout_dev_addr.addr & ((ws->page_size) - 1)) {
       result = vk_error(NULL, VK_ERROR_INITIALIZATION_FAILED);
       goto err_vk_free_srv_vma;
    }
@@ -391,13 +391,13 @@ VkResult pvr_srv_heap_alloc_reserved(struct 
pvr_winsys_heap *heap,
    /* Reserve the virtual range in the MMU and create a mapping structure */
    result = pvr_srv_int_reserve_addr(ws->render_fd,
                                      srv_heap->server_heap,
-                                     reserved_dev_addr,
+                                     carveout_dev_addr,
                                      size,
                                      &srv_vma->reservation);
    if (result != VK_SUCCESS)
       goto err_vk_free_srv_vma;
 
-   srv_vma->base.dev_addr = reserved_dev_addr;
+   srv_vma->base.dev_addr = carveout_dev_addr;
    srv_vma->base.bo = NULL;
    srv_vma->base.heap = heap;
    srv_vma->base.size = size;
diff --git a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.h 
b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.h
index 5fe6ad4df71..519b55aac44 100644
--- a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.h
+++ b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv_bo.h
@@ -159,8 +159,8 @@ VkResult pvr_srv_winsys_buffer_get_fd(struct pvr_winsys_bo 
*bo,
 VkResult pvr_srv_winsys_buffer_map(struct pvr_winsys_bo *bo);
 void pvr_srv_winsys_buffer_unmap(struct pvr_winsys_bo *bo);
 
-VkResult pvr_srv_heap_alloc_reserved(struct pvr_winsys_heap *heap,
-                                     const pvr_dev_addr_t reserved_dev_addr,
+VkResult pvr_srv_heap_alloc_carveout(struct pvr_winsys_heap *heap,
+                                     const pvr_dev_addr_t carveout_dev_addr,
                                      uint64_t size,
                                      uint64_t alignment,
                                      struct pvr_winsys_vma **vma_out);

Reply via email to