Cover Letter Detail
Show a cover letter.
GET /api/covers/27079/?format=api
{ "id": 27079, "url": "https://patchwork.libcamera.org/api/covers/27079/?format=api", "web_url": "https://patchwork.libcamera.org/cover/27079/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20260629163017.863145-1-barnabas.pocze@ideasonboard.com>", "date": "2026-06-29T16:29:23", "name": "[RFC,v1,00/54] libcamera: Split requests and buffers", "submitter": { "id": 216, "url": "https://patchwork.libcamera.org/api/people/216/?format=api", "name": "Barnabás Pőcze", "email": "barnabas.pocze@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/cover/27079/mbox/", "series": [ { "id": 6025, "url": "https://patchwork.libcamera.org/api/series/6025/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6025", "date": "2026-06-29T16:29:23", "name": "libcamera: Split requests and buffers", "version": 1, "mbox": "https://patchwork.libcamera.org/series/6025/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/covers/27079/comments/", "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 BC983C3261\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Jun 2026 16:30:26 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7251965F38;\n\tMon, 29 Jun 2026 18:30:23 +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 C657865F04\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2026 18:30:20 +0200 (CEST)", "from pb-laptop.local (185.221.140.128.nat.pool.zt.hu\n\t[185.221.140.128])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 670BF8D4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2026 18:29:37 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"M9Hi/nSC\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1782750577;\n\tbh=Chfy7k5Bd1TVTVZSOoLi/1VXdub0d72nAu07+sQeNm4=;\n\th=From:To:Subject:Date:From;\n\tb=M9Hi/nSCnH6iWSRlQqX1TG15hB21/60+Elk6wZWErizLLO8uD6IkcB4LVZatgVOPN\n\tAZ9ftyNVJA3h/xsv1Paytm3cCAAejQ352DbrMAxsiYyjm4LLs4UsX1PQdh1z5SetHJ\n\tc3lqzzOliViHC+XjiaQ/ujLirm4uqK4YavSzckBg=", "From": "=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[RFC PATCH v1 00/54] libcamera: Split requests and buffers", "Date": "Mon, 29 Jun 2026 18:29:23 +0200", "Message-ID": "<20260629163017.863145-1-barnabas.pocze@ideasonboard.com>", "X-Mailer": "git-send-email 2.54.0", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "This is the first RFC changeset for splitting requests and buffers. It largely\nincludes https://patchwork.libcamera.org/cover/26964/, but many of those are\nalready reviewed.\n\nThe \"interesting\" changes start with \"test: fence: Disable temporarily\".\n\n---\n\n# introduction\n\nThe basic idea is that requests no longer have buffers when they are submitted,\nand the camera keeps track of a set of buffers for each stream, and buffers will\nbe attached to requests from this pool in an unspecified order\n\nA new function, `Camera::addBuffer(stream, buffer, fence)` is added to fill the pool;\nthis can be called in the \"Running\" state. `Camera::stop()` empties the pool via the\n`bufferCompleted` event. Another new function, `Request::enableStream(stream, bool)`\nis used to set which streams a request wants frames from.\n\nPipeline handlers can use `Camera::Private::acquireBuffer(stream)` to retrieve a\nbuffer for the given stream. If this buffer is not acceptable, then\n`Camera::Private::rejectBuffer(buffer)` can be used to reject it. Otherwise\n`completeBuffer(request, buffer)` is used normally to attach it to a request.\n\nThis new behaviour is opt-in for pipeline handlers for now, with no opt-in,\nthe `PipelineHandler` base class fills each request with buffers before\ncalling `queueRequestDevice()`.\n\n\n# discussion points\n\n## adding buffers before `Camera::start()`\n\nCurrently buffers can only be added in the \"Running\" state. They could\nbe added in \"Configured\" as well, but there is no \"unconfigure\" function,\nand putting it into `stop()` would be a bit asymmetric.\n\n## empty pool notification\n\nCurrently there is no mechanism for the application to know how many\nbuffers it should keep in the pool. I think a signal to notify the application\nwhen it should add more buffers for a given stream could be added. But the\nmain idea was to expose some kind of minimum buffer count quantity.\n\n## requirements towards application wrt. buffers\n\nWith this prototype, an application is essentially required to always process *all*\nbuffers in *all* completed requests, otherwise it might lose buffers. (This\napplies to cancelled requests as well.) Is that reasonable?\n\n## returning unused buffers\n\nCurrently this is done from `Camera::stop()` with the `bufferCompleted` signal\nwhere `request == nullptr`. This works, but may not be the best interface.\n\n## returning rejected buffers\n\nPipeline handlers can reject buffers. But how should that be signalled to the\napplication. Currently this is also done via `bufferCompleted` with `request == nullptr`.\nBut this is not ideal because there isn't really a way to distinguish it from\nan unused buffer since both are returned with `FrameMetadata::Status::FrameCancelled`\nbecause `FrameError` requires some other fields to be valid.\n\n## extending `completeBuffer()` with stream parameter\n\nInitially I planned to add a stream parameter to `completeBuffer()`, but most pipeline handlers\nare not trivially convertible, especially something like `imx8-isi`. So I simply went ahead\nwith storing the associated stream in the `FrameBuffer` itself for now. I still think having\n`completeBuffer(req, stream, buf)` is worthwhile, but it is not a \"natural\" change at the moment.\n\n## fence timeout\n\nPreviously a hard-coded timeout was used for fences. This is now removed.\nShould there be a hard-coded fixed timeout for fences?\n\n\n# TODO\n\n# converting more pipeline handlers\n\nOnly the uvcvideo pipeline handler is converted to use the buffer pool\ndirectly as an experiment, but more should be converted to really see\nif this public api is a good fit for pipeline handlers. Especially something\nlike `imx8-isi` since that has a bit different architecture from the others.\n\n# minimum buffer count\n\nThe applications need to know how many buffers should be kept in the pool\nfor a given stream for continuous streaming. This should be a property or\nsimilar.\n\n# `FrameBuffer::Private::request()`\n\nAfter all pipeline handlers are migrated, the request member of `FrameBuffer`\nshould probably be removed to fully decouple the two.\n\n---\n\nBarnabás Pőcze (54):\n apps: cam: Simplify buffer reuse\n libcamera: request: Disassociate buffer when cancelling\n libcamera: pipeline: Replace open-coded request cancellation\n libcamera: pipeline: mali-c55: Remove `setRequest()` calls\n libcamera: pipeline: virtual: Make copy of request's buffer map\n libcamera: request: completeBuffer(): Emit `bufferCompleted` here\n libcamera: pipeline_handler: completeBuffer(): Inline and `static`\n v4l2: v4l2_camera: Avoid a level of indirection\n v4l2: v4l2_camera: Remove repated index checks\n v4l2: v4l2_camera_proxy: Remove `bufferCount_`\n v4l2: v4l2_camera: Use actually allocated buffer count\n v4l2: v4l2_camera: Use buffer cookie for indexing\n v4l2: v4l2_camera: Rename `Buffer` to `CompletedBuffer`\n v4l2: v4l2_camera: Always clear pending requests\n v4l2: v4l2_camera: Clear completed requests when stopping\n v4l2: v4l2_camera: Provide buffers one by one\n test: fence: Disable temporarily\n libcamera: request: Remove `ReuseBuffers`\n libcamera: framebuffer: request(): Move to private type\n libcamera: framebuffer: Store associated Stream\n libcamera: camera: Add `StreamData`\n libcamera: camera: Add buffer pool\n libcamera: request: addBuffer(): Remove impl\n libcamera: request: Remove fence support\n libcamera: request: Store count of pending buffers\n libcamera: request: doCancelRequest(): Remove\n libcamera: pipeline_handler: Move constructor options to a separate\n type\n libcamera: pipeline_handler: Acquire buffers if not using pool\n libcamera: request: enableStream(): Add\n libcamera: camera: acquireBuffer(): Add\n libcamera: camera: rejectBuffer(): Add\n libcamera: pipeline_handler: buffersAddedDevice(): New virtual\n function\n libcamera: pipeline_handler: Use `std::deque`\n libcamera: pipeline_handler: completeRequest(): Return request count\n libcamera: pipeline: uvcvideo: Use buffer pool prototype\n libcamera: request: completeBuffer(): Emit `bufferCompleted` last\n libcamera: camera: bufferCompleted: Pass `Stream` as well\n libcamera: camera: queueRequest(): Adjust buffer map empty error\n message\n libcamera: camera: queueBuffer(): Reject if it has buffers\n apps: cam: Use camera buffer pool\n app: lc-compliance: Use camera buffer pool\n apps: lc-compliance: Add buffer pool tests\n test: Use camera buffer pool\n apps: qcam: Use camera buffer pool\n v4l2: Use camera buffer pool\n py: Use camera buffer pool\n gstreamer: Use camera buffer pool\n libcamera: request: Remove `ReuseFlag`\n android: Update imported files\n android: camera_request: Add helper for buffer conversion\n android: camera_device: Move fence restoration into\n `prepareToReturn()`\n android: Use camera buffer pool\n libcamera: request: Remove `addBuffer()`\n test: fence: Enable\n\n .../guides/application-developer.rst | 9 -\n Documentation/guides/pipeline-handler.rst | 10 +-\n .../libhardware/include/hardware/camera3.h | 360 +-\n .../include/hardware/camera_common.h | 304 +-\n .../libhardware/include/hardware/gralloc.h | 99 +-\n .../android/metadata/camera_metadata_hidden.h | 11 +-\n .../android/metadata/system/camera_metadata.h | 41 +-\n .../metadata/system/camera_metadata_tags.h | 633 +-\n .../metadata/system/camera_vendor_tags.h | 10 +-\n .../android/system/core/include/android/log.h | 450 +-\n .../core/include/cutils/native_handle.h | 62 +-\n .../system/core/include/system/camera.h | 4 +-\n .../core/include/system/graphics-base-v1.2.h | 36 +\n .../core/include/system/graphics-base.h | 1 +\n .../system/core/include/system/graphics.h | 10 +-\n include/libcamera/camera.h | 5 +-\n include/libcamera/framebuffer.h | 1 -\n include/libcamera/internal/camera.h | 46 +-\n include/libcamera/internal/framebuffer.h | 6 +\n include/libcamera/internal/pipeline_handler.h | 31 +-\n include/libcamera/internal/request.h | 24 +-\n include/libcamera/request.h | 10 +-\n src/android/camera3_hal.cpp | 3 +\n src/android/camera_capabilities.cpp | 3 +\n src/android/camera_device.cpp | 287 +-\n src/android/camera_device.h | 4 +\n src/android/camera_hal_manager.cpp | 2 +-\n src/android/camera_ops.cpp | 16 +-\n src/android/camera_request.cpp | 53 +-\n src/android/camera_request.h | 11 +-\n src/android/metadata/camera_metadata.c | 183 +-\n .../metadata/camera_metadata_tag_info.c | 5478 ++++++++++++++++-\n src/apps/cam/camera_session.cpp | 36 +-\n src/apps/cam/camera_session.h | 2 +-\n src/apps/lc-compliance/helpers/capture.cpp | 23 +-\n src/apps/lc-compliance/tests/capture_test.cpp | 261 +\n src/apps/qcam/main_window.cpp | 82 +-\n src/apps/qcam/main_window.h | 1 -\n src/gstreamer/gstlibcamerasrc.cpp | 136 +-\n src/libcamera/camera.cpp | 164 +-\n src/libcamera/fence.cpp | 15 +-\n src/libcamera/framebuffer.cpp | 57 +-\n src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 5 +-\n src/libcamera/pipeline/ipu3/ipu3.cpp | 16 +-\n src/libcamera/pipeline/mali-c55/mali-c55.cpp | 7 +-\n src/libcamera/pipeline/mali-c55/rzg2l-cru.cpp | 3 +-\n src/libcamera/pipeline/mali-c55/rzg2l-cru.h | 3 +-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 7 +-\n .../pipeline/rpi/common/pipeline_base.cpp | 16 +-\n .../pipeline/rpi/common/pipeline_base.h | 2 +-\n src/libcamera/pipeline/simple/simple.cpp | 17 +-\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 72 +-\n src/libcamera/pipeline/vimc/vimc.cpp | 11 +-\n src/libcamera/pipeline/virtual/virtual.cpp | 44 +-\n src/libcamera/pipeline_handler.cpp | 260 +-\n src/libcamera/request.cpp | 290 +-\n src/py/cam/cam.py | 20 +-\n src/py/examples/simple-cam.py | 13 +-\n src/py/examples/simple-capture.py | 20 +-\n src/py/examples/simple-continuous-capture.py | 32 +-\n src/py/libcamera/py_main.cpp | 65 +-\n src/v4l2/v4l2_camera.cpp | 150 +-\n src/v4l2/v4l2_camera.h | 25 +-\n src/v4l2/v4l2_camera_proxy.cpp | 118 +-\n src/v4l2/v4l2_camera_proxy.h | 3 -\n test/camera/buffer_import.cpp | 22 +-\n test/camera/camera_reconfigure.cpp | 22 +-\n test/camera/capture.cpp | 24 +-\n test/camera/statemachine.cpp | 4 +-\n test/fence.cpp | 214 +-\n 70 files changed, 9182 insertions(+), 1283 deletions(-)\n create mode 100644 include/android/system/core/include/system/graphics-base-v1.2.h\n\n--\n2.54.0" }