anv: Add HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED in vk_format
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: f1654fa7e3
"anv/android: support creating images from external format"
Signed-off-by: Nataraj Deshpande <nataraj.deshpande@intel.com>
Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:

committed by
Tapani Pälli

parent
3b6d787e40
commit
d94fca5420
@@ -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;
|
||||
|
Reference in New Issue
Block a user