From d94fca54203edc0b7fece6aa2dc8703ad4e93c79 Mon Sep 17 00:00:00 2001 From: Nataraj Deshpande Date: Tue, 11 Jun 2019 08:01:50 -0700 Subject: anv: Add HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED in vk_format MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED is used, then the platform gralloc module will select a format based on the usage flags provided by the camera device and the other endpoint of the stream. The patch fixes crash in vulkan when the test is run with camera stream set to HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED. Test: android.graphics.cts.CameraVulkanGpuTest#testCameraImportAndRendering on chromebook with camera HAL3. v2: use AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED and take AHARDWAREBUFFER_USAGE_CAMERA_MASK in to account (Gurchetan) Fixes: f1654fa7e31 "anv/android: support creating images from external format" Signed-off-by: Nataraj Deshpande Signed-off-by: Gurchetan Singh Signed-off-by: Tapani Pälli Reviewed-by: Tapani Pälli Reviewed-by: Gurchetan Singh Acked-by: Lionel Landwerlin Acked-by: Jason Ekstrand --- src/intel/vulkan/anv_android.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/intel/vulkan/anv_android.c') diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c index aee11ccacd2..8c785323d36 100644 --- a/src/intel/vulkan/anv_android.c +++ b/src/intel/vulkan/anv_android.c @@ -126,7 +126,7 @@ get_ahw_buffer_format_properties( /* Fill properties fields based on description. */ VkAndroidHardwareBufferFormatPropertiesANDROID *p = pProperties; - p->format = vk_format_from_android(desc.format); + p->format = vk_format_from_android(desc.format, desc.usage); const struct anv_format *anv_format = anv_get_format(p->format); p->externalFormat = (uint64_t) (uintptr_t) anv_format; -- cgit v1.2.3