{"id":21199,"url":"https://patchwork.libcamera.org/api/1.1/patches/21199/?format=json","web_url":"https://patchwork.libcamera.org/patch/21199/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20240907143110.2210711-8-chenghaoyang@google.com>","date":"2024-09-07T14:28:32","name":"[v11,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/1.1/people/117/?format=json","name":"Cheng-Hao Yang","email":"chenghaoyang@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/21199/mbox/","series":[{"id":4567,"url":"https://patchwork.libcamera.org/api/1.1/series/4567/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4567","date":"2024-09-07T14:28:25","name":"Add VirtualPipelineHandler","version":11,"mbox":"https://patchwork.libcamera.org/series/4567/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/21199/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/21199/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 030DDC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  7 Sep 2024 14:31:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E096263504;\n\tSat,  7 Sep 2024 16:31:37 +0200 (CEST)","from mail-pl1-x629.google.com (mail-pl1-x629.google.com\n\t[IPv6:2607:f8b0:4864:20::629])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 425F7634EE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  7 Sep 2024 16:31:30 +0200 (CEST)","by mail-pl1-x629.google.com with SMTP id\n\td9443c01a7336-2055a3f80a4so22202305ad.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 07 Sep 2024 07:31:30 -0700 (PDT)","from chenghaoyang-low.c.googlers.com.com\n\t(0.223.81.34.bc.googleusercontent.com. [34.81.223.0])\n\tby smtp.gmail.com with ESMTPSA id\n\td9443c01a7336-20710e33974sm9208935ad.104.2024.09.07.07.31.26\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tSat, 07 Sep 2024 07:31:27 -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=\"KNaC4HGa\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=chromium.org; s=google; t=1725719488; x=1726324288;\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=uFCyayGX03aYOPVPXaPrf192CZnV0LxtxK3RtRGtom8=;\n\tb=KNaC4HGawqqV5OlX1YjdoZo2gPaGUtiowq9XKWkaBkHkZVQZYM3vtc6qQJr6du3mEi\n\tc3+mVlnSzhIjxLtdh9lzc05T5wx77sGggmFkwmJ10OEDGERyme7I62R0KDbJhIwYBiG+\n\t/0+dmr3i7U265OU17DEsp3vOct6m4nZVSmNhs=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1725719488; x=1726324288;\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=uFCyayGX03aYOPVPXaPrf192CZnV0LxtxK3RtRGtom8=;\n\tb=NQ8MkYAgpm03Y/sPyxdF87xCfQDaAeVQo2N9FIrzPF9zObcI8ShEd0xzz1F3kZ/+wp\n\t5acFF9bjqQJWnm+79t5wrbzKmmfiwHuABBhOFoE0U6yJfSS2pad4NFnm94OpblYihErk\n\tgY0JzdEZTmaS9yRYPYwHZXuO8RPxX1rRgkIKNZRyE/ndBcgU6esVGrUW34UQrGsDuPeJ\n\tOn7of8iCGDt9v+6yKjfUM5dUEpNNesdW6cz6BPW5g5mDJZiI14sW1PsJXSAehGdwNesn\n\tOgZx1rrZx23z/YbBj27zXBqPVfXNt+0ex9R24JbGVfRrfElyEpPaj7gpP1dPEkYmiuHY\n\t4RkQ==","X-Gm-Message-State":"AOJu0YyEIiSoDWcdzpyWQjF/Cb6u9a/i1GnlCvD49vkaLNvwqyiLSufu\n\t/TDdYr57Z1dyKkuoOzGqcV7PByXr1x76cqQiHojlR4d4wR84e78RGjZ+qas2EHLxVE9o7umHNOi\n\t9xQ==","X-Google-Smtp-Source":"AGHT+IFnSJDdKSGFKgr0Z/nK4wzh6QgHgVNo8Z+Bez3TwS226gXxSaUXwVexzgUOmlpPZK0PXYeifA==","X-Received":"by 2002:a17:902:e885:b0:206:d69d:9ca6 with SMTP id\n\td9443c01a7336-206f04e1af6mr80070055ad.10.1725719488076; \n\tSat, 07 Sep 2024 07:31:28 -0700 (PDT)","From":"Harvey Yang <chenghaoyang@chromium.org>","X-Google-Original-From":"Harvey Yang <chenghaoyang@google.com>","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 v11 7/7] libcamera: software_isp: Refactor SoftwareIsp to use\n\tDmaBufAllocator::exportBuffers","Date":"Sat,  7 Sep 2024 14:28:32 +0000","Message-ID":"<20240907143110.2210711-8-chenghaoyang@google.com>","X-Mailer":"git-send-email 2.46.0.469.g59c65b2a67-goog","In-Reply-To":"<20240907143110.2210711-1-chenghaoyang@google.com>","References":"<20240907143110.2210711-1-chenghaoyang@google.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":"As 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 1140372c..3455f13a 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":["v11","7/7"]}