anv: allow NV12 <--> AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 inter-op
authorGurchetan Singh <gurchetansingh@chromium.org>
Wed, 5 Jun 2019 16:51:07 +0000 (09:51 -0700)
committerGurchetan Singh <gurchetansingh@chromium.org>
Thu, 6 Jun 2019 16:20:03 +0000 (09:20 -0700)
commit110f139f98f1786f592ebe05385a7be04fdc5bf4
tree74c2dfcfa72262889d1d89b31cc9cc86b8a67bde
parent9d93d2a4049c0635e75c8eff85c8be7603599340
anv: allow NV12 <--> AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 inter-op

AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 is an implementation defined
flexible YUV format.  Most of the times, it's NV12 or YV12.
On Intel, NV12 is preferred since it can be used by the display
engine.  

This API adds a dependency between gralloc and buffer consumers,
unfortunately.  Right now, the code seems to work for i915 gralloc,
but not cros_gralloc.  Add a preprocessor flag to fix this.

TEST=android.graphics.cts.MediaVulkanGpuTest#testMediaImportAndRendering

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/intel/vulkan/vk_format_info.h