Skip to content

Commit

Permalink
anv/android: Add support for missing AHB Format
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Aakash-Sarkar authored and JeevakaPrabu committed Dec 18, 2024
1 parent 60a899f commit 0210ccd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/intel/vulkan/anv_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ anv_hal_close(struct hw_device_t *dev)
#include <vndk/hardware_buffer.h>
/* 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 */
Expand All @@ -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;
Expand Down

0 comments on commit 0210ccd

Please sign in to comment.