From 1450e09a0839d6ffa90abeede0bb1c959167eaab Mon Sep 17 00:00:00 2001 From: Mattijs Korpershoek Date: Mon, 29 May 2023 15:30:17 +0200 Subject: android: mm: generic: use GRALLOC_HARDWARE_MODULE_ID PlatformFrameBufferAllocator is an abstraction over gralloc. Right now hardwareModule_ points towards a CAMERA_HARDWARE_MODULE_ID. When gralloc_open() is called we observe: libcamera: DEBUG HAL camera3_hal.cpp:75 Open camera gpu0 libcamera: ERROR Camera camera.cpp:524 Camera in Configured state trying acquire() requiring state Available 01-23 14:14:04.742 370 416 E libcamera: FATAL HAL generic_frame_buffer_allocator.cpp:105 gralloc_open() failed: -87 Which is wrong, gralloc_open() is attempting to re-open the camera HAL, instead of the gralloc HAL. Point to a GRALLOC_HARDWARE_MODULE_ID instead so that we can request buffers from gralloc in android. Note: this adds new dependencies on android's libhardware [1] and on libdl. [1] https://android.googlesource.com/platform/hardware/libhardware Fixes: c58662c5770e ("android: Introduce PlatformFrameBufferAllocator") Signed-off-by: Mattijs Korpershoek Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Laurent Pinchart --- src/android/mm/meson.build | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/android/mm/meson.build') diff --git a/src/android/mm/meson.build b/src/android/mm/meson.build index d40a3b0b..85f12f91 100644 --- a/src/android/mm/meson.build +++ b/src/android/mm/meson.build @@ -4,6 +4,10 @@ platform = get_option('android_platform') if platform == 'generic' android_hal_sources += files(['generic_camera_buffer.cpp', 'generic_frame_buffer_allocator.cpp']) + android_deps += [ + libdl, + dependency('libhardware'), + ] elif platform == 'cros' android_hal_sources += files(['cros_camera_buffer.cpp', 'cros_frame_buffer_allocator.cpp']) -- cgit v1.2.1