Mesa (main): venus: query experimental features in one call

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 3 20:46:15 UTC 2021


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

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Thu Jun  3 13:05:30 2021 -0700

venus: query experimental features in one call

It is simpler.  But I mainly want to work around

../src/virtio/vulkan/vn_cs.h:173:4: error: argument 1 null where non-null expected [-Werror=nonnull]
  173 |    memcpy(val, dec->cur, val_size);

We trust virglrenderer and it never instructs the decoder to memcpy to
pData when it is NULL.  The compiler does not know however.  A proper
fix will be to generate

  if (!pData)
    unreachable();

to help the compiler.

Signed-off-by: Chia-I Wu <olvaffe at gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11174>

---

 src/virtio/vulkan/vn_device.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/src/virtio/vulkan/vn_device.c b/src/virtio/vulkan/vn_device.c
index 6ef024c87a6..7cf98a21c27 100644
--- a/src/virtio/vulkan/vn_device.c
+++ b/src/virtio/vulkan/vn_device.c
@@ -1898,10 +1898,7 @@ vn_CreateInstance(const VkInstanceCreateInfo *pCreateInfo,
 
    if (instance->renderer_info.vk_mesa_venus_protocol_spec_version ==
        100000) {
-      size_t size = 0;
-      vn_call_vkGetVenusExperimentalFeatureData100000MESA(instance, &size,
-                                                          NULL);
-      size = MIN2(size, sizeof(instance->experimental));
+      size_t size = sizeof(instance->experimental);
       vn_call_vkGetVenusExperimentalFeatureData100000MESA(
          instance, &size, &instance->experimental);
    }



More information about the mesa-commit mailing list