[{"id":27864,"web_url":"https://patchwork.libcamera.org/comment/27864/","msgid":"<20230924161844.GE13101@pendragon.ideasonboard.com>","date":"2023-09-24T16:18:44","subject":"Re: [libcamera-devel] [PATCH v3 4/4] android: mm: generic: Use\n\tGraphicBufferAllocator instead of gralloc.h","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Mattijs,\n\nThank you for the patch.\n\nOn Sat, Sep 23, 2023 at 06:23:34PM +0200, Mattijs Korpershoek via libcamera-devel wrote:\n> gralloc.h is a very old API that has been deprecated at least since\n> Android P (9).\n\nIt's interesting that the latest versions of camera.h and\ncamera_common.h still include gralloc.h. I suppose that's because those\nheaders are deprecated too, we should implement the HIDL version of the\ncamera HAL API. This will be interesting development, especially when\ncompiling against the VNDK and not as part of AOSP.\n\n> Switch over to a higher level abstraction of gralloc from libui, which\n> is compatible with Android 11 and up.\n> Libui:\n> * is provided in the VNDK (so it's available to vendors).\n> * is also used in the camera vts test named VtsAidlHalCameraProvider_TargetTest.\n> \n> Drop the libhardware stub since we no longer need it.\n> \n> Notes:\n> * GraphicsBufferAllocator being a Singleton, buffer lifecycle\n>   management is easier.\n> * The imported headers from Android generate the -Wextra-semi warning.\n>   To avoid patching the files, a pragma has been added before inclusion.\n> \n> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  src/android/mm/generic_frame_buffer_allocator.cpp | 68 ++++++++---------------\n>  src/android/mm/libhardware_stub.c                 | 17 ------\n>  src/android/mm/meson.build                        |  8 ---\n>  3 files changed, 22 insertions(+), 71 deletions(-)\n> \n> diff --git a/src/android/mm/generic_frame_buffer_allocator.cpp b/src/android/mm/generic_frame_buffer_allocator.cpp\n> index 7ecef2c669df..1f2fbe334f2c 100644\n> --- a/src/android/mm/generic_frame_buffer_allocator.cpp\n> +++ b/src/android/mm/generic_frame_buffer_allocator.cpp\n> @@ -16,8 +16,11 @@\n>  #include \"libcamera/internal/framebuffer.h\"\n>  \n>  #include <hardware/camera3.h>\n> -#include <hardware/gralloc.h>\n> -#include <hardware/hardware.h>\n> +#pragma GCC diagnostic push\n> +#pragma GCC diagnostic ignored \"-Wextra-semi\"\n> +#include <ui/GraphicBufferAllocator.h>\n> +#pragma GCC diagnostic pop\n> +#include <utils/Errors.h>\n>  \n>  #include \"../camera_device.h\"\n>  #include \"../frame_buffer_allocator.h\"\n> @@ -33,35 +36,26 @@ class GenericFrameBufferData : public FrameBuffer::Private\n>  \tLIBCAMERA_DECLARE_PUBLIC(FrameBuffer)\n>  \n>  public:\n> -\tGenericFrameBufferData(struct alloc_device_t *allocDevice,\n> -\t\t\t       buffer_handle_t handle,\n> +\tGenericFrameBufferData(buffer_handle_t handle,\n>  \t\t\t       const std::vector<FrameBuffer::Plane> &planes)\n> -\t\t: FrameBuffer::Private(planes), allocDevice_(allocDevice),\n> -\t\t  handle_(handle)\n> +\t\t: FrameBuffer::Private(planes), handle_(handle)\n>  \t{\n> -\t\tASSERT(allocDevice_);\n>  \t\tASSERT(handle_);\n>  \t}\n>  \n>  \t~GenericFrameBufferData() override\n>  \t{\n>  \t\t/*\n> -\t\t * allocDevice_ is used to destroy handle_. allocDevice_ is\n> -\t\t * owned by PlatformFrameBufferAllocator::Private.\n> -\t\t * GenericFrameBufferData must be destroyed before it is\n> -\t\t * destroyed.\n> -\t\t *\n> -\t\t * \\todo Consider managing alloc_device_t with std::shared_ptr\n> -\t\t * if this is difficult to maintain.\n> -\t\t *\n>  \t\t * \\todo Thread safety against alloc_device_t is not documented.\n\nThis comment needs to be updated, or removed if GraphicBufferAllocator\nis thread-safe.\n\n>  \t\t * Is it no problem to call alloc/free in parallel?\n>  \t\t */\n> -\t\tallocDevice_->free(allocDevice_, handle_);\n> +\t\tauto &allocator = android::GraphicBufferAllocator::get();\n\nPlease indicate the type explicitly, auto hinders readability. Same\nbelow.\n\n> +\t\tandroid::status_t status = allocator.free(handle_);\n> +\t\tif (status != android::NO_ERROR)\n> +\t\t\tLOG(HAL, Error) << \"Error freeing framebuffer: \" << status;\n>  \t}\n>  \n>  private:\n> -\tstruct alloc_device_t *allocDevice_;\n>  \tconst buffer_handle_t handle_;\n>  };\n>  } /* namespace */\n> @@ -72,51 +66,33 @@ class PlatformFrameBufferAllocator::Private : public Extensible::Private\n>  \n>  public:\n>  \tPrivate(CameraDevice *const cameraDevice)\n> -\t\t: cameraDevice_(cameraDevice),\n> -\t\t  hardwareModule_(nullptr),\n> -\t\t  allocDevice_(nullptr)\n> +\t\t: cameraDevice_(cameraDevice)\n>  \t{\n> -\t\thw_get_module(GRALLOC_HARDWARE_MODULE_ID, &hardwareModule_);\n> -\t\tASSERT(hardwareModule_);\n>  \t}\n>  \n> -\t~Private() override;\n> +\t~Private() = default;\n\nI think you can drop the destructor completely.\n\n>  \n>  \tstd::unique_ptr<HALFrameBuffer>\n>  \tallocate(int halPixelFormat, const libcamera::Size &size, uint32_t usage);\n>  \n>  private:\n>  \tconst CameraDevice *const cameraDevice_;\n> -\tconst struct hw_module_t *hardwareModule_;\n> -\tstruct alloc_device_t *allocDevice_;\n>  };\n>  \n> -PlatformFrameBufferAllocator::Private::~Private()\n> -{\n> -\tif (allocDevice_)\n> -\t\tgralloc_close(allocDevice_);\n> -\tdlclose(hardwareModule_->dso);\n> -}\n> -\n>  std::unique_ptr<HALFrameBuffer>\n>  PlatformFrameBufferAllocator::Private::allocate(int halPixelFormat,\n>  \t\t\t\t\t\tconst libcamera::Size &size,\n>  \t\t\t\t\t\tuint32_t usage)\n>  {\n> -\tif (!allocDevice_) {\n> -\t\tint ret = gralloc_open(hardwareModule_, &allocDevice_);\n> -\t\tif (ret) {\n> -\t\t\tLOG(HAL, Fatal) << \"gralloc_open() failed: \" << ret;\n> -\t\t\treturn nullptr;\n> -\t\t}\n> -\t}\n> -\n> -\tint stride = 0;\n> +\tuint32_t stride = 0;\n>  \tbuffer_handle_t handle = nullptr;\n> -\tint ret = allocDevice_->alloc(allocDevice_, size.width, size.height,\n> -\t\t\t\t      halPixelFormat, usage, &handle, &stride);\n> -\tif (ret) {\n> -\t\tLOG(HAL, Error) << \"failed buffer allocation: \" << ret;\n> +\n> +\tauto &allocator = android::GraphicBufferAllocator::get();\n> +\tandroid::status_t status = allocator.allocate(size.width, size.height, halPixelFormat,\n> +\t\t\t\t\t\t      1 /*layerCount*/, usage, &handle, &stride,\n> +\t\t\t\t\t\t      \"libcameraHAL\");\n> +\tif (status != android::NO_ERROR) {\n> +\t\tLOG(HAL, Error) << \"failed buffer allocation: \" << status;\n>  \t\treturn nullptr;\n>  \t}\n>  \tif (!handle) {\n> @@ -143,7 +119,7 @@ PlatformFrameBufferAllocator::Private::allocate(int halPixelFormat,\n>  \n>  \treturn std::make_unique<HALFrameBuffer>(\n>  \t\tstd::make_unique<GenericFrameBufferData>(\n> -\t\t\tallocDevice_, handle, planes),\n> +\t\t\thandle, planes),\n>  \t\thandle);\n>  }\n>  \n> diff --git a/src/android/mm/libhardware_stub.c b/src/android/mm/libhardware_stub.c\n> deleted file mode 100644\n> index 00f15cd90cac..000000000000\n> --- a/src/android/mm/libhardware_stub.c\n> +++ /dev/null\n> @@ -1,17 +0,0 @@\n> -/* SPDX-License-Identifier: Apache-2.0 */\n> -/*\n> - * Copyright (C) 2023, Ideas on Board\n> - *\n> - * libhardware_stub.c - Android libhardware stub for test compilation\n> - */\n> -\n> -#include <errno.h>\n> -\n> -#include <hardware/hardware.h>\n> -\n> -int hw_get_module(const char *id __attribute__((__unused__)),\n> -\t\t  const struct hw_module_t **module)\n> -{\n> -\t*module = NULL;\n> -\treturn -ENOTSUP;\n> -}\n> diff --git a/src/android/mm/meson.build b/src/android/mm/meson.build\n> index 4d1fb718e94e..301a2622008b 100644\n> --- a/src/android/mm/meson.build\n> +++ b/src/android/mm/meson.build\n> @@ -4,14 +4,6 @@ platform = get_option('android_platform')\n>  if platform == 'generic'\n>      android_hal_sources += files(['generic_camera_buffer.cpp',\n>                                    'generic_frame_buffer_allocator.cpp'])\n> -    android_deps += [libdl]\n> -\n> -    libhardware = dependency('libhardware', required : false)\n> -    if libhardware.found()\n> -        android_deps += [libhardware]\n> -    else\n> -        android_hal_sources += files(['libhardware_stub.c'])\n> -    endif\n>  \n>      libui = dependency('libui', required : false)\n>      if libui.found()\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CA6CDC326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 24 Sep 2023 16:18:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 48BDF62931;\n\tSun, 24 Sep 2023 18:18:35 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8216E62916\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 24 Sep 2023 18:18:33 +0200 (CEST)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 537CD6BE;\n\tSun, 24 Sep 2023 18:16:53 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1695572315;\n\tbh=XD0F3K4/4aAJigaxlPKqV77bqQ/2OItO41PZkMMRd9s=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=0Nsiu7nNNfiGW69bww23h+WcYVePaQqnKQXx2S9V8fKyOZIN93R4AMLK4w762edaQ\n\tsksClYotrdj0eDHKqSB2RjbVVNPUCqtwyjC6quECJ5YuQZa8pW6G69qSeRixgxYmg5\n\tLiE1OMZmWNJFEKaecUOylq8oP8zXa5fEhRM+Px15nTbLUJQIFY6WKPW8EVrUrRtEsj\n\tHKMsGjLPZwE97LnHNC6M4gs6MlIk78m7g1MN0xOFznSGWpc5BK8nlNdROsNiva34f6\n\tzVvh/nFW4NbjYAo8dPuU6ZdsW34zffeNj5nCcQZtTJAoaDX/VefoDMlvDM4t3irsYj\n\tUDsp89TRcusAg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1695572213;\n\tbh=XD0F3K4/4aAJigaxlPKqV77bqQ/2OItO41PZkMMRd9s=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=RXFNpmR2HlN38WZCnQXd0zJzFkMrKlRNyyHnEsVDrF/6HaePi5cXrL39qrQNtHXUc\n\t17C5zWJDdAgoXxVv2ja1vA6S8f67IFytUrwVshcjA35AHcYdm4eP04geANtUpVvuTo\n\tqqZh9IJ8ihWDZWdRwXefAyEjz6Ef8S1ZEq3zAcE0="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"RXFNpmR2\"; dkim-atps=neutral","Date":"Sun, 24 Sep 2023 19:18:44 +0300","To":"Mattijs Korpershoek <mkorpershoek@baylibre.com>","Message-ID":"<20230924161844.GE13101@pendragon.ideasonboard.com>","References":"<20230923-gralloc-api-v4-v3-0-9a9e039284ba@baylibre.com>\n\t<20230923-gralloc-api-v4-v3-4-9a9e039284ba@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230923-gralloc-api-v4-v3-4-9a9e039284ba@baylibre.com>","Subject":"Re: [libcamera-devel] [PATCH v3 4/4] android: mm: generic: Use\n\tGraphicBufferAllocator instead of gralloc.h","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tGuillaume La Roque <glaroque@baylibre.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27908,"web_url":"https://patchwork.libcamera.org/comment/27908/","msgid":"<87il7s2hwp.fsf@baylibre.com>","date":"2023-09-30T08:18:30","subject":"Re: [libcamera-devel] [PATCH v3 4/4] android: mm: generic: Use\n\tGraphicBufferAllocator instead of gralloc.h","submitter":{"id":153,"url":"https://patchwork.libcamera.org/api/people/153/","name":"Mattijs Korpershoek","email":"mkorpershoek@baylibre.com"},"content":"Hi Laurent,\n\nThank you for your review.\n\nOn dim., sept. 24, 2023 at 19:18, Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Mattijs,\n>\n> Thank you for the patch.\n>\n> On Sat, Sep 23, 2023 at 06:23:34PM +0200, Mattijs Korpershoek via libcamera-devel wrote:\n>> gralloc.h is a very old API that has been deprecated at least since\n>> Android P (9).\n>\n> It's interesting that the latest versions of camera.h and\n> camera_common.h still include gralloc.h. I suppose that's because those\n> headers are deprecated too, we should implement the HIDL version of the\n> camera HAL API. This will be interesting development, especially when\n> compiling against the VNDK and not as part of AOSP.\n\nYes. As of today libcamera is implemented as a shared library and uses\nthe AOSP-provided HIDL -> libhardware wrapper located in:\n//hardware/interfaces/camera/provider/2.4/default/\n\nThis means the following:\n* We implement only a subset (version 2.4) of the required features\n  according to Android\n* Upgrading to the latest and greatest would require to be implemented\n  as a process. (each HAL is its own process nowadays)\n\n>\n>> Switch over to a higher level abstraction of gralloc from libui, which\n>> is compatible with Android 11 and up.\n>> Libui:\n>> * is provided in the VNDK (so it's available to vendors).\n>> * is also used in the camera vts test named VtsAidlHalCameraProvider_TargetTest.\n>> \n>> Drop the libhardware stub since we no longer need it.\n>> \n>> Notes:\n>> * GraphicsBufferAllocator being a Singleton, buffer lifecycle\n>>   management is easier.\n>> * The imported headers from Android generate the -Wextra-semi warning.\n>>   To avoid patching the files, a pragma has been added before inclusion.\n>> \n>> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>\n>> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>> ---\n>>  src/android/mm/generic_frame_buffer_allocator.cpp | 68 ++++++++---------------\n>>  src/android/mm/libhardware_stub.c                 | 17 ------\n>>  src/android/mm/meson.build                        |  8 ---\n>>  3 files changed, 22 insertions(+), 71 deletions(-)\n>> \n>> diff --git a/src/android/mm/generic_frame_buffer_allocator.cpp b/src/android/mm/generic_frame_buffer_allocator.cpp\n>> index 7ecef2c669df..1f2fbe334f2c 100644\n>> --- a/src/android/mm/generic_frame_buffer_allocator.cpp\n>> +++ b/src/android/mm/generic_frame_buffer_allocator.cpp\n>> @@ -16,8 +16,11 @@\n>>  #include \"libcamera/internal/framebuffer.h\"\n>>  \n>>  #include <hardware/camera3.h>\n>> -#include <hardware/gralloc.h>\n>> -#include <hardware/hardware.h>\n>> +#pragma GCC diagnostic push\n>> +#pragma GCC diagnostic ignored \"-Wextra-semi\"\n>> +#include <ui/GraphicBufferAllocator.h>\n>> +#pragma GCC diagnostic pop\n>> +#include <utils/Errors.h>\n>>  \n>>  #include \"../camera_device.h\"\n>>  #include \"../frame_buffer_allocator.h\"\n>> @@ -33,35 +36,26 @@ class GenericFrameBufferData : public FrameBuffer::Private\n>>  \tLIBCAMERA_DECLARE_PUBLIC(FrameBuffer)\n>>  \n>>  public:\n>> -\tGenericFrameBufferData(struct alloc_device_t *allocDevice,\n>> -\t\t\t       buffer_handle_t handle,\n>> +\tGenericFrameBufferData(buffer_handle_t handle,\n>>  \t\t\t       const std::vector<FrameBuffer::Plane> &planes)\n>> -\t\t: FrameBuffer::Private(planes), allocDevice_(allocDevice),\n>> -\t\t  handle_(handle)\n>> +\t\t: FrameBuffer::Private(planes), handle_(handle)\n>>  \t{\n>> -\t\tASSERT(allocDevice_);\n>>  \t\tASSERT(handle_);\n>>  \t}\n>>  \n>>  \t~GenericFrameBufferData() override\n>>  \t{\n>>  \t\t/*\n>> -\t\t * allocDevice_ is used to destroy handle_. allocDevice_ is\n>> -\t\t * owned by PlatformFrameBufferAllocator::Private.\n>> -\t\t * GenericFrameBufferData must be destroyed before it is\n>> -\t\t * destroyed.\n>> -\t\t *\n>> -\t\t * \\todo Consider managing alloc_device_t with std::shared_ptr\n>> -\t\t * if this is difficult to maintain.\n>> -\t\t *\n>>  \t\t * \\todo Thread safety against alloc_device_t is not documented.\n>\n> This comment needs to be updated, or removed if GraphicBufferAllocator\n> is thread-safe.\n\nI will check if it's thread-safe (I believe it is but I'm not 100% sure)\n\n>\n>>  \t\t * Is it no problem to call alloc/free in parallel?\n>>  \t\t */\n>> -\t\tallocDevice_->free(allocDevice_, handle_);\n>> +\t\tauto &allocator = android::GraphicBufferAllocator::get();\n>\n> Please indicate the type explicitly, auto hinders readability. Same\n> below.\n\nWill do, sorry about that. I've seen auto used for iterators in the\nlibcamera codebase so I thought we could use it for a singleton pattern\nas well.\n\n>\n>> +\t\tandroid::status_t status = allocator.free(handle_);\n>> +\t\tif (status != android::NO_ERROR)\n>> +\t\t\tLOG(HAL, Error) << \"Error freeing framebuffer: \" << status;\n>>  \t}\n>>  \n>>  private:\n>> -\tstruct alloc_device_t *allocDevice_;\n>>  \tconst buffer_handle_t handle_;\n>>  };\n>>  } /* namespace */\n>> @@ -72,51 +66,33 @@ class PlatformFrameBufferAllocator::Private : public Extensible::Private\n>>  \n>>  public:\n>>  \tPrivate(CameraDevice *const cameraDevice)\n>> -\t\t: cameraDevice_(cameraDevice),\n>> -\t\t  hardwareModule_(nullptr),\n>> -\t\t  allocDevice_(nullptr)\n>> +\t\t: cameraDevice_(cameraDevice)\n>>  \t{\n>> -\t\thw_get_module(GRALLOC_HARDWARE_MODULE_ID, &hardwareModule_);\n>> -\t\tASSERT(hardwareModule_);\n>>  \t}\n>>  \n>> -\t~Private() override;\n>> +\t~Private() = default;\n>\n> I think you can drop the destructor completely.\n\nWill do\n\n>\n>>  \n>>  \tstd::unique_ptr<HALFrameBuffer>\n>>  \tallocate(int halPixelFormat, const libcamera::Size &size, uint32_t usage);\n>>  \n>>  private:\n>>  \tconst CameraDevice *const cameraDevice_;\n>> -\tconst struct hw_module_t *hardwareModule_;\n>> -\tstruct alloc_device_t *allocDevice_;\n>>  };\n>>  \n>> -PlatformFrameBufferAllocator::Private::~Private()\n>> -{\n>> -\tif (allocDevice_)\n>> -\t\tgralloc_close(allocDevice_);\n>> -\tdlclose(hardwareModule_->dso);\n>> -}\n>> -\n>>  std::unique_ptr<HALFrameBuffer>\n>>  PlatformFrameBufferAllocator::Private::allocate(int halPixelFormat,\n>>  \t\t\t\t\t\tconst libcamera::Size &size,\n>>  \t\t\t\t\t\tuint32_t usage)\n>>  {\n>> -\tif (!allocDevice_) {\n>> -\t\tint ret = gralloc_open(hardwareModule_, &allocDevice_);\n>> -\t\tif (ret) {\n>> -\t\t\tLOG(HAL, Fatal) << \"gralloc_open() failed: \" << ret;\n>> -\t\t\treturn nullptr;\n>> -\t\t}\n>> -\t}\n>> -\n>> -\tint stride = 0;\n>> +\tuint32_t stride = 0;\n>>  \tbuffer_handle_t handle = nullptr;\n>> -\tint ret = allocDevice_->alloc(allocDevice_, size.width, size.height,\n>> -\t\t\t\t      halPixelFormat, usage, &handle, &stride);\n>> -\tif (ret) {\n>> -\t\tLOG(HAL, Error) << \"failed buffer allocation: \" << ret;\n>> +\n>> +\tauto &allocator = android::GraphicBufferAllocator::get();\n>> +\tandroid::status_t status = allocator.allocate(size.width, size.height, halPixelFormat,\n>> +\t\t\t\t\t\t      1 /*layerCount*/, usage, &handle, &stride,\n>> +\t\t\t\t\t\t      \"libcameraHAL\");\n>> +\tif (status != android::NO_ERROR) {\n>> +\t\tLOG(HAL, Error) << \"failed buffer allocation: \" << status;\n>>  \t\treturn nullptr;\n>>  \t}\n>>  \tif (!handle) {\n>> @@ -143,7 +119,7 @@ PlatformFrameBufferAllocator::Private::allocate(int halPixelFormat,\n>>  \n>>  \treturn std::make_unique<HALFrameBuffer>(\n>>  \t\tstd::make_unique<GenericFrameBufferData>(\n>> -\t\t\tallocDevice_, handle, planes),\n>> +\t\t\thandle, planes),\n>>  \t\thandle);\n>>  }\n>>  \n>> diff --git a/src/android/mm/libhardware_stub.c b/src/android/mm/libhardware_stub.c\n>> deleted file mode 100644\n>> index 00f15cd90cac..000000000000\n>> --- a/src/android/mm/libhardware_stub.c\n>> +++ /dev/null\n>> @@ -1,17 +0,0 @@\n>> -/* SPDX-License-Identifier: Apache-2.0 */\n>> -/*\n>> - * Copyright (C) 2023, Ideas on Board\n>> - *\n>> - * libhardware_stub.c - Android libhardware stub for test compilation\n>> - */\n>> -\n>> -#include <errno.h>\n>> -\n>> -#include <hardware/hardware.h>\n>> -\n>> -int hw_get_module(const char *id __attribute__((__unused__)),\n>> -\t\t  const struct hw_module_t **module)\n>> -{\n>> -\t*module = NULL;\n>> -\treturn -ENOTSUP;\n>> -}\n>> diff --git a/src/android/mm/meson.build b/src/android/mm/meson.build\n>> index 4d1fb718e94e..301a2622008b 100644\n>> --- a/src/android/mm/meson.build\n>> +++ b/src/android/mm/meson.build\n>> @@ -4,14 +4,6 @@ platform = get_option('android_platform')\n>>  if platform == 'generic'\n>>      android_hal_sources += files(['generic_camera_buffer.cpp',\n>>                                    'generic_frame_buffer_allocator.cpp'])\n>> -    android_deps += [libdl]\n>> -\n>> -    libhardware = dependency('libhardware', required : false)\n>> -    if libhardware.found()\n>> -        android_deps += [libhardware]\n>> -    else\n>> -        android_hal_sources += files(['libhardware_stub.c'])\n>> -    endif\n>>  \n>>      libui = dependency('libui', required : false)\n>>      if libui.found()\n>> \n>\n> -- \n> Regards,\n>\n> Laurent Pinchart","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 6B672C0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 30 Sep 2023 08:18:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BD03362964;\n\tSat, 30 Sep 2023 10:18:40 +0200 (CEST)","from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com\n\t[IPv6:2a00:1450:4864:20::32f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DC9AE6295F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 30 Sep 2023 10:18:38 +0200 (CEST)","by mail-wm1-x32f.google.com with SMTP id\n\t5b1f17b1804b1-405524e6769so8762935e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 30 Sep 2023 01:18:38 -0700 (PDT)","from localhost\n\t(2a01cb06b0237dd3c01dd287ba46c248.ipv6.abo.wanadoo.fr.\n\t[2a01:cb06:b023:7dd3:c01d:d287:ba46:c248])\n\tby smtp.gmail.com with ESMTPSA id\n\tx13-20020adff64d000000b00325b29a6441sm2700662wrp.82.2023.09.30.01.18.34\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 30 Sep 2023 01:18:36 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1696061920;\n\tbh=F800l6G4JgIfhbgFtH34UxDLPuxFbgap+7r51XAcGHY=;\n\th=To:In-Reply-To:References:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=etau6ZHp/M8K9cTkXaHGXZUabQc9wFnaCxF88IdYacT+qdRd416dr5iBmad4LID3+\n\tgaMxMVLYp5rlF7Bu+rs4bGcOrDHddCxhVrqWIHumYTk5p2CNnntRGLVlGVdSSJPlGA\n\tj1Q8YroL145AEccVqnlP2wPLN6LlM0fzLWT5AA6yKWM9O+47H7gGEc0JJlN5olC580\n\tGXfKTzZegxipwWTs45my7yApD7QiTlt+A9M3zpxeelLSAy3pzWKwev74L1kXYAg9eP\n\tG+1PbtvST54gpUhZr2oEGW8Z6nDUsWkHrpId7jWNQBB3Qcsw6OhwB2VzQBr2MJK/3q\n\t3OLO4Z39uKzNg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1696061918;\n\tx=1696666718; darn=lists.libcamera.org; \n\th=mime-version:message-id:date:references:in-reply-to:subject:cc:to\n\t:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=SI7Mgg8LB+koZT5u7aZi1qIZXqgFVWuJoYwx0s920mo=;\n\tb=K4d+X4EzVMeTCZZnerAdmwJ4flImhoNY6gD6l6CP1XHL64GDS65djRtsif5tkFQIrR\n\t8FeuBAS9T29WDrocSaX4h2CztpfRkGrTEMW3o9pNojuceAWXL7w//muGsZkwM3SS1yD4\n\thSwwX69kqKBfUCgwq4KhwoRoohUELH7QghB81DQcq+FkGeoWGttvNcnCM3UKjUWa3alw\n\t3Q/GW7L6sqGDQbDzSr9T1sv0psgdr+caRysmpPOxgyWd0ZEYvIKw10UrEKNtruD65/8R\n\tYeMzvIKIOr0s77VGXmt+ymo1XicwVIcun+opXhIyPIzT4EskkKQRRbG+eE/qe0NWI/cr\n\td08g=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=baylibre-com.20230601.gappssmtp.com\n\theader.i=@baylibre-com.20230601.gappssmtp.com header.b=\"K4d+X4Ez\"; \n\tdkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1696061918; x=1696666718;\n\th=mime-version:message-id:date:references:in-reply-to:subject:cc:to\n\t:from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; \n\tbh=SI7Mgg8LB+koZT5u7aZi1qIZXqgFVWuJoYwx0s920mo=;\n\tb=UjILaa9O6T+XQkMNQMJy+zhni7gsCkE5TOHAN+mNlmxNdfj5VskkcvzBpddtmMhiyY\n\tmYay8BdmWMBi1eobdRgZmeBmdc1KiTrm74swajKSIvBCOrM0yH/CuC7A6UURoJ+d5nGa\n\ty4mRL1VB+/SJMvvwTRYftNBDV9hbTXDFTvVaIg9uIkL5Ua9JsaylR0su7X2xJZTUbbJr\n\tcjc+x290FDpIs9P76Qz7dqeeX+KeNYX0i2WlNZSobnmyO+wEV5uGprlYIdoBswPYldX9\n\thBI9iKewRYG+we0Vnv8aE7VCdS8E1FwHaI1bPLBffhBRCHypSVMVkSuZFHlo8G0VhcpA\n\tR3fw==","X-Gm-Message-State":"AOJu0Yx9RVF6wMRPeo/9z+O9bmtgjIggZoj+uwxTo6CBCvsMYmsddo3U\n\ttI5cLjbcTb9f7JZgOiJ9A42AtQ==","X-Google-Smtp-Source":"AGHT+IGntfNX4+YMutPmDtPislG6fgKXF3hScrIU/9u1tMx3N/pEthDsa9vYzMND/XLhAkfCys9xcw==","X-Received":"by 2002:a05:600c:3644:b0:406:4e2e:b185 with SMTP id\n\ty4-20020a05600c364400b004064e2eb185mr5270187wmq.1.1696061917599; \n\tSat, 30 Sep 2023 01:18:37 -0700 (PDT)","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20230924161844.GE13101@pendragon.ideasonboard.com>","References":"<20230923-gralloc-api-v4-v3-0-9a9e039284ba@baylibre.com>\n\t<20230923-gralloc-api-v4-v3-4-9a9e039284ba@baylibre.com>\n\t<20230924161844.GE13101@pendragon.ideasonboard.com>","Date":"Sat, 30 Sep 2023 10:18:30 +0200","Message-ID":"<87il7s2hwp.fsf@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain","Subject":"Re: [libcamera-devel] [PATCH v3 4/4] android: mm: generic: Use\n\tGraphicBufferAllocator instead of gralloc.h","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Mattijs Korpershoek via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Mattijs Korpershoek <mkorpershoek@baylibre.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tGuillaume La Roque <glaroque@baylibre.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27917,"web_url":"https://patchwork.libcamera.org/comment/27917/","msgid":"<20230930130622.GB31829@pendragon.ideasonboard.com>","date":"2023-09-30T13:06:22","subject":"Re: [libcamera-devel] [PATCH v3 4/4] android: mm: generic: Use\n\tGraphicBufferAllocator instead of gralloc.h","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Mattijs,\n\nOn Sat, Sep 30, 2023 at 10:18:30AM +0200, Mattijs Korpershoek wrote:\n> On dim., sept. 24, 2023 at 19:18, Laurent Pinchart wrote:\n> > On Sat, Sep 23, 2023 at 06:23:34PM +0200, Mattijs Korpershoek via libcamera-devel wrote:\n> >> gralloc.h is a very old API that has been deprecated at least since\n> >> Android P (9).\n> >\n> > It's interesting that the latest versions of camera.h and\n> > camera_common.h still include gralloc.h. I suppose that's because those\n> > headers are deprecated too, we should implement the HIDL version of the\n> > camera HAL API. This will be interesting development, especially when\n> > compiling against the VNDK and not as part of AOSP.\n> \n> Yes. As of today libcamera is implemented as a shared library and uses\n> the AOSP-provided HIDL -> libhardware wrapper located in:\n> //hardware/interfaces/camera/provider/2.4/default/\n> \n> This means the following:\n> * We implement only a subset (version 2.4) of the required features\n>   according to Android\n> * Upgrading to the latest and greatest would require to be implemented\n>   as a process. (each HAL is its own process nowadays)\n> \n> >> Switch over to a higher level abstraction of gralloc from libui, which\n> >> is compatible with Android 11 and up.\n> >> Libui:\n> >> * is provided in the VNDK (so it's available to vendors).\n> >> * is also used in the camera vts test named VtsAidlHalCameraProvider_TargetTest.\n> >> \n> >> Drop the libhardware stub since we no longer need it.\n> >> \n> >> Notes:\n> >> * GraphicsBufferAllocator being a Singleton, buffer lifecycle\n> >>   management is easier.\n> >> * The imported headers from Android generate the -Wextra-semi warning.\n> >>   To avoid patching the files, a pragma has been added before inclusion.\n> >> \n> >> Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>\n> >> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> >> ---\n> >>  src/android/mm/generic_frame_buffer_allocator.cpp | 68 ++++++++---------------\n> >>  src/android/mm/libhardware_stub.c                 | 17 ------\n> >>  src/android/mm/meson.build                        |  8 ---\n> >>  3 files changed, 22 insertions(+), 71 deletions(-)\n> >> \n> >> diff --git a/src/android/mm/generic_frame_buffer_allocator.cpp b/src/android/mm/generic_frame_buffer_allocator.cpp\n> >> index 7ecef2c669df..1f2fbe334f2c 100644\n> >> --- a/src/android/mm/generic_frame_buffer_allocator.cpp\n> >> +++ b/src/android/mm/generic_frame_buffer_allocator.cpp\n> >> @@ -16,8 +16,11 @@\n> >>  #include \"libcamera/internal/framebuffer.h\"\n> >>  \n> >>  #include <hardware/camera3.h>\n> >> -#include <hardware/gralloc.h>\n> >> -#include <hardware/hardware.h>\n> >> +#pragma GCC diagnostic push\n> >> +#pragma GCC diagnostic ignored \"-Wextra-semi\"\n> >> +#include <ui/GraphicBufferAllocator.h>\n> >> +#pragma GCC diagnostic pop\n> >> +#include <utils/Errors.h>\n> >>  \n> >>  #include \"../camera_device.h\"\n> >>  #include \"../frame_buffer_allocator.h\"\n> >> @@ -33,35 +36,26 @@ class GenericFrameBufferData : public FrameBuffer::Private\n> >>  \tLIBCAMERA_DECLARE_PUBLIC(FrameBuffer)\n> >>  \n> >>  public:\n> >> -\tGenericFrameBufferData(struct alloc_device_t *allocDevice,\n> >> -\t\t\t       buffer_handle_t handle,\n> >> +\tGenericFrameBufferData(buffer_handle_t handle,\n> >>  \t\t\t       const std::vector<FrameBuffer::Plane> &planes)\n> >> -\t\t: FrameBuffer::Private(planes), allocDevice_(allocDevice),\n> >> -\t\t  handle_(handle)\n> >> +\t\t: FrameBuffer::Private(planes), handle_(handle)\n> >>  \t{\n> >> -\t\tASSERT(allocDevice_);\n> >>  \t\tASSERT(handle_);\n> >>  \t}\n> >>  \n> >>  \t~GenericFrameBufferData() override\n> >>  \t{\n> >>  \t\t/*\n> >> -\t\t * allocDevice_ is used to destroy handle_. allocDevice_ is\n> >> -\t\t * owned by PlatformFrameBufferAllocator::Private.\n> >> -\t\t * GenericFrameBufferData must be destroyed before it is\n> >> -\t\t * destroyed.\n> >> -\t\t *\n> >> -\t\t * \\todo Consider managing alloc_device_t with std::shared_ptr\n> >> -\t\t * if this is difficult to maintain.\n> >> -\t\t *\n> >>  \t\t * \\todo Thread safety against alloc_device_t is not documented.\n> >\n> > This comment needs to be updated, or removed if GraphicBufferAllocator\n> > is thread-safe.\n> \n> I will check if it's thread-safe (I believe it is but I'm not 100% sure)\n> \n> >>  \t\t * Is it no problem to call alloc/free in parallel?\n> >>  \t\t */\n> >> -\t\tallocDevice_->free(allocDevice_, handle_);\n> >> +\t\tauto &allocator = android::GraphicBufferAllocator::get();\n> >\n> > Please indicate the type explicitly, auto hinders readability. Same\n> > below.\n> \n> Will do, sorry about that. I've seen auto used for iterators in the\n> libcamera codebase so I thought we could use it for a singleton pattern\n> as well.\n\nWe use auto when spelling out the type would be very inconvenient.\nIterators are a very good example.\n\n> >> +\t\tandroid::status_t status = allocator.free(handle_);\n> >> +\t\tif (status != android::NO_ERROR)\n> >> +\t\t\tLOG(HAL, Error) << \"Error freeing framebuffer: \" << status;\n> >>  \t}\n> >>  \n> >>  private:\n> >> -\tstruct alloc_device_t *allocDevice_;\n> >>  \tconst buffer_handle_t handle_;\n> >>  };\n> >>  } /* namespace */\n> >> @@ -72,51 +66,33 @@ class PlatformFrameBufferAllocator::Private : public Extensible::Private\n> >>  \n> >>  public:\n> >>  \tPrivate(CameraDevice *const cameraDevice)\n> >> -\t\t: cameraDevice_(cameraDevice),\n> >> -\t\t  hardwareModule_(nullptr),\n> >> -\t\t  allocDevice_(nullptr)\n> >> +\t\t: cameraDevice_(cameraDevice)\n> >>  \t{\n> >> -\t\thw_get_module(GRALLOC_HARDWARE_MODULE_ID, &hardwareModule_);\n> >> -\t\tASSERT(hardwareModule_);\n> >>  \t}\n> >>  \n> >> -\t~Private() override;\n> >> +\t~Private() = default;\n> >\n> > I think you can drop the destructor completely.\n> \n> Will do\n> \n> >>  \n> >>  \tstd::unique_ptr<HALFrameBuffer>\n> >>  \tallocate(int halPixelFormat, const libcamera::Size &size, uint32_t usage);\n> >>  \n> >>  private:\n> >>  \tconst CameraDevice *const cameraDevice_;\n> >> -\tconst struct hw_module_t *hardwareModule_;\n> >> -\tstruct alloc_device_t *allocDevice_;\n> >>  };\n> >>  \n> >> -PlatformFrameBufferAllocator::Private::~Private()\n> >> -{\n> >> -\tif (allocDevice_)\n> >> -\t\tgralloc_close(allocDevice_);\n> >> -\tdlclose(hardwareModule_->dso);\n> >> -}\n> >> -\n> >>  std::unique_ptr<HALFrameBuffer>\n> >>  PlatformFrameBufferAllocator::Private::allocate(int halPixelFormat,\n> >>  \t\t\t\t\t\tconst libcamera::Size &size,\n> >>  \t\t\t\t\t\tuint32_t usage)\n> >>  {\n> >> -\tif (!allocDevice_) {\n> >> -\t\tint ret = gralloc_open(hardwareModule_, &allocDevice_);\n> >> -\t\tif (ret) {\n> >> -\t\t\tLOG(HAL, Fatal) << \"gralloc_open() failed: \" << ret;\n> >> -\t\t\treturn nullptr;\n> >> -\t\t}\n> >> -\t}\n> >> -\n> >> -\tint stride = 0;\n> >> +\tuint32_t stride = 0;\n> >>  \tbuffer_handle_t handle = nullptr;\n> >> -\tint ret = allocDevice_->alloc(allocDevice_, size.width, size.height,\n> >> -\t\t\t\t      halPixelFormat, usage, &handle, &stride);\n> >> -\tif (ret) {\n> >> -\t\tLOG(HAL, Error) << \"failed buffer allocation: \" << ret;\n> >> +\n> >> +\tauto &allocator = android::GraphicBufferAllocator::get();\n> >> +\tandroid::status_t status = allocator.allocate(size.width, size.height, halPixelFormat,\n> >> +\t\t\t\t\t\t      1 /*layerCount*/, usage, &handle, &stride,\n> >> +\t\t\t\t\t\t      \"libcameraHAL\");\n> >> +\tif (status != android::NO_ERROR) {\n> >> +\t\tLOG(HAL, Error) << \"failed buffer allocation: \" << status;\n> >>  \t\treturn nullptr;\n> >>  \t}\n> >>  \tif (!handle) {\n> >> @@ -143,7 +119,7 @@ PlatformFrameBufferAllocator::Private::allocate(int halPixelFormat,\n> >>  \n> >>  \treturn std::make_unique<HALFrameBuffer>(\n> >>  \t\tstd::make_unique<GenericFrameBufferData>(\n> >> -\t\t\tallocDevice_, handle, planes),\n> >> +\t\t\thandle, planes),\n> >>  \t\thandle);\n> >>  }\n> >>  \n> >> diff --git a/src/android/mm/libhardware_stub.c b/src/android/mm/libhardware_stub.c\n> >> deleted file mode 100644\n> >> index 00f15cd90cac..000000000000\n> >> --- a/src/android/mm/libhardware_stub.c\n> >> +++ /dev/null\n> >> @@ -1,17 +0,0 @@\n> >> -/* SPDX-License-Identifier: Apache-2.0 */\n> >> -/*\n> >> - * Copyright (C) 2023, Ideas on Board\n> >> - *\n> >> - * libhardware_stub.c - Android libhardware stub for test compilation\n> >> - */\n> >> -\n> >> -#include <errno.h>\n> >> -\n> >> -#include <hardware/hardware.h>\n> >> -\n> >> -int hw_get_module(const char *id __attribute__((__unused__)),\n> >> -\t\t  const struct hw_module_t **module)\n> >> -{\n> >> -\t*module = NULL;\n> >> -\treturn -ENOTSUP;\n> >> -}\n> >> diff --git a/src/android/mm/meson.build b/src/android/mm/meson.build\n> >> index 4d1fb718e94e..301a2622008b 100644\n> >> --- a/src/android/mm/meson.build\n> >> +++ b/src/android/mm/meson.build\n> >> @@ -4,14 +4,6 @@ platform = get_option('android_platform')\n> >>  if platform == 'generic'\n> >>      android_hal_sources += files(['generic_camera_buffer.cpp',\n> >>                                    'generic_frame_buffer_allocator.cpp'])\n> >> -    android_deps += [libdl]\n> >> -\n> >> -    libhardware = dependency('libhardware', required : false)\n> >> -    if libhardware.found()\n> >> -        android_deps += [libhardware]\n> >> -    else\n> >> -        android_hal_sources += files(['libhardware_stub.c'])\n> >> -    endif\n> >>  \n> >>      libui = dependency('libui', required : false)\n> >>      if libui.found()\n> >>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 475E5BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 30 Sep 2023 13:06:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 665886295F;\n\tSat, 30 Sep 2023 15:06:14 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EFDED61DE1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 30 Sep 2023 15:06:11 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(lfbn-idf1-1-343-200.w86-195.abo.wanadoo.fr [86.195.61.200])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 37F40DD9;\n\tSat, 30 Sep 2023 15:04:28 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1696079174;\n\tbh=dMnuQUa1G6aEXeRANLS/KzDI/Pmq0JZwIJQef6Zlc88=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=deGQ1Tjmv9FE2YY59IvMpbYUYPm3usP92sX5+AS6zAL7coJolkqoZHJL3w41Ovzc1\n\t4ILv2w5v8xOPF4SnB97H715wjGtEuYkYwqKUpThracrgljm3DV0LtWbgLqzeowsUzA\n\tm0QRU847YEf8tfYPL8klDf7ZdLhDDV4BNwFbFURUi4e9AHhGEPkiv/vslxzdWjKXCS\n\tKM4TpMU1wiw6BDZy+nB0uHu/HUjGfbqNXkbzV9nxxR8JInoIAey+pLsVuyd5rf8HBb\n\t8CHBgQ3n6a/YNK70FSTRaPdmIA2aQ9xQ8iHI5Z6syt2clXhI9PHnHgET8yIoYPIf5Z\n\tuAYVmALGudrgQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1696079068;\n\tbh=dMnuQUa1G6aEXeRANLS/KzDI/Pmq0JZwIJQef6Zlc88=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=cHhf35Uzrn88MaM69xQAWbjFrVh7jnS1XH5PIJxG6Z7uYdM2xFSZhY6QqpiBHcezX\n\turyh/yFAtz7eZMTEyYlXRod+B6I1ri4NtO6/8HoPLSXCRjwXsOWJoO1dU9YvQZJba7\n\tulMGp3/5Vy1QXOWY/ckbQo3F2ovZiIbyzIbas3Gw="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"cHhf35Uz\"; dkim-atps=neutral","Date":"Sat, 30 Sep 2023 16:06:22 +0300","To":"Mattijs Korpershoek <mkorpershoek@baylibre.com>","Message-ID":"<20230930130622.GB31829@pendragon.ideasonboard.com>","References":"<20230923-gralloc-api-v4-v3-0-9a9e039284ba@baylibre.com>\n\t<20230923-gralloc-api-v4-v3-4-9a9e039284ba@baylibre.com>\n\t<20230924161844.GE13101@pendragon.ideasonboard.com>\n\t<87il7s2hwp.fsf@baylibre.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<87il7s2hwp.fsf@baylibre.com>","Subject":"Re: [libcamera-devel] [PATCH v3 4/4] android: mm: generic: Use\n\tGraphicBufferAllocator instead of gralloc.h","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org,\n\tGuillaume La Roque <glaroque@baylibre.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]