Show a patch.

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

{
    "id": 21055,
    "url": "https://patchwork.libcamera.org/api/patches/21055/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21055/",
    "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": "<20240829195703.1456614-8-chenghaoyang@chromium.org>",
    "date": "2024-08-29T19:47:46",
    "name": "[v10,7/7] libcamera: software_isp: Refactor SoftwareIsp to use DmaBufAllocator::exportBuffers",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "5f98528d63df8d5fec95e0c9da3bdff582bbd04e",
    "submitter": {
        "id": 117,
        "url": "https://patchwork.libcamera.org/api/people/117/?format=api",
        "name": "Cheng-Hao Yang",
        "email": "chenghaoyang@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21055/mbox/",
    "series": [
        {
            "id": 4547,
            "url": "https://patchwork.libcamera.org/api/series/4547/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4547",
            "date": "2024-08-29T19:47:39",
            "name": "Add VirtualPipelineHandler",
            "version": 10,
            "mbox": "https://patchwork.libcamera.org/series/4547/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21055/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21055/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 03916C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 29 Aug 2024 19:57:29 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6552E634DD;\n\tThu, 29 Aug 2024 21:57:29 +0200 (CEST)",
            "from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com\n\t[IPv6:2a00:1450:4864:20::32b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 85FB3634C8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 29 Aug 2024 21:57:12 +0200 (CEST)",
            "by mail-wm1-x32b.google.com with SMTP id\n\t5b1f17b1804b1-428178fc07eso8860405e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 29 Aug 2024 12:57:12 -0700 (PDT)",
            "from chenghaoyang-germany.c.googlers.com.com\n\t(161.126.77.34.bc.googleusercontent.com. [34.77.126.161])\n\tby smtp.gmail.com with ESMTPSA id\n\t5b1f17b1804b1-42ba7b4271fsm54602805e9.29.2024.08.29.12.57.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 29 Aug 2024 12:57:11 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"jVrTQgtA\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1724961432; x=1725566232;\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;\n\tbh=OlGML7j698JA+GNnOHiuVJg0H9KbzljNqElhQR8sHZI=;\n\tb=jVrTQgtAHthQ1/P7MPx/CqSR3ulzKaJe6xC/y4CWIzjb3lkU8yKuEslOUlUz+Q64NR\n\tNK5CVsIWEpdyRpYuwZ1ahQ3ixisqIXfUV4lr4Fqa+uCTM+vuzjoajjsoIawcnpF6HjNy\n\tg03et6v5lgYhawqr9wPk5zln/sRmR8fQoYGUg=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1724961432; x=1725566232;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=OlGML7j698JA+GNnOHiuVJg0H9KbzljNqElhQR8sHZI=;\n\tb=OH7WGWOlL664schGz4HzPsf3Da2dxVh4EHBrEGi9M4IjdqWT2rXkV2NixxQDYL4aLS\n\t9nXpnazq/nc7P7nybYfMp+lpd4nqxKlfFEQ9wxNnKaMYoTprhYABUxCBevKPWG/DLWrv\n\t8ilQ7BKAtmK5JUe6Dg6hOkA0WhfgoQMgI5qEJ7Z37omyS09P1qiutUoAF25KRM7sKgBu\n\tz3BWI3MNfHyoge9SaNAKWgqyMndCaooHcPNNjuiVOoI5huU6RbLMXh79bf/RxzBnaKoh\n\tU/wKrCP3P526Zy47Mjpy6nGv/Gd4jwgKkEZHHbO9FX0fiu2HxgE2cQU3L9q/GtkCZe8C\n\tB15A==",
        "X-Gm-Message-State": "AOJu0Yzw6vMzy8b7Fpv5Ty2Dfmb6ZrbBUClafgPq15pazTB+4iOFl5bd\n\tVGlznM4MBHvJ6FUmrE2eoIfhPdpCxQ05iyvBiyCflkgzxdYH5qrcaog1q8tDckatvyGjoe4TFwg\n\tPww==",
        "X-Google-Smtp-Source": "AGHT+IHD/0QRG6hwOUzthlgTth5XOn29XO9d+FgYVvmVxjVsWgFolx5rfLxGzNdAJk+iiPEaDqYHpw==",
        "X-Received": "by 2002:a7b:c449:0:b0:42b:aecb:d280 with SMTP id\n\t5b1f17b1804b1-42bb27a1021mr33170805e9.27.1724961431808; \n\tThu, 29 Aug 2024 12:57:11 -0700 (PDT)",
        "From": "Harvey Yang <chenghaoyang@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Harvey Yang <chenghaoyang@google.com>,\n\tHarvey Yang <chenghaoyang@chromium.org>,\n\tMilan Zamazal <mzamazal@redhat.com>",
        "Subject": "[PATCH v10 7/7] libcamera: software_isp: Refactor SoftwareIsp to use\n\tDmaBufAllocator::exportBuffers",
        "Date": "Thu, 29 Aug 2024 19:47:46 +0000",
        "Message-ID": "<20240829195703.1456614-8-chenghaoyang@chromium.org>",
        "X-Mailer": "git-send-email 2.46.0.469.g59c65b2a67-goog",
        "In-Reply-To": "<20240829195703.1456614-1-chenghaoyang@chromium.org>",
        "References": "<20240829195703.1456614-1-chenghaoyang@chromium.org>",
        "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": "From: Harvey Yang <chenghaoyang@google.com>\n\nAs the helper function DmaBufAllocator::exportBuffers is added, we can\navoid some code duplication in SoftwareIsp as well.\n\nSigned-off-by: Harvey Yang <chenghaoyang@chromium.org>\nReviewed-by: Milan Zamazal <mzamazal@redhat.com>\n---\n src/libcamera/software_isp/software_isp.cpp | 20 +-------------------\n 1 file changed, 1 insertion(+), 19 deletions(-)",
    "diff": "diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\nindex 1140372ce..3455f13aa 100644\n--- a/src/libcamera/software_isp/software_isp.cpp\n+++ b/src/libcamera/software_isp/software_isp.cpp\n@@ -255,25 +255,7 @@ int SoftwareIsp::exportBuffers(const Stream *stream, unsigned int count,\n \tif (stream == nullptr)\n \t\treturn -EINVAL;\n \n-\tfor (unsigned int i = 0; i < count; i++) {\n-\t\tconst std::string name = \"frame-\" + std::to_string(i);\n-\t\tconst size_t frameSize = debayer_->frameSize();\n-\n-\t\tFrameBuffer::Plane outPlane;\n-\t\toutPlane.fd = SharedFD(dmaHeap_.alloc(name.c_str(), frameSize));\n-\t\tif (!outPlane.fd.isValid()) {\n-\t\t\tLOG(SoftwareIsp, Error)\n-\t\t\t\t<< \"failed to allocate a dma_buf\";\n-\t\t\treturn -ENOMEM;\n-\t\t}\n-\t\toutPlane.offset = 0;\n-\t\toutPlane.length = frameSize;\n-\n-\t\tstd::vector<FrameBuffer::Plane> planes{ outPlane };\n-\t\tbuffers->emplace_back(std::make_unique<FrameBuffer>(std::move(planes)));\n-\t}\n-\n-\treturn count;\n+\treturn dmaHeap_.exportBuffers(count, { debayer_->frameSize() }, buffers);\n }\n \n /**\n",
    "prefixes": [
        "v10",
        "7/7"
    ]
}