[Mesa-dev] [PATCH] anv/device: Return DEVICE_LOST if execbuf2 fails

Anuj Phogat anuj.phogat at gmail.com
Tue Nov 1 18:06:40 UTC 2016


On Mon, Oct 31, 2016 at 9:53 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
> This makes more sense than OUT_OF_HOST_MEMORY.  Technically, you can
> recover from a failed execbuf2 but the batch you just submitted didn't
> fully execute so things are in an ill-defined state.  The app doesn't want
> to continue from that point anyway.
> ---
>  src/intel/vulkan/anv_device.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index c995630..37615ef 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -812,7 +812,7 @@ anv_device_submit_simple_batch(struct anv_device *device,
>     ret = anv_gem_execbuffer(device, &execbuf);
>     if (ret != 0) {
>        /* We don't know the real error. */
> -      result = vk_errorf(VK_ERROR_OUT_OF_DEVICE_MEMORY, "execbuf2 failed: %m");
> +      result = vk_errorf(VK_ERROR_DEVICE_LOST, "execbuf2 failed: %m");
>        goto fail;
>     }
>
> @@ -820,7 +820,7 @@ anv_device_submit_simple_batch(struct anv_device *device,
>     ret = anv_gem_wait(device, bo.gem_handle, &timeout);
>     if (ret != 0) {
>        /* We don't know the real error. */
> -      result = vk_errorf(VK_ERROR_OUT_OF_DEVICE_MEMORY, "execbuf2 failed: %m");
> +      result = vk_errorf(VK_ERROR_DEVICE_LOST, "execbuf2 failed: %m");
>        goto fail;
>     }
>
> @@ -1090,8 +1090,7 @@ VkResult anv_QueueSubmit(
>           ret = anv_gem_execbuffer(device, &cmd_buffer->execbuf2.execbuf);
>           if (ret != 0) {
>              /* We don't know the real error. */
> -            return vk_errorf(VK_ERROR_OUT_OF_DEVICE_MEMORY,
> -                             "execbuf2 failed: %m");
> +            return vk_errorf(VK_ERROR_DEVICE_LOST, "execbuf2 failed: %m");
>           }
>
>           for (uint32_t k = 0; k < cmd_buffer->execbuf2.bo_count; k++)
> @@ -1103,8 +1102,7 @@ VkResult anv_QueueSubmit(
>        ret = anv_gem_execbuffer(device, &fence->execbuf);
>        if (ret != 0) {
>           /* We don't know the real error. */
> -         return vk_errorf(VK_ERROR_OUT_OF_DEVICE_MEMORY,
> -                          "execbuf2 failed: %m");
> +         return vk_errorf(VK_ERROR_DEVICE_LOST, "execbuf2 failed: %m");
>        }
>     }
>
> --
> 2.5.0.400.gff86faf
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the mesa-dev mailing list