mesa/src/intel
Jason Ekstrand 49908c602f anv/android: Rework our handling of AHardwareBuffer imports
The current code we have for this is a bit of a mess, likely due to
trying too hard to put it in anv_android.c.  The external_format bit in
anv_image, for instance, really means "quit creation early" which is
something we want to do for AHardwareBuffer imports regardless of
whether or not they use a native format.  It gets set both by declaring
an AHardwareBuffer external handle type and by VkExternalFormatANDROID.
However, VkExternalFormatANDROID is only allowed for AHardwareBuffer
imports.  If we ever did get an external format outside the context of
an AHardwareBuffer import, we would end up with a useless partially
created image.

When we detect an AHardwareBuffer import, we punt off to a function in
anv_android.c that does nothing interesting but call anv_create_image
with AUX disabled and external_format = true.  The aux disable here is
useless because the actual isl_surf layout is done by resolve_ahw_image
which also sets ISL_SURF_USAGE_DISABLE_AUX_BIT.  As far as external
formats go, anv_image_from_external() sets it regardless of whether or
not there is actually an external format.

This commit replaces anv_image::external_format with anv_image::from_ahb
which is the thing we actually want to track for this.  We delete
anv_image_from_external and a bunch of the external_format handling
because it's all useless.  The end result is massively simpler and,
while it appears to blur the boundary between Android code and the rest
of the driver, it makes the whole flow more obvious.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12040>
2021-07-27 14:45:28 +00:00
..
blorp intel/blorp: Use nir_texop_txl 2021-07-23 15:53:57 +00:00
common intel/tools/aubinator_error_decode: tag hanging instruction 2021-07-21 08:20:06 +00:00
compiler nir/lower_tex: Rework invalid implicit LOD lowering 2021-07-23 15:53:57 +00:00
dev intel/dev: Use intel_i915_query_alloc in query_topology 2021-07-16 14:19:20 +00:00
ds pps: fix a missing include in Intel pps driver 2021-05-21 22:03:16 +00:00
genxml anv: fix some multisample lines_wide CTS tests 2021-07-15 17:07:35 +00:00
isl isl: fix mapping of format->stringname 2021-07-26 07:16:28 +00:00
nullhw-layer intel/nullhw: fix build 2021-03-26 20:12:40 +00:00
perf intel/perf: Use intel_i915_query_flags instead of hand-rolling it 2021-07-16 14:19:20 +00:00
tools intel/tools/aubinator_error_decode: tag hanging instruction 2021-07-21 08:20:06 +00:00
vulkan anv/android: Rework our handling of AHardwareBuffer imports 2021-07-27 14:45:28 +00:00
Makefile.perf.am intel: Rename GEN_PERF prefix to INTEL_PERF in build files 2021-04-20 20:06:34 +00:00
meson.build pps: Intel pps driver 2021-05-18 14:28:48 +00:00