From 76add79bb77ae3e0f57b447176e2d52ece36be94 Mon Sep 17 00:00:00 2001 From: Aakash Sarkar Date: Wed, 18 Dec 2024 06:33:54 +0000 Subject: [PATCH] anv/android: Add support for missing AHB Format This patch adds the support for AHB to Vulkan format conversion for the pixel format: HAL_PIXEL_FORMAT_NV12_LINEAR_CAMERA_INTEL (271). It is needed to fix the video playback crash seen while enabling ANGLE as the OpenGL ES driver with Vulkan as the backend. Crash Log: 501 517 F libc : Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 517 (RenderEngine), pid 501 (surfaceflinger) 2774 2774 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 2774 2774 F DEBUG : Build fingerprint: 'intel/caas/caas:15/AP3A.241005.015.A2/eng.celado.00000000.000000:userdebug/test-keys' 2774 2774 F DEBUG : Revision: '0' 2774 2774 F DEBUG : ABI: 'x86_64' 2774 2774 F DEBUG : Timestamp: 2024-12-10 09:23:54.284397411+0000 2774 2774 F DEBUG : Process uptime: 208s 2774 2774 F DEBUG : Cmdline: /system/bin/surfaceflinger 2774 2774 F DEBUG : pid: 501, tid: 517, name: RenderEngine >>> /system/bin/surfaceflinger <<< 2774 2774 F DEBUG : uid: 1000 2774 2774 F DEBUG : signal 6 (SIGABRT), code -1 (SI_QUEUE), fault addr -------- 2774 2774 F DEBUG : Abort message: 'Failed to create a valid texture. [0x71010801e090]:[848,480] isProtected:0 isWriteable:0 format:271' 2774 2774 F DEBUG : rax 0000000000000000 rbx 0000710087a941e8 rcx 0000710318a66b4e rdx 0000000000000006 2774 2774 F DEBUG : r8 0000710087a94f40 r9 0000710087a94f40 r10 0000710087a941f0 r11 0000000000000207 2774 2774 F DEBUG : r12 0000710087a94810 r13 0000000000000000 r14 00000000000001f5 r15 0000000000000205 2774 2774 F DEBUG : rdi 00000000000001f5 rsi 0000000000000205 2774 2774 F DEBUG : rbp 0000000000000000 rsp 0000710087a941e0 rip 0000710318a66b4e Tests done: - Android boot with angle and vulkan as backend - Video playback working correctly - Gallery app is not showing any visual artifacts Tracked-On: OAM-126014 Signed-off-by: Aakash Sarkar --- src/intel/vulkan/anv_android.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c index 932d88ce48b..e706fcbe2ce 100644 --- a/src/intel/vulkan/anv_android.c +++ b/src/intel/vulkan/anv_android.c @@ -104,6 +104,7 @@ anv_hal_close(struct hw_device_t *dev) #include /* See i915_private_android_types.h in minigbm. */ #define HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL 0x100 +#define HAL_PIXEL_FORMAT_NV12_LINEAR_CAMERA_INTEL 0x10F enum { /* Usage bit equal to GRALLOC_USAGE_HW_CAMERA_MASK */ @@ -116,6 +117,7 @@ vk_format_from_android(unsigned android_format, unsigned android_usage) switch (android_format) { case AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420: case HAL_PIXEL_FORMAT_NV12_Y_TILED_INTEL: + case HAL_PIXEL_FORMAT_NV12_LINEAR_CAMERA_INTEL: return VK_FORMAT_G8_B8R8_2PLANE_420_UNORM; case AHARDWAREBUFFER_FORMAT_YV12: return VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM;