Show a patch.

GET /api/1.1/patches/23844/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 23844,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/23844/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/23844/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/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": "<20250717220539.2434556-1-dan.scally@ideasonboard.com>",
    "date": "2025-07-17T22:05:38",
    "name": "[1/2] libcamera: mali-c55: Set bytesused appropriately",
    "commit_ref": "2cc66bb547a222d3cc3f9e73de054d537324c825",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b974365e014aa5f13a93c9a1e27a6121f1f19571",
    "submitter": {
        "id": 156,
        "url": "https://patchwork.libcamera.org/api/1.1/people/156/?format=api",
        "name": "Dan Scally",
        "email": "dan.scally@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/23844/mbox/",
    "series": [
        {
            "id": 5295,
            "url": "https://patchwork.libcamera.org/api/1.1/series/5295/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5295",
            "date": "2025-07-17T22:05:38",
            "name": "[1/2] libcamera: mali-c55: Set bytesused appropriately",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5295/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/23844/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/23844/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 33147BE175\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 17 Jul 2025 22:05:59 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E8E7668F8D;\n\tFri, 18 Jul 2025 00:05:57 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 29DB868F70\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 18 Jul 2025 00:05:55 +0200 (CEST)",
            "from mail.ideasonboard.com\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net [86.13.91.161])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8FA1755A;\n\tFri, 18 Jul 2025 00:05:20 +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=\"roapOM5R\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1752789920;\n\tbh=GOGEc5TZG9NjOJaS4uTVyAoIwEoeubyWQ7hCnUMvues=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=roapOM5Ro1UKS9O+9wgcY4oWJZDM9V5pII0QyOPUpafSsYNKfjrMVS3bTYCS4GUTJ\n\tmScjhjTo56IbIchG7zlQG0c80Ydx79oNkV57lFmPHEtvX+BVJD9vKRFWhwZhLgnaHJ\n\tmX6aV7zap2KH+GKFSx1hdKrOsH+NOchclr83dzEI=",
        "From": "Daniel Scally <dan.scally@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Daniel Scally <dan.scally@ideasonboard.com>",
        "Subject": "[PATCH 1/2] libcamera: mali-c55: Set bytesused appropriately",
        "Date": "Thu, 17 Jul 2025 23:05:38 +0100",
        "Message-Id": "<20250717220539.2434556-1-dan.scally@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "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": "At the moment the mali-c55 pipeline handler sets bytesused for a\nbuffer to be the maximum possible size (i.e. the size of a struct\nmali_c55_params_buffer). This is not really in keeping with the goal\nof the extensible parameters formats, and will not work with the new\nframework for those formats. Update the IPA module and pipeline\nhandler to set bytesused to the size of the parameters that were\nactually supplied rather than the maximum possible size.\n\nSigned-off-by: Daniel Scally <dan.scally@ideasonboard.com>\n---\n include/libcamera/ipa/mali-c55.mojom         | 2 +-\n src/ipa/mali-c55/mali-c55.cpp                | 3 ++-\n src/libcamera/pipeline/mali-c55/mali-c55.cpp | 7 +++----\n 3 files changed, 6 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/include/libcamera/ipa/mali-c55.mojom b/include/libcamera/ipa/mali-c55.mojom\nindex 5d7eb4ee..39b7f1f1 100644\n--- a/include/libcamera/ipa/mali-c55.mojom\n+++ b/include/libcamera/ipa/mali-c55.mojom\n@@ -28,7 +28,7 @@ interface IPAMaliC55Interface {\n };\n \n interface IPAMaliC55EventInterface {\n-\tparamsComputed(uint32 request);\n+\tparamsComputed(uint32 request, uint32 bytesused);\n \tstatsProcessed(uint32 request, libcamera.ControlList metadata);\n \tsetSensorControls(libcamera.ControlList sensorControls);\n };\ndiff --git a/src/ipa/mali-c55/mali-c55.cpp b/src/ipa/mali-c55/mali-c55.cpp\nindex c6941a95..5877f299 100644\n--- a/src/ipa/mali-c55/mali-c55.cpp\n+++ b/src/ipa/mali-c55/mali-c55.cpp\n@@ -346,7 +346,8 @@ void IPAMaliC55::fillParams(unsigned int request,\n \t\tASSERT(params->total_size <= MALI_C55_PARAMS_MAX_SIZE);\n \t}\n \n-\tparamsComputed.emit(request);\n+\tsize_t bytesused = offsetof(struct mali_c55_params_buffer, data) + params->total_size;\n+\tparamsComputed.emit(request, bytesused);\n }\n \n void IPAMaliC55::processStats(unsigned int request, unsigned int bufferId,\ndiff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\nindex 4acc091b..17ad2055 100644\n--- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n+++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp\n@@ -618,7 +618,7 @@ public:\n \tvoid imageBufferReady(FrameBuffer *buffer);\n \tvoid paramsBufferReady(FrameBuffer *buffer);\n \tvoid statsBufferReady(FrameBuffer *buffer);\n-\tvoid paramsComputed(unsigned int requestId);\n+\tvoid paramsComputed(unsigned int requestId, uint32_t bytesused);\n \tvoid statsProcessed(unsigned int requestId, const ControlList &metadata);\n \n \tbool match(DeviceEnumerator *enumerator) override;\n@@ -1494,7 +1494,7 @@ void PipelineHandlerMaliC55::statsBufferReady(FrameBuffer *buffer)\n \t\t\t\t sensorControls);\n }\n \n-void PipelineHandlerMaliC55::paramsComputed(unsigned int requestId)\n+void PipelineHandlerMaliC55::paramsComputed(unsigned int requestId, uint32_t bytesused)\n {\n \tMaliC55FrameInfo &frameInfo = frameInfoMap_[requestId];\n \tRequest *request = frameInfo.request;\n@@ -1505,8 +1505,7 @@ void PipelineHandlerMaliC55::paramsComputed(unsigned int requestId)\n \t * video devices.\n \t */\n \n-\tframeInfo.paramBuffer->_d()->metadata().planes()[0].bytesused =\n-\t\tsizeof(struct mali_c55_params_buffer);\n+\tframeInfo.paramBuffer->_d()->metadata().planes()[0].bytesused = bytesused;\n \tparams_->queueBuffer(frameInfo.paramBuffer);\n \tstats_->queueBuffer(frameInfo.statBuffer);\n \n",
    "prefixes": [
        "1/2"
    ]
}