From patchwork Thu Sep 17 09:01:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenmeng Liu X-Patchwork-Id: 28311 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A20D0C3220 for ; Thu, 17 Sep 2026 09:01:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5078468702; Thu, 17 Sep 2026 11:01:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="HZlp8wdt"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="PlE8nx8t"; dkim-atps=neutral Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E0E8968643 for ; Thu, 17 Sep 2026 11:01:30 +0200 (CEST) Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68H8TVvb597690 for ; Thu, 17 Sep 2026 09:01:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=sy3kQ2lr5g69Pzguvga+BF 4tN4oXOZHcLVP2uqtyICs=; b=HZlp8wdtj82FR6NXmO+XEifQayFRzA0DERgETK hQVeBneKSdXduWBbVW916tWf0KDBC2t0WkkgxnV8jCBt7WKkC8VU6ouQ9FBAUwAE KwsIlUgR6N83qqFMPtbY0RJZZQiDZBbyalBNc6J8c3ACDkwyrgJOeY5zp5ZfJVPR +3FuDH5ktDpTCKo//DLIUm4yIRCO2px3sQ9wE+wnV7nJsIAGwWN5+K/aF0EOgJEj 1HbCwA2Dxp7z6R99RxCuLsq0otF8ENzxWxmooc/mpYF1cPtU1StaiXksUGKU6KBT mv7xOSAgO3b8cFXxqZqVlv/AjuSVefzOKaXWQ7CYLKx5e6Gg== Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4grcra83w9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 17 Sep 2026 09:01:26 +0000 (GMT) Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-9124b265371so6915066d6.0 for ; Thu, 17 Sep 2026 02:01:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1789635685; x=1790240485; darn=lists.libcamera.org; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=sy3kQ2lr5g69Pzguvga+BF4tN4oXOZHcLVP2uqtyICs=; b=PlE8nx8tL/+ZxHi2G4gW7SwQhEBO0Hbrl5hpSy5YVEh57MyXaI59NKsG1dGntgNIpY f4vtCpSG7ghUvW1TwwiMgazHzzrAbrd2Veoin62gsd+LGqhgtR6SDZyz1S+dqDZLkO2L xs9mg7Qvy6O/ZEjzNSQr9zm7qkVjZCc8cOgPNZTRwnb5dZcQBCMPSCiYX4LIm33ELWjw vYP0yswYM3y0jofS3cpu4xTvbX3E1hPfXh34cbV9e1UXMGB6rB55dKOuJXbLdIbhrXNK 0RQt04d5r8IBFPsguBvbClMCVH79Vlz09qQlUZ+yuh6kZyvyu0a3ucjzUjqzlBzOfjpe NZIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789635685; x=1790240485; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=sy3kQ2lr5g69Pzguvga+BF4tN4oXOZHcLVP2uqtyICs=; b=gxGHZDC3aVgnhNTifYYPXWXA7kR64WDpbAjUWoh8JsJXAy9s/EKjy4XLg1t++hcE8Y /tk9832n+zQTLNZFSn/pXaQJNajngWM7XenXXXv5qx3b89tDos2GvDoGZVc5Np5AovBv OyYlErIqKrLrnfA8uWW9eOdC1WnNuNVhkHHK3KxjK5XvbCh+Gq/9K5TT3G/JiOGYuZBr S8guWru6ZGQUbgz0cUXABgqIq28jMIeYCiEYkABEByCjIy06Dr8tCQzgtwLula94eGsn 4TIrAXQUghS8EOePbj8oNZ1S1PDYqAf6eVudOEu9nJMXqSdIgE8kcBgcSm3o2jAlrA8L 7ohg== X-Gm-Message-State: AFuF++k8v3aZUgAFr7hIytEdUpe4RJjIbd+z+enSwB/pjI7V+d1cipFG s86KdBhLBtwo1dfcwpMKSpvxFKIk3tG7fdBUUCILCAye1uGxT3OTJ3HeHr5tKp2ATpPcZwb1qUl kA9n+FbELKEPxAI8z/eL0Q7T6NTtf3ipkjDYAZKSLK7PbXJB0VYFnB+EQIW2GoKbNIJjD1Y03XP 7C X-Gm-Gg: AYBFou3stY3bNlZI0FIxlRcLJqKaPLjXqa15DSnZI7asQIi5om8NMyLQYcKzaNog6Lr EAYb4S8rCzxjjkK/3yCoPW328U0rUaWDhC2CB8wC9+x+h7EGvUmUC4pKt1Ka8cW9f+AluXs62LC WkFHcpdvTGv48KjkRDrAGPqAguMSP+SYKjLPTS+XLyy2vyNoav7L4SGkhGBG/Ykki2sZ9nnFJsD gT2oPXNruxeldHnlVjkMcA6exvcU0uJmw4FBbfdcJqHiT4vnzWErvkV1fjf3SvqQ0atKMCmZytE JrNSililzgro2W+cbfS3xINPPMRIssopyScBRBOIkjySE0b9xXnpJVzci/ZTK9ZGXxIt9QG+6j+ cn4vqP6DQkA+cXLQPprgpPjmoTyH6433VOXNL/KJYVNelJX9GJQGJxceNETFOWdy3j323 X-Received: by 2002:a05:6214:2264:b0:8f0:afa3:594e with SMTP id 6a1803df08f44-9123d7095bfmr105947756d6.8.1789635685167; Thu, 17 Sep 2026 02:01:25 -0700 (PDT) X-Received: by 2002:a05:6214:2264:b0:8f0:afa3:594e with SMTP id 6a1803df08f44-9123d7095bfmr105947146d6.8.1789635684611; Thu, 17 Sep 2026 02:01:24 -0700 (PDT) Received: from WENMLIU-LAB01.ap.qualcomm.com (Global_NAT1_IAD_FW.qualcomm.com. [129.46.232.65]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-9123bed0aaesm45310066d6.41.2026.09.17.02.01.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Sep 2026 02:01:24 -0700 (PDT) From: Wenmeng Liu Date: Thu, 17 Sep 2026 17:01:05 +0800 Subject: [PATCH v2] libcamera: dma_buf_allocator: Make provider priority configurable MIME-Version: 1.0 Message-Id: <20260917-udma-v2-1-74d4eead5465@oss.qualcomm.com> X-B4-Tracking: v=1; b=H4sIAFCsq2oC/zWMQQrCMBBFr1JmbUoylGJceQ/pYkxSGzCNJm1QS u7uWHHz4T0+b4PskncZTs0GyRWffZwZ8NCAmWi+OeEtM6DEXmqlxGoDCZISx6OWqNAAXx/Jjf6 1Zy4D8+TzEtN7rxb1tf9A9wsUJZSwhrqxZ0v6eo45t8+V7iaG0PLAUGv9AKMw9eWfAAAA X-Change-ID: 20260911-udma-a002f890212c To: libcamera-devel@lists.libcamera.org Cc: johannes.goede@oss.qualcomm.com, bryan.odonoghue@linaro.org, Wenmeng Liu X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789635681; l=13261; i=wenmeng.liu@oss.qualcomm.com; s=20250925; h=from:subject:message-id; bh=o93kgjg4NdtFJMBmNfZLWhMNd+dsGNpTiKb92gz9Tk4=; b=2ik3vRvkD5jOMUgrxDMeN16PFwldTeimYR1eL23SkUaS5QxkgVAJnoJa+KFRlCLDUNzUuWpjr n74uyC9+ZyZCew11NWGEHxJmIwYSiJZv3CkgH2KXDGaujvszVTOkS7E X-Developer-Key: i=wenmeng.liu@oss.qualcomm.com; a=ed25519; pk=fQJjf9C3jGDjE1zj2kO3NQLTbQEaZObVcXAzx5WLPX0= X-Proofpoint-Spam-Info: AW1haW4tMjYwOTE3MDEyMiBTYWx0ZWRfX71Slk1OCG3n0 pMxb9wpC2ZuM2TVPZdSAttyhXGPsXew3TWPj1PvMnTarsyJNcw6k6vxZQcoknQbWXVfsyTzB5dM dLcEP4momwl/HcWVO0up5EPc6MaCw8k= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTE3MDEyMiBTYWx0ZWRfX23V7D43EVJVH YIwLWS0QjADwmK9eGjo8txbaekLtJob0oOTuINoLnxihF7VuZhrLEVLSQO+doo104yLtZYnJVhd D3f2LQrABM8OYQyWPlETJaF6x7NnXtYxLvcOFOuvKrlzhx4lblecfa5QGklzUWj85xqtLABmDOl BZyEd/zfRIgj6+cCY5kz4Erj5UNo/zf6F3dvvollY1I/r3Yym89bxKpRlbZzEVoyWutnBrLB+5q l6zTVN96yzfCJAAQRTrLzAuBYgou0mBLMadIOQGOAo1FCY8kANc0UBZbb2/7bo6pOxwVeqzqLyk WApV2r1IoVwRnIKc86KiUwwTdBF25lBKUVki7MJK9D2uLOpEeNoHUjLqre5FdGyzVp3BrEiXQct HvBkMCnbo5Or2DlI4byV3hFp5gL5LnsvgbX+SYL4+1gqf2ZHeEUX727EXGZtwSJl+ZajXLKn+zr D6NJ+JiOJwz0f+PnQgg== X-Authority-Analysis: v=2.4 cv=WL/qzXsR c=1 sm=1 tr=0 ts=6aabac66 cx=c_pps a=UgVkIMxJMSkC9lv97toC5g==:117 a=C3Dk8TwHQYyIj7nOf9RCJw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=YAyIRdgMAAAA:8 a=EUspDBNiAAAA:8 a=B0ujXqhFi5PEgtlYLNQA:9 a=QEXdDO2ut3YA:10 a=1HOtulTD9v-eNWfpl4qZ:22 a=o1rO4XtwZBNj6n05oSJ_:22 X-Proofpoint-GUID: u2xCJhT_1VaVLphK41rPs_4sipD-Rts9 X-Proofpoint-ORIG-GUID: u2xCJhT_1VaVLphK41rPs_4sipD-Rts9 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293, Aquarius:18.0.1176, Hydra:6.1.134, FMLib:17.12.100.49 definitions=2026-09-17_01,2026-09-16_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 malwarescore=0 bulkscore=0 phishscore=0 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609170122 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" DmaBufAllocator selects a provider using a fixed priority (CMA heap, system heap, then udmabuf) and picks the first one that can be opened. On platforms with a small CMA region this is suboptimal: CMA is always chosen when present even though it may be too small, while udmabuf, backed by pageable system memory, would work. Make the provider priority order configurable through the 'dma_buf_allocator/provider_priority' global configuration option, an ordered list of preferred provider names. Providers not listed are tried afterwards in the built-in order (CMA heap, system heap, then udmabuf). When the option is absent the historical order is kept, so behaviour is unchanged by default. DmaBufAllocator reads this option itself. Its constructor now takes a CameraManager reference to reach the GlobalConfiguration, following the same pattern as the other software ISP helpers (SwStatsCpu, Benchmark, Debayer). The callers only pass the camera manager and the providers they accept, rather than parsing the configuration themselves. This lets a platform prefer udmabuf by shipping a configuration.yaml. The set of providers stays limited to what the caller requested, so a component that requires physically-contiguous memory (CMA only) is not given a udmabuf-backed buffer. Document the new option in runtime_configuration.rst. Signed-off-by: Wenmeng Liu --- Changes in v2: - Move the configuration parsing from the callers into DmaBufAllocator's constructor. The constructor now takes a 'const CameraManager &cm' argument to reach the GlobalConfiguration and reads 'dma_buf_allocator/provider_priority' itself, so the callers no longer parse the config file. (Hans) - Update the DmaBufAllocator callers (software ISP, virtual pipeline and rpi/vc4) to the new constructor signature. - Drop the "This is useful on platforms with a small CMA region..." sentence from runtime_configuration.rst; the rationale is kept in the commit message only. (Hans) - Reword the commit message to describe reading the option inside DmaBufAllocator rather than in each caller. - Link to v1: https://lists.libcamera.org/pipermail/libcamera-devel/2026-September/062007.html --- Documentation/runtime_configuration.rst | 27 +++++++ include/libcamera/internal/dma_buf_allocator.h | 4 +- src/libcamera/dma_buf_allocator.cpp | 98 +++++++++++++++++++++----- src/libcamera/pipeline/rpi/vc4/vc4.cpp | 2 +- src/libcamera/pipeline/virtual/virtual.cpp | 7 +- src/libcamera/software_isp/software_isp.cpp | 8 ++- 6 files changed, 121 insertions(+), 25 deletions(-) --- base-commit: 87c7285663aaad7608fdc18d5216ec6811c685c7 change-id: 20260911-udma-a002f890212c Best regards, diff --git a/Documentation/runtime_configuration.rst b/Documentation/runtime_configuration.rst index a71b715a17245fc5fea405165323a607827a9ecb..79c6e4026adcdbb974f7398419b37f246717b9a9 100644 --- a/Documentation/runtime_configuration.rst +++ b/Documentation/runtime_configuration.rst @@ -33,6 +33,9 @@ file structure: :: configuration: + dma_buf_allocator: + provider_priority: + - ... # dma-buf provider name: cma, system, or udmabuf ipa: force_isolation: # true/false config_paths: @@ -62,6 +65,11 @@ Configuration file example --- version: 1 configuration: + dma_buf_allocator: + provider_priority: + - udmabuf + - cma + - system ipa: config_paths: - /home/user/.libcamera/share/ipa @@ -150,6 +158,25 @@ LIBCAMERA_SOFTISP_MODE, software_isp.mode Example value: ``gpu`` +dma_buf_allocator.provider_priority + Define an ordered list of dma-buf providers to try when libcamera + allocates buffers internally (for example for the software ISP). The + first requested provider that is available on the system is used. Valid + provider names are ``cma`` (CMA dma-heap), ``system`` (system dma-heap) + and ``udmabuf`` (memfd + /dev/udmabuf). Providers accepted by a component + but not listed here are tried after the listed ones, in libcamera's + built-in order. + + Example value: + + :: + + dma_buf_allocator: + provider_priority: + - udmabuf + - cma + - system + pipelines.simple.supported_devices.driver, pipelines.simple.supported_devices.software_isp Override whether software ISP is enabled for the given driver. diff --git a/include/libcamera/internal/dma_buf_allocator.h b/include/libcamera/internal/dma_buf_allocator.h index 13600915a066d61c6f0dac2bfc7ec21d7fef33ef..07fd903170c92dc83b1b05d77aa261f6ac614c01 100644 --- a/include/libcamera/internal/dma_buf_allocator.h +++ b/include/libcamera/internal/dma_buf_allocator.h @@ -18,6 +18,7 @@ namespace libcamera { +class CameraManager; class FrameBuffer; class DmaBufAllocator @@ -31,7 +32,8 @@ public: using DmaBufAllocatorFlags = Flags; - DmaBufAllocator(DmaBufAllocatorFlags flags = DmaBufAllocatorFlag::CmaHeap); + DmaBufAllocator(const CameraManager &cm, + DmaBufAllocatorFlags type = DmaBufAllocatorFlag::CmaHeap); ~DmaBufAllocator(); bool isValid() const { return providerHandle_.isValid(); } UniqueFD alloc(const char *name, std::size_t size); diff --git a/src/libcamera/dma_buf_allocator.cpp b/src/libcamera/dma_buf_allocator.cpp index c673d23ec761e62b746f8984dfbdd0b01a858a38..9d96f06014eaeed38f4dda19fc4a1a4586ea488b 100644 --- a/src/libcamera/dma_buf_allocator.cpp +++ b/src/libcamera/dma_buf_allocator.cpp @@ -8,13 +8,16 @@ #include "libcamera/internal/dma_buf_allocator.h" +#include #include #include +#include #include #include #include #include #include +#include #include #include @@ -26,6 +29,8 @@ #include +#include "libcamera/internal/camera_manager.h" + /** * \file dma_buf_allocator.cpp * \brief dma-buf allocator @@ -51,6 +56,26 @@ static constexpr std::array providerInfos = { { { DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf, "/dev/udmabuf" }, } }; +/* Built-in provider priority, used when no other order is specified. */ +static constexpr std::array + defaultProviderPriority = { { + DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap, + DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap, + DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf, + } }; + +static std::optional +providerFromName(const std::string &name) +{ + if (name == "cma") + return DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap; + if (name == "system") + return DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap; + if (name == "udmabuf") + return DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf; + return {}; +} + LOG_DEFINE_CATEGORY(DmaBufAllocator) /** @@ -83,6 +108,7 @@ LOG_DEFINE_CATEGORY(DmaBufAllocator) /** * \brief Construct a DmaBufAllocator of a given type + * \param[in] cm The camera manager, used to access the global configuration * \param[in] type The type(s) of the dma-buf providers to allocate from * * The dma-buf provider type is selected with the \a type parameter, which @@ -90,29 +116,67 @@ LOG_DEFINE_CATEGORY(DmaBufAllocator) * the constructed DmaBufAllocator instance is invalid as indicated by * the isValid() function. * - * Multiple types can be selected by combining type flags, in which case - * the constructed DmaBufAllocator will match one of the types. If multiple - * requested types can work on the system, which provider is used is undefined. + * Multiple types can be selected by combining type flags. In that case the + * provider to use is chosen by priority: the providers listed in the + * `dma_buf_allocator.provider_priority` global configuration option (valid + * names are "cma", "system" and "udmabuf") take precedence, followed by + * libcamera's built-in order (CMA heap, system heap, then udmabuf). The first + * provider that is both requested and accessible is used. */ -DmaBufAllocator::DmaBufAllocator(DmaBufAllocatorFlags type) +DmaBufAllocator::DmaBufAllocator(const CameraManager &cm, DmaBufAllocatorFlags type) { - for (const auto &info : providerInfos) { - if (!(type & info.type)) - continue; + std::vector priority; + + /* + * The global configuration can override the provider priority; + * providers not listed are appended in the built-in order, so no + * acceptable provider is ever dropped. + */ + const GlobalConfiguration &configuration = cm._d()->configuration(); + const std::vector providerPriority = + configuration.listOption({ "dma_buf_allocator", "provider_priority" }) + .value_or(std::vector{}); + + for (const std::string &name : providerPriority) { + auto flag = providerFromName(name); + if (flag) + priority.push_back(*flag); + else + LOG(DmaBufAllocator, Warning) + << "Ignoring unknown dma-buf provider \"" + << name << "\""; + } - int ret = ::open(info.deviceNodeName, O_RDONLY | O_CLOEXEC, 0); - if (ret < 0) { - ret = errno; - LOG(DmaBufAllocator, Debug) - << "Failed to open " << info.deviceNodeName << ": " - << strerror(ret); + for (DmaBufAllocatorFlag flag : defaultProviderPriority) { + if (std::find(priority.begin(), priority.end(), flag) == priority.end()) + priority.push_back(flag); + } + + for (DmaBufAllocatorFlag flag : priority) { + if (!(type & flag)) continue; + + for (const auto &info : providerInfos) { + if (info.type != flag) + continue; + + int ret = ::open(info.deviceNodeName, O_RDONLY | O_CLOEXEC, 0); + if (ret < 0) { + ret = errno; + LOG(DmaBufAllocator, Debug) + << "Failed to open " << info.deviceNodeName + << ": " << strerror(ret); + continue; + } + + LOG(DmaBufAllocator, Debug) << "Using " << info.deviceNodeName; + providerHandle_ = UniqueFD(ret); + type_ = info.type; + break; } - LOG(DmaBufAllocator, Debug) << "Using " << info.deviceNodeName; - providerHandle_ = UniqueFD(ret); - type_ = info.type; - break; + if (providerHandle_.isValid()) + break; } if (!providerHandle_.isValid()) diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp index 200e3b58724a9f307922aa9574cd92b5da637378..4ea0f89f700838c4f225fb1c1fac6d9e157fcfb5 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -39,7 +39,7 @@ class Vc4CameraData final : public RPi::CameraData { public: Vc4CameraData(PipelineHandler *pipe) - : RPi::CameraData(pipe) + : RPi::CameraData(pipe), dmaHeap_(*pipe->cameraManager()) { } diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp index e25dd85a7391b61bcea50e71e6264500d1e8a5b3..b8677e69a74d7fd8106022cc0c91ea8595917637 100644 --- a/src/libcamera/pipeline/virtual/virtual.cpp +++ b/src/libcamera/pipeline/virtual/virtual.cpp @@ -238,9 +238,10 @@ bool PipelineHandlerVirtual::created_ = false; PipelineHandlerVirtual::PipelineHandlerVirtual(CameraManager *manager) : PipelineHandler(manager), - dmaBufAllocator_(DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap | - DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap | - DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf) + dmaBufAllocator_(*manager, + DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap | + DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap | + DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf) { } diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index f8efd24424a3981fd3eca03d2fcf27723480d08c..e146a0911d9db4a61e7fa54dd643d4e308458757 100644 --- a/src/libcamera/software_isp/software_isp.cpp +++ b/src/libcamera/software_isp/software_isp.cpp @@ -24,6 +24,7 @@ #include #include "libcamera/internal/bayer_format.h" +#include "libcamera/internal/camera_manager.h" #include "libcamera/internal/framebuffer.h" #include "libcamera/internal/software_isp/debayer_params.h" @@ -81,9 +82,10 @@ LOG_DEFINE_CATEGORY(SoftwareIsp) SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, ControlInfoMap *ipaControls) : ispWorkerThread_("SWIspWorker"), - dmaHeap_(DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap | - DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap | - DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf) + dmaHeap_(*pipe->cameraManager(), + DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap | + DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap | + DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf) { if (!dmaHeap_.isValid()) { LOG(SoftwareIsp, Error) << "Failed to create DmaBufAllocator object";