Mesa (staging/20.3): lavapipe: fix missing piece of VK_KHR_get_physical_device_properties2

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jan 19 17:49:23 UTC 2021


Module: Mesa
Branch: staging/20.3
Commit: 0aa060c5b41a57cecc39cff7b8a9f611c95958ca
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0aa060c5b41a57cecc39cff7b8a9f611c95958ca

Author: Dave Airlie <airlied at gmail.com>
Date:   Fri Jan 15 09:57:52 2021 +1000

lavapipe: fix missing piece of VK_KHR_get_physical_device_properties2

I missed two parts of the APIs for this, so add them, should fix
crashes in gstreamer vulkan when it tries to load lvp.

Cc: <mesa-stable at lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3989
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8511>
(cherry picked from commit 7b48d5d36e0177a9346b75af6f41031e4c7b1220)

---

 .pick_status.json                           |  2 +-
 src/gallium/frontends/lavapipe/lvp_device.c | 43 +++++++++++++++++++++++------
 2 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index b17ff958b2e..eea25adad9c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -796,7 +796,7 @@
         "description": "lavapipe: fix missing piece of VK_KHR_get_physical_device_properties2",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c
index 514a64f3287..187aecde1f8 100644
--- a/src/gallium/frontends/lavapipe/lvp_device.c
+++ b/src/gallium/frontends/lavapipe/lvp_device.c
@@ -573,6 +573,19 @@ void lvp_GetPhysicalDeviceProperties2(
    }
 }
 
+static void lvp_get_physical_device_queue_family_properties(
+   VkQueueFamilyProperties*                    pQueueFamilyProperties)
+{
+   *pQueueFamilyProperties = (VkQueueFamilyProperties) {
+      .queueFlags = VK_QUEUE_GRAPHICS_BIT |
+      VK_QUEUE_COMPUTE_BIT |
+      VK_QUEUE_TRANSFER_BIT,
+      .queueCount = 1,
+      .timestampValidBits = 64,
+      .minImageTransferGranularity = (VkExtent3D) { 1, 1, 1 },
+   };
+}
+
 void lvp_GetPhysicalDeviceQueueFamilyProperties(
    VkPhysicalDevice                            physicalDevice,
    uint32_t*                                   pCount,
@@ -584,15 +597,21 @@ void lvp_GetPhysicalDeviceQueueFamilyProperties(
    }
 
    assert(*pCount >= 1);
+   lvp_get_physical_device_queue_family_properties(pQueueFamilyProperties);
+}
 
-   *pQueueFamilyProperties = (VkQueueFamilyProperties) {
-      .queueFlags = VK_QUEUE_GRAPHICS_BIT |
-      VK_QUEUE_COMPUTE_BIT |
-      VK_QUEUE_TRANSFER_BIT,
-      .queueCount = 1,
-      .timestampValidBits = 64,
-      .minImageTransferGranularity = (VkExtent3D) { 1, 1, 1 },
-   };
+void lvp_GetPhysicalDeviceQueueFamilyProperties2(
+   VkPhysicalDevice                            physicalDevice,
+   uint32_t*                                   pCount,
+   VkQueueFamilyProperties2                   *pQueueFamilyProperties)
+{
+   if (pQueueFamilyProperties == NULL) {
+      *pCount = 1;
+      return;
+   }
+
+   assert(*pCount >= 1);
+   lvp_get_physical_device_queue_family_properties(&pQueueFamilyProperties->queueFamilyProperties);
 }
 
 void lvp_GetPhysicalDeviceMemoryProperties(
@@ -615,6 +634,14 @@ void lvp_GetPhysicalDeviceMemoryProperties(
    };
 }
 
+void lvp_GetPhysicalDeviceMemoryProperties2(
+   VkPhysicalDevice                            physicalDevice,
+   VkPhysicalDeviceMemoryProperties2          *pMemoryProperties)
+{
+   lvp_GetPhysicalDeviceMemoryProperties(physicalDevice,
+                                         &pMemoryProperties->memoryProperties);
+}
+
 PFN_vkVoidFunction lvp_GetInstanceProcAddr(
    VkInstance                                  _instance,
    const char*                                 pName)



More information about the mesa-commit mailing list