turnip/kgsl: Add strerror decode in BO init failure.
authorEric Anholt <eric@anholt.net>
Tue, 22 Sep 2020 18:28:02 +0000 (11:28 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 5 Oct 2020 22:42:14 +0000 (22:42 +0000)
Just covering more of the error paths.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7014>

src/freedreno/vulkan/tu_kgsl.c

index 6287e39..c85b157 100644 (file)
@@ -89,8 +89,10 @@ tu_bo_init_new(struct tu_device *dev, struct tu_bo *bo, uint64_t size, bool dump
 
    ret = safe_ioctl(dev->physical_device->local_fd,
                     IOCTL_KGSL_GPUMEM_ALLOC_ID, &req);
-   if (ret)
-      return vk_error(dev->instance, VK_ERROR_OUT_OF_DEVICE_MEMORY);
+   if (ret) {
+      return vk_errorf(dev->instance, VK_ERROR_OUT_OF_DEVICE_MEMORY,
+                       "GPUMEM_ALLOC_ID failed (%s)", strerror(errno));
+   }
 
    *bo = (struct tu_bo) {
       .gem_handle = req.id,