anv: Handle errors properly in anv_i915_query
authorJason Ekstrand <jason@jlekstrand.net>
Wed, 7 Jul 2021 19:21:58 +0000 (14:21 -0500)
committerMarge Bot <eric+marge@anholt.net>
Fri, 16 Jul 2021 14:19:20 +0000 (14:19 +0000)
commitb664481ba91603d69b294ca5b1243e42c86a5863
tree09645efa891f64c07af48bd5e036b20d3f039d48
parentd07e5bde751a7f85ded96b35660075d8f782b49c
anv: Handle errors properly in anv_i915_query

DRM_IOCTL_I915_QUERY is a multi-query.  The most egregious errors are
returned via the usual ioctl error mechanism but there are also
per-query errors that are indicated by item.length < 0.  We need to
handle those as well.  While we're at it, scrape errno so we can return
a proper integer error.

Fixes: c0d07c838a9f "anv: Support i915 query (DRM_IOCTL_I915_QUERY)..."
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11770>
src/intel/vulkan/anv_gem.c