anv: Add HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED in vk_format
authorNataraj Deshpande <nataraj.deshpande@intel.com>
Tue, 11 Jun 2019 15:01:50 +0000 (08:01 -0700)
committerTapani Pälli <tapani.palli@intel.com>
Mon, 24 Jun 2019 05:28:18 +0000 (08:28 +0300)
commitd94fca54203edc0b7fece6aa2dc8703ad4e93c79
tree298f0f813200bb3b12aa0d16ea14be6848e5bb42
parent3b6d787e404181758227e205eda03600b25c1fd9
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 <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>
src/intel/vulkan/anv_android.c
src/intel/vulkan/anv_image.c
src/intel/vulkan/vk_format_info.h