summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan
diff options
context:
space:
mode:
authorGurchetan Singh <[email protected]>2019-06-05 09:51:07 -0700
committerGurchetan Singh <[email protected]>2019-06-06 09:20:03 -0700
commit110f139f98f1786f592ebe05385a7be04fdc5bf4 (patch)
tree74c2dfcfa72262889d1d89b31cc9cc86b8a67bde /src/intel/vulkan
parent9d93d2a4049c0635e75c8eff85c8be7603599340 (diff)
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 <[email protected]>
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r--src/intel/vulkan/vk_format_info.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/intel/vulkan/vk_format_info.h b/src/intel/vulkan/vk_format_info.h
index 2e126645763..1369f54ee38 100644
--- a/src/intel/vulkan/vk_format_info.h
+++ b/src/intel/vulkan/vk_format_info.h
@@ -47,6 +47,7 @@ vk_format_from_android(unsigned android_format)
return VK_FORMAT_R16G16B16A16_SFLOAT;
case AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM:
return VK_FORMAT_A2B10G10R10_UNORM_PACK32;
+ case AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420:
case HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL:
return VK_FORMAT_G8_B8R8_2PLANE_420_UNORM;
case AHARDWAREBUFFER_FORMAT_BLOB:
@@ -70,7 +71,11 @@ android_format_from_vk(unsigned vk_format)
case VK_FORMAT_A2B10G10R10_UNORM_PACK32:
return AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM;
case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:
+#ifdef HAVE_CROS_GRALLOC
+ return AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420;
+#else
return HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL;
+#endif
default:
return AHARDWAREBUFFER_FORMAT_BLOB;
}