Mesa (main): pvr: Add transfer 3d parameter heap support.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jun 7 14:02:37 UTC 2022


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

Author: Rajnesh Kanwal <rajnesh.kanwal at imgtec.com>
Date:   Mon May 16 14:52:13 2022 +0100

pvr: Add transfer 3d parameter heap support.

Signed-off-by: Rajnesh Kanwal <rajnesh.kanwal at imgtec.com>
Reviewed-by: Frank Binns <frank.binns at imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16897>

---

 src/imagination/vulkan/winsys/pvr_winsys.h       |  1 +
 src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c | 29 ++++++++++++++++++++++--
 src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h |  4 +++-
 3 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/src/imagination/vulkan/winsys/pvr_winsys.h b/src/imagination/vulkan/winsys/pvr_winsys.h
index de287cac389..9cb5bda4c07 100644
--- a/src/imagination/vulkan/winsys/pvr_winsys.h
+++ b/src/imagination/vulkan/winsys/pvr_winsys.h
@@ -56,6 +56,7 @@ struct pvr_winsys_heaps {
    struct pvr_winsys_heap *general_heap;
    struct pvr_winsys_heap *pds_heap;
    struct pvr_winsys_heap *rgn_hdr_heap;
+   struct pvr_winsys_heap *transfer_3d_heap;
    struct pvr_winsys_heap *usc_heap;
    struct pvr_winsys_heap *vis_test_heap;
 };
diff --git a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c
index 6974180a1a9..2d298e15bf4 100644
--- a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c
+++ b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.c
@@ -128,6 +128,7 @@ static VkResult pvr_srv_memctx_init(struct pvr_srv_winsys *srv_ws)
    const struct pvr_winsys_static_data_offsets no_static_data_offsets = { 0 };
 
    char heap_name[PVR_SRV_DEVMEM_HEAPNAME_MAXLENGTH];
+   int transfer_3d_heap_idx = -1;
    int vis_test_heap_idx = -1;
    int general_heap_idx = -1;
    int rgn_hdr_heap_idx = -1;
