diff options
author | Nataraj Deshpande <[email protected]> | 2019-06-11 08:01:50 -0700 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2019-06-24 08:28:18 +0300 |
commit | d94fca54203edc0b7fece6aa2dc8703ad4e93c79 (patch) | |
tree | 298f0f813200bb3b12aa0d16ea14be6848e5bb42 /src/intel/vulkan/anv_android.c | |
parent | 3b6d787e404181758227e205eda03600b25c1fd9 (diff) |
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: f1654fa7e31 "anv/android: support creating images from external format"
Signed-off-by: Nataraj Deshpande <[email protected]>
Signed-off-by: Gurchetan Singh <[email protected]>
Signed-off-by: Tapani Pälli <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Acked-by: Lionel Landwerlin <[email protected]>
Acked-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_android.c')
-rw-r--r-- | src/intel/vulkan/anv_android.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |