Patch Detail
Show a patch.
GET /api/patches/27154/?format=api
{ "id": 27154, "url": "https://patchwork.libcamera.org/api/patches/27154/?format=api", "web_url": "https://patchwork.libcamera.org/patch/27154/", "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": "<20260701132555.66035-2-david.plowman@raspberrypi.com>", "date": "2026-07-01T13:24:10", "name": "[v2,1/1] pipeline: rpi: Handle buffers with offsets", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "98483b569c29ea45f25c967ead9a35f7c203f8c3", "submitter": { "id": 42, "url": "https://patchwork.libcamera.org/api/people/42/?format=api", "name": "David Plowman", "email": "david.plowman@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/27154/mbox/", "series": [ { "id": 6031, "url": "https://patchwork.libcamera.org/api/series/6031/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=6031", "date": "2026-07-01T13:24:09", "name": "Make Raspberry Pi 5 handle buffer offsets", "version": 2, "mbox": "https://patchwork.libcamera.org/series/6031/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/27154/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/27154/checks/", "tags": {}, "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 E0175C3307\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 1 Jul 2026 13:26:01 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 28E3A65FAD;\n\tWed, 1 Jul 2026 15:26:00 +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 5DA8865F14\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 1 Jul 2026 15:25:58 +0200 (CEST)", "by mail-wm1-x32f.google.com with SMTP id\n\t5b1f17b1804b1-493b68b4643so4101915e9.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 01 Jul 2026 06:25:58 -0700 (PDT)", "from davidp-pi5.pitowers.org\n\t([2a00:1098:3142:1f:4706:89ee:c47e:1087])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-493be4fef11sm70758135e9.15.2026.07.01.06.25.57\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 01 Jul 2026 06:25:57 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"JLzzg9tp\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1782912358; x=1783517158;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to:content-type;\n\tbh=l/zZP76L0qGd29J1oaikfH68PPMLBZeClrJm9zoVXS4=;\n\tb=JLzzg9tpFkN5gzfD6m3u6XeWO9CVRAMZuR0F1Y9mEW03FFBPv5iJoSyf0kOXE5OuR8\n\tCkkKg9xC65r5WUFvO6Ddj/L2a9S8Dq4Bcd0KPHEA1vT707PHPspWkChmsML4zIG2Lk3a\n\trBF50oKlhCmgzQFmAd+dQRT+2yQpo3k48046B0o0oRwQjrLgR94fK3pG1iBtoHdJ+PWE\n\tmdW48PhQ4APrGeTI2/mYNzhUZTwE5cWOiPZ6sbkaZKlH6FRECWF2RBYS8hBPL9vWRX+S\n\twjfDWXyUYojJQCGfhtYaTRKYD+5Rf5Q6+gDNgInUXtv+kSW33TtEN6L314YgCj/ltTUB\n\txF9g==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20251104; t=1782912358; x=1783517158;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to:content-type;\n\tbh=l/zZP76L0qGd29J1oaikfH68PPMLBZeClrJm9zoVXS4=;\n\tb=fl9iI0GAIG7ys3FK/dfgZUo6z1FNgLLpRtL+W6XM9kgLr4eO7/KMGrOLSZH3xMWkEu\n\tSX3VjHJdwErbHFeEog1wcLXSrdS2HHqQFMIT4PFLzY+3OYYPxoQabZAlVh5kBZzJbhrv\n\tr51aHbkI1MEACR1Gaqm4Y0Lkh7NxOUInus8cxnxzzfxEuf0eMnW9jdKOFqQbmurr8fpp\n\t8L2f7lLs9jSsJoSsYbSDYXm8hUMXA5q/XdDJRZesCLRISooGGTbkhPb3gwy/V88Cj20l\n\tiyybhnH3hge/gjjY3PgdLcwrLX/DXz9aYcgDK54KyIRLOabD0jQHHmZCXYKTW6YIhy7F\n\tSwlw==", "X-Gm-Message-State": "AOJu0Yz+xwOen6Lz2bfq/R0ra1ATON0tNnlnlVbSqzhb6+i2Cz0+5sC7\n\t5Ou31VAiUBUVXi6geBBgFN5PvK6j5ynC9oecxRuvf73ofkx3pPreeS8Lbzagd2fClcO2pQ04ydJ\n\tYzBSplRo=", "X-Gm-Gg": "AfdE7cnnTESZs6R9KbY6PPmDyAN2SA/LJhb7kW7Ri2OvdHZDbo2BJLW3RQ4xfgBZE3k\n\tZZHaltKkwnWOnpMVZlthSt1xTvTjcpiZMQixuSjTeYMiN3LIcwuuTvJZTN/RKW1utBTz5HAMucF\n\tHaA9OJ98tx68n/iwqwGl09sficUz9vUu//jQ4IZNTl/jXr+JV05B8xfDAMdY7W76xGdG/g/Khcs\n\tb/X/XiySpYsdtimGpk0An6f6kINEtMT27hQ0bXviZKjnMZm8YjIVFRyjdex4mIGZrxnKUdDhmMR\n\tUkAiEuyS+tI+H0PGu6GjI2829TeLtrUPUa770OOWzSv0CulgATl7pqhhX7y5jyHbd+q+N2aUD+i\n\tnjU2kX/mvmFJ9Q0+oRv22mFdn8QBb5UbdI6qZTWhXBVwBCHliegKSzbBFWg354U0KtzTxmpEpwf\n\tKlo523BiavX+EdNgW08mAylJuY9c33erOSxTPBkS83GR95GYJ1dH05sVQpv7Sb3ZNrUhJXo24XY\n\t7YHuV4My95ChOtr8x+BsmfXMMr7Ioqh", "X-Received": "by 2002:a05:600c:a215:b0:493:ba40:ef39 with SMTP id\n\t5b1f17b1804b1-493c3cd7ce3mr6948765e9.15.1782912357720; \n\tWed, 01 Jul 2026 06:25:57 -0700 (PDT)", "From": "David Plowman <david.plowman@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "David Plowman <david.plowman@raspberrypi.com>", "Subject": "[PATCH v2 1/1] pipeline: rpi: Handle buffers with offsets", "Date": "Wed, 1 Jul 2026 14:24:10 +0100", "Message-ID": "<20260701132555.66035-2-david.plowman@raspberrypi.com>", "X-Mailer": "git-send-email 2.47.3", "In-Reply-To": "<20260701132555.66035-1-david.plowman@raspberrypi.com>", "References": "<20260701132555.66035-1-david.plowman@raspberrypi.com>", "MIME-Version": "1.0", "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 allows camera images to be written to offset locations within\nbuffers (which must have be allocated with sufficient space\navailable).\n\nFirstly, the RPi::Stream class tracks associated \"ispOutputIndex\" for\noutput streams, that is, whether it corresponds to ISP output branch 0\nor branch 1.\n\nSecondly, we pass buffer offsets on to libpisp for each request.\n\nThe libpisp version is moved on to 1.6.0 which is required for this\nchange.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n .../pipeline/rpi/common/rpi_stream.h | 10 ++++++++--\n src/libcamera/pipeline/rpi/pisp/meson.build | 2 +-\n src/libcamera/pipeline/rpi/pisp/pisp.cpp | 19 +++++++++++++++++++\n subprojects/libpisp.wrap | 2 +-\n 4 files changed, 29 insertions(+), 4 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.h b/src/libcamera/pipeline/rpi/common/rpi_stream.h\nindex 300a352a..51931867 100644\n--- a/src/libcamera/pipeline/rpi/common/rpi_stream.h\n+++ b/src/libcamera/pipeline/rpi/common/rpi_stream.h\n@@ -97,14 +97,14 @@ public:\n \tusing StreamFlags = Flags<StreamFlag>;\n \n \tStream()\n-\t\t: flags_(StreamFlag::None), id_(0), swDownscale_(0)\n+\t\t: flags_(StreamFlag::None), id_(0), swDownscale_(0), ispOutputIndex_(-1)\n \t{\n \t}\n \n \tStream(const char *name, MediaEntity *dev, StreamFlags flags = StreamFlag::None)\n \t\t: flags_(flags), name_(name),\n \t\t dev_(std::make_unique<V4L2VideoDevice>(dev)), id_(0),\n-\t\t swDownscale_(0)\n+\t\t swDownscale_(0), ispOutputIndex_(-1)\n \t{\n \t}\n \n@@ -125,6 +125,9 @@ public:\n \n \tvoid setExportedBuffer(FrameBuffer *buffer);\n \n+\tvoid setIspIndex(int ispIndex) { ispOutputIndex_ = ispIndex; }\n+\tint getIspIndex() const { return ispOutputIndex_; }\n+\n \tint allocateBuffers(unsigned int count);\n \tint queueBuffer(FrameBuffer *buffer);\n \tvoid returnBuffer(FrameBuffer *buffer);\n@@ -181,6 +184,9 @@ private:\n \t * as the stream needs to maintain ownership of these buffers.\n \t */\n \tstd::vector<std::unique_ptr<FrameBuffer>> internalBuffers_;\n+\n+\t/* For output streams, the ISP branch for this stream (otherwise -1). */\n+\tint ispOutputIndex_;\n };\n \n /*\ndiff --git a/src/libcamera/pipeline/rpi/pisp/meson.build b/src/libcamera/pipeline/rpi/pisp/meson.build\nindex 178df94c..121f93ef 100644\n--- a/src/libcamera/pipeline/rpi/pisp/meson.build\n+++ b/src/libcamera/pipeline/rpi/pisp/meson.build\n@@ -5,7 +5,7 @@ libcamera_internal_sources += files([\n ])\n \n librt = cc.find_library('rt', required : true)\n-libpisp_dep = dependency('libpisp', fallback : ['libpisp', 'libpisp_dep'])\n+libpisp_dep = dependency('libpisp', version : '>=1.6.0', fallback : ['libpisp', 'libpisp_dep'])\n \n libcamera_deps += [libpisp_dep, librt]\n \ndiff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\nindex c9d89d58..23f4c14d 100644\n--- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n+++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n@@ -1524,6 +1524,7 @@ int PiSPCameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConf\n \t\t\tbeEnables |= PISP_BE_RGB_ENABLE_OUTPUT0;\n \t\t\tispIndex = 0;\n \t\t}\n+\t\tstream->setIspIndex(ispIndex);\n \n \t\tformat = outStreams[i].format;\n \t\tbool needs32BitConversion = adjustDeviceFormat(format);\n@@ -2306,6 +2307,24 @@ void PiSPCameraData::tryRunPipeline()\n \tRequest *request = requestQueue_.front();\n \tASSERT(request->metadata().empty());\n \n+\t/* Pass the plane offsets of any output buffers to the Back End ISP. */\n+\tfor (auto const &[stream, buffer] : request->buffers()) {\n+\t\tint ispIndex = static_cast<const RPi::Stream *>(stream)->getIspIndex();\n+\t\tif (ispIndex >= 0) {\n+\t\t\t/*\n+\t\t\t * PiSP takes only 2 offsets; offset 3 (where required) is assumed\n+\t\t\t * to be the same as offset 2.\n+\t\t\t */\n+\t\t\tunsigned int offset = buffer->planes()[0].offset;\n+\t\t\tunsigned int offset2 = 0;\n+\t\t\tif (buffer->planes().size() > 1)\n+\t\t\t\toffset2 = buffer->planes()[1].offset;\n+\n+\t\t\tpisp_be_output_format_extra extra{ 0, 0, { offset, offset2 } };\n+\t\t\tbe_->SetOutputFormatExtra(ispIndex, extra);\n+\t\t}\n+\t}\n+\n \t/* See if a new ScalerCrop value needs to be applied. */\n \tapplyScalerCrop(request->controls());\n \ndiff --git a/subprojects/libpisp.wrap b/subprojects/libpisp.wrap\nindex b92de484..1a3c3b77 100644\n--- a/subprojects/libpisp.wrap\n+++ b/subprojects/libpisp.wrap\n@@ -2,5 +2,5 @@\n \n [wrap-git]\n url = https://github.com/raspberrypi/libpisp.git\n-revision = v1.5.0\n+revision = v1.6.0\n depth = 1\n", "prefixes": [ "v2", "1/1" ] }