@@ -178,6 +179,11 @@ static VkResult pvr_srv_memctx_init(struct pvr_srv_winsys *srv_ws)
                          PVR_SRV_RGNHDR_BRN_63142_HEAP_IDENT,
                          sizeof(PVR_SRV_RGNHDR_BRN_63142_HEAP_IDENT)) == 0) {
          rgn_hdr_heap_idx = i;
+      } else if (transfer_3d_heap_idx == -1 &&
+                 strncmp(heap_name,
+                         PVR_SRV_TRANSFER_3D_HEAP_IDENT,
+                         sizeof(PVR_SRV_TRANSFER_3D_HEAP_IDENT)) == 0) {
+         transfer_3d_heap_idx = i;
       } else if (usc_heap_idx == -1 &&
                  strncmp(heap_name,
                          PVR_SRV_USCCODE_HEAP_IDENT,
@@ -192,7 +198,8 @@ static VkResult pvr_srv_memctx_init(struct pvr_srv_winsys *srv_ws)
    }
 
    /* Check for and initialise required heaps. */
-   if (general_heap_idx == -1 || pds_heap_idx == -1 || usc_heap_idx == -1 ||
+   if (general_heap_idx == -1 || pds_heap_idx == -1 ||
+       transfer_3d_heap_idx == -1 || usc_heap_idx == -1 ||
        vis_test_heap_idx == -1) {
       result = vk_error(NULL, VK_ERROR_INITIALIZATION_FAILED);
       goto err_pvr_srv_int_ctx_destroy;
@@ -212,12 +219,19 @@ static VkResult pvr_srv_memctx_init(struct pvr_srv_winsys *srv_ws)
    if (result != VK_SUCCESS)
       goto err_pvr_srv_heap_finish_general;
 
+   result = pvr_srv_heap_init(srv_ws,
+                              &srv_ws->transfer_3d_heap,
+                              transfer_3d_heap_idx,
+                              &no_static_data_offsets);
+   if (result != VK_SUCCESS)
+      goto err_pvr_srv_heap_finish_pds;
+
    result = pvr_srv_heap_init(srv_ws,
                               &srv_ws->usc_heap,
                               usc_heap_idx,
                               &usc_heap_static_data_offsets);
    if (result != VK_SUCCESS)
-      goto err_pvr_srv_heap_finish_pds;
+      goto err_pvr_srv_heap_finish_transfer_3d;
 
    result = pvr_srv_heap_init(srv_ws,
                               &srv_ws->vis_test_heap,
@@ -234,6 +248,7 @@ static VkResult pvr_srv_memctx_init(struct pvr_srv_winsys *srv_ws)
                                  &no_static_data_offsets);
       if (result != VK_SUCCESS)
          goto err_pvr_srv_heap_finish_vis_test;
+
       srv_ws->rgn_hdr_heap_present = true;
    } else {
       srv_ws->rgn_hdr_heap_present = false;
@@ -275,6 +290,9 @@ err_pvr_srv_heap_finish_vis_test:
 err_pvr_srv_heap_finish_usc:
    pvr_srv_heap_finish(srv_ws, &srv_ws->usc_heap);
 
+err_pvr_srv_heap_finish_transfer_3d:
+   pvr_srv_heap_finish(srv_ws, &srv_ws->transfer_3d_heap);
+
 err_pvr_srv_heap_finish_pds:
    pvr_srv_heap_finish(srv_ws, &srv_ws->pds_heap);
 
@@ -310,6 +328,12 @@ static void pvr_srv_memctx_finish(struct pvr_srv_winsys *srv_ws)
    if (!pvr_srv_heap_finish(srv_ws, &srv_ws->usc_heap))
       vk_errorf(NULL, VK_ERROR_UNKNOWN, "USC heap in use, can not deinit");
 
+   if (!pvr_srv_heap_finish(srv_ws, &srv_ws->transfer_3d_heap)) {
+      vk_errorf(NULL,
+                VK_ERROR_UNKNOWN,
+                "Transfer 3D heap in use, can not deinit");
+   }
+
    if (!pvr_srv_heap_finish(srv_ws, &srv_ws->pds_heap))
       vk_errorf(NULL, VK_ERROR_UNKNOWN, "PDS heap in use, can not deinit");
 
@@ -392,6 +416,7 @@ static void pvr_srv_winsys_get_heaps_info(struct pvr_winsys *ws,
 
    heaps->general_heap = &srv_ws->general_heap.base;
    heaps->pds_heap = &srv_ws->pds_heap.base;
+   heaps->transfer_3d_heap = &srv_ws->transfer_3d_heap.base;
    heaps->usc_heap = &srv_ws->usc_heap.base;
    heaps->vis_test_heap = &srv_ws->vis_test_heap.base;
 
diff --git a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h
index 2f5475c2493..2f9aae8ff95 100644
--- a/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h
+++ b/src/imagination/vulkan/winsys/pvrsrvkm/pvr_srv.h
@@ -42,8 +42,9 @@
 #define PVR_SRV_DEVMEM_HEAPNAME_MAXLENGTH 160
 
 #define PVR_SRV_GENERAL_HEAP_IDENT "General"
-#define PVR_SRV_RGNHDR_BRN_63142_HEAP_IDENT "RgnHdr BRN63142"
 #define PVR_SRV_PDSCODEDATA_HEAP_IDENT "PDS Code and Data"
+#define PVR_SRV_RGNHDR_BRN_63142_HEAP_IDENT "RgnHdr BRN63142"
+#define PVR_SRV_TRANSFER_3D_HEAP_IDENT "TQ3DParameters"
 #define PVR_SRV_USCCODE_HEAP_IDENT "USC Code"
 #define PVR_SRV_VISIBILITY_TEST_HEAP_IDENT "Visibility Test"
 
@@ -81,6 +82,7 @@ struct pvr_srv_winsys {
    /* Required heaps */
    struct pvr_srv_winsys_heap general_heap;
    struct pvr_srv_winsys_heap pds_heap;
+   struct pvr_srv_winsys_heap transfer_3d_heap;
    struct pvr_srv_winsys_heap usc_heap;
    struct pvr_srv_winsys_heap vis_test_heap;
 



More information about the mesa-commit mailing list