From e60f44b965e8c1753d9b4caa687130887da0242b Mon Sep 17 00:00:00 2001 From: Vitor Sato Eschholz Date: Mon, 7 Mar 2022 16:53:54 +0000 Subject: [PATCH] android: Remove discontiguous planes check from camera buffer The way discontiguous planes are checked in generic_camera_buffer ignores that they can be placed in the same dmabuf. This is the case for AM62x boards, where multiplanar formats are stored continuously in the memory and referenced through only one File Descriptor. Remove the check from generic_camera_buffer.cpp to allow the creation of CameraBuffers for AM62x boards. The verification for discontiguous planes are done in v4l2_videodevice.cpp. Signed-off-by: Vitor Sato Eschholz Signed-off-by: Mattijs Korpershoek --- src/android/mm/generic_camera_buffer.cpp | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/android/mm/generic_camera_buffer.cpp b/src/android/mm/generic_camera_buffer.cpp index 0ffcb445..072d1182 100644 --- a/src/android/mm/generic_camera_buffer.cpp +++ b/src/android/mm/generic_camera_buffer.cpp @@ -70,23 +70,7 @@ CameraBuffer::Private::Private([[maybe_unused]] CameraBuffer *cameraBuffer, return; } - /* - * As Android doesn't offer an API to query buffer layouts, assume for - * now that the buffer is backed by a single dmabuf, with planes being - * stored contiguously. - */ - for (int i = 0; i < camera3Buffer->numFds; i++) { - if (camera3Buffer->data[i] == -1 || camera3Buffer->data[i] == fd_) - continue; - - if (fd_ != -1) { - error_ = -EINVAL; - LOG(HAL, Error) << "Discontiguous planes are not supported"; - return; - } - - fd_ = camera3Buffer->data[i]; - } + fd_ = camera3Buffer->data[0]; if (fd_ == -1) { error_ = -EINVAL;