From patchwork Fri Oct 30 14:19:35 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 28720 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 72B99C324C for ; Fri, 30 Oct 2026 14:19:44 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E1D8569104; Fri, 30 Oct 2026 15:19:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="SC4uJBml"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="RO5T3l+h"; dkim-atps=neutral Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1AC7B69075 for ; Fri, 30 Oct 2026 15:19:40 +0100 (CET) Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 69UDnCu23468738 for ; Fri, 30 Oct 2026 14:19:39 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=yY4nb1OhSeTVZ0BDYFtq6D krH4I3wv3P4Ywe2QMnc70=; b=SC4uJBml8ir+ATr2/PPjHjxzG2fvFzZJdqtT7q HChs5xwdN9/7hPHu4nNB6qGZS0H1dpvUEn4EQMITKMm/QvpkVzRuHIkqHiygk/sT ivQW6+e7uNKiGWyJyTuuOfhrwlpS9OdiC/vvslkcgNMM6ZjqZSNCxFYQHnOZRKLO 2iUvqP+ax2Q0sN8FMK33qyXXDiCNB9OMmyE9+T61YlCVvzmiuIgEavWDg0Bd6pc9 D7a4V8f6SmLFvChnemb4ZXM5MTDJ5mcrPNm0PVjhRUy5HFNzQLFnDIgPNgEilVg7 1NmOQ+S/iBhvt6vur3rWgqR6nkKDN89zmDTyWYYwGXlXl6Cg== Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hme6qkdj6-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 30 Oct 2026 14:19:39 +0000 (GMT) Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-91c7c7e8becso23526616d6.0 for ; Fri, 30 Oct 2026 07:19:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1793369979; x=1793974779; darn=lists.libcamera.org; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yY4nb1OhSeTVZ0BDYFtq6DkrH4I3wv3P4Ywe2QMnc70=; b=RO5T3l+h1jv/cpfceYMSYhT9qN3eb9uG4utE59HQ+Fa4Kzm7XTZkAOZuczoyy6MlFI apkHxMM1aJUMYnt1TW96ms9avLyvdOTrJAtqxJ9nIO08eD1Uk9805MaRyTeSU4jiPT7w jIFmYuqx/RRrOgsi5RdtR8wrAO+S55ae2q75Amb+yhrW68TWDV4xAq+ZRUWRo7aswZFN TVflrVzIQ1isnII378IoDF/XxlXkxSQ+n9emjuPfMgtxU+AvfNtUrozyWlD82aoTxIDD zOIxrJdD8Jo3HzWFHJskovWQY6VvdmQ78k3zrx5YzcOMugk0goLU23P9z1MzlyfoSq/4 Xhlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793369979; x=1793974779; h=content-transfer-encoding:content-type:mime-version:message-id:date :subject:cc:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to:content-type; bh=yY4nb1OhSeTVZ0BDYFtq6DkrH4I3wv3P4Ywe2QMnc70=; b=TUYEi9tAOwlhmkDJ/3zN4G9eKdhB+itxw8/uIXC7njoELWYsLBQeAvsh3P0O5qaKQm vJ7cF3Yk5EALUY3HEeMxiOGnmTZHGNFNnWKJXYCQtRGJz5q417OTN5bkHNfkCYp5buhJ AdjSfrn5IvqhLEnHYFP+4WuM9MPjV66mRPnTN9yVDGYnvsn6RoQhoQG0EzNu7mUr12nd NaqXIS+9Ku+gC9iiepcABiTwDgBbW010je5gjlRpi0nQlpCAVanKBeljspsdrouCK7Pa 5anbLu9ZL5Tt4hohCRxd00W7ZEsML63ilwZ/Nuom5RGgoDvL/42zZh5vEhK7Nji7TpOt /+Zg== X-Gm-Message-State: AFq9FYIPrrlFvrl/rCez8pEIomXPh5n4Agv10DlX5AD8Fdp07GCRpReT /octRX8V1VcBixa1J8RNk+JbHvfPOO97h1pWfXK8JHSyxteLvsKRnVWIm7xNmUykx5i2ic5wS8U JFGyvCt2bXK8eXNt2IY6NSAvgQIID8xuS4eog//0qVe0CTbWwbpx9HvDZHujCAxuywhTEPGPjPH D8W2wJ+9Q8 X-Gm-Gg: AYBFou3MiqnPCNDv0SuZ/hVAnReO+tWmG8oms6pAQKArngSRWntBIFw7ga6LXB5vWsF 2TlmETRqS3xA61W2VcecYOSlHejIAOZcdnfjDSGw4dKds7Fw3WaKc6u1/JmKljwk4tWEwPGBJpF KcoJvDOwsc/LZBJvD30umndOGQ7wGKdaYkspsJkNgRKT1MhRI8IZjMR5umI9/4Wvkoa7nbMkI7j kXD14o0bRzNFQIBSdgTgWeeLH2yS2vDcBKtJkqJqWxFRy32zCuqolyVR9WMyKyHK4h7gcPGeCZp bWtsm3a8eEhqcuDfVzhXPzI0K+NjoLebvN+yGiwNS/n3XI5WIsRM/qtlCUImPJUcMf/1DeexAUB jlxOhvvGCDWznPCzP1zAg0mHaXUFbhK6LbyMpWsYhxoF7RDeFen5TbUvLS0j2vqi1b+kQfG5Mef WE51hrNJlaDAaoNW+70KhxbshgDzLqHGSvtujB1tAf4uLu2SGxV5ffUlAGoVFrIOw0 X-Received: by 2002:a05:620a:84c4:b0:93e:66e6:fa4 with SMTP id af79cd13be357-94421712a8dmr382547085a.16.1793369978628; Fri, 30 Oct 2026 07:19:38 -0700 (PDT) X-Received: by 2002:a05:620a:84c4:b0:93e:66e6:fa4 with SMTP id af79cd13be357-94421712a8dmr382543085a.16.1793369978180; Fri, 30 Oct 2026 07:19:38 -0700 (PDT) Received: from shalem (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c4cabcfd249sm70777166b.20.2026.10.30.07.19.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 07:19:37 -0700 (PDT) From: Hans de Goede To: libcamera-devel@lists.libcamera.org, Milan Zamazal Cc: Wenmeng Liu , Hans de Goede Subject: [PATCH v2 1/2] libcamera: software_isp: Add AllocCmaDmaBuffers constructor flag Date: Fri, 30 Oct 2026 15:19:35 +0100 Message-ID: <20261030141936.45238-1-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: JqqBJEt1FtqqmJAGoGjlg5AZJHZhpv6q X-Proofpoint-Spam-Info: AW1haW4tMjYxMDMwMDA1NyBTYWx0ZWRfX1/5P7MzvJt+D MqtnpABOMtfk2grroiyNIQ5VpEsnv8we2izglMT/49cGwP12j0skH8pPUazB2pI/D4/HFxB9vDk NLOjuAGbm9gu9xAHIC0hsQ0x/RJzlr8= X-Authority-Analysis: v=2.4 cv=DfSCOftW c=1 sm=1 tr=0 ts=6ae4a77b cx=c_pps a=7E5Bxpl4vBhpaufnMqZlrw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=EUspDBNiAAAA:8 a=KX44GLdWSitf_MgFYFUA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=pJ04lnu7RYOZP9TFuWaZ:22 X-Proofpoint-GUID: JqqBJEt1FtqqmJAGoGjlg5AZJHZhpv6q X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDMwMDA1NyBTYWx0ZWRfXyVdAuMpWigVk 3rDPayRMGwiEdNNHKyozB8WZoznQD3ohq6nawLooKh5KU77e0mgf1G6pOGKUVH0KM6GRcsu4/wZ TzoiV3uKazCfQQYvo7zsr4DtaVfTmhPRGt1WEriwXge8pvSOso4EcE6wUAYtHieAerCCX8W76v7 RDGCdOWv9+Vlufsea0ZZ3NZFPs8RvAf7IbE2zLjTgPQPosmTzBqREsgwn1J8VIN8pfHozmDexTj bTHbQ89krYYCphQnZNImWmnSoh/0a54etoGFP0ZHSHTWMh1rHQzTEm5i/BUJQhw1GrVwEBYk+iQ Ixe/NuPHf5U4UvVfTYUC+RQBEpKq4ibUMMeILK/G3fQhdMxLk0FT1XGG9aL5m1oIIh1Tbk2Q7x3 vWE0tspmiK0+GT/wuWrN9/JQn4hzfXnPPn+G/LHUs9uHHnmDx3a16vx52zo6cp/sfb/MoyAlrKy 4hPgxOF9EaLbOGvlwCg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293, Aquarius:18.0.1176, Hydra:6.1.138, FMLib:17.12.100.49 definitions=2026-10-30_04,2026-10-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 adultscore=0 priorityscore=1501 spamscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610190000 definitions=main-2610300057 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" Allocating DMA buffers from the CMA pool is not necessary on platforms where the expected consumers (GPU, video-encoder) support non contiguous memory and allocating the buffers from the limited CMA pool may cause starvation of that pool for other processes which do actually require CMA. Add a new "SoftwareIspFlags flags" parameter to the SoftwareIsp() constructor, implement a single AllocCmaDmaBuffers flag for now and only request CmaHeap backed DmaBuffers when this flag is set. The only SoftwareIsp() constructor caller is modified to pass the new flag so this patch does not cause any behavior change. clang-format wants to make the lines with the "flags ? cma : none" code one single long line, so disable it for the dmaHeap_() initialization. Signed-off-by: Hans de Goede --- Changes in v2: - Keep SoftwareIsp->dmaHeap_ as an embedded object rather then changing it into a (raw) pointer and use the c++ "member initializer list" construction suggested by Barnabás to conditionally set the types parameter when initializing it --- .../libcamera/internal/software_isp/software_isp.h | 9 ++++++++- src/libcamera/pipeline/simple/simple.cpp | 4 +++- src/libcamera/software_isp/software_isp.cpp | 11 ++++++++--- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h index b64910637..2790e7389 100644 --- a/include/libcamera/internal/software_isp/software_isp.h +++ b/include/libcamera/internal/software_isp/software_isp.h @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -47,8 +48,14 @@ LOG_DECLARE_CATEGORY(SoftwareIsp) class SoftwareIsp : public Object { public: + enum class SoftwareIspFlag { + AllocCmaDmaBuffers = 1 << 0, + }; + + using SoftwareIspFlags = Flags; + SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, - ControlInfoMap *ipaControls); + SoftwareIspFlags flags, ControlInfoMap *ipaControls); ~SoftwareIsp(); int loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; } diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 35e066499..b645227bc 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -618,7 +618,9 @@ int SimpleCameraData::init() * Instantiate Soft ISP if this is enabled for the given driver and no converter is used. */ if (!converter_ && pipe->swIspEnabled()) { - swIsp_ = std::make_unique(pipe, sensor_.get(), &controlInfo_); + swIsp_ = std::make_unique(pipe, sensor_.get(), + SoftwareIsp::SoftwareIspFlag::AllocCmaDmaBuffers, + &controlInfo_); if (!swIsp_->isValid()) { LOG(SimplePipeline, Warning) << "Failed to create software ISP, disabling software debayering"; diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp index 627625b4f..8ab114f63 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/dma_buf_allocator.h" #include "libcamera/internal/framebuffer.h" #include "libcamera/internal/software_isp/debayer_params.h" @@ -76,14 +77,18 @@ LOG_DEFINE_CATEGORY(SoftwareIsp) * \brief Constructs SoftwareIsp object * \param[in] pipe The pipeline handler in use * \param[in] sensor Pointer to the CameraSensor instance owned by the pipeline handler + * \param[in] flags SoftwareIspFlags * \param[out] ipaControls The IPA controls to update */ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor, - ControlInfoMap *ipaControls) + SoftwareIspFlags flags, ControlInfoMap *ipaControls) : ispWorkerThread_("SWIspWorker"), - dmaHeap_(DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap | + /* clang-format off */ + dmaHeap_(DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf | DmaBufAllocator::DmaBufAllocatorFlag::SystemHeap | - DmaBufAllocator::DmaBufAllocatorFlag::UDmaBuf) + ((flags & SoftwareIsp::SoftwareIspFlag::AllocCmaDmaBuffers) ? + DmaBufAllocator::DmaBufAllocatorFlag::CmaHeap : + DmaBufAllocator::DmaBufAllocatorFlag{})) /* clang-format on */ { if (!dmaHeap_.isValid()) { LOG(SoftwareIsp, Error) << "Failed to create DmaBufAllocator object"; From patchwork Fri Oct 30 14:19:36 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 28721 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 539F4C324C for ; Fri, 30 Oct 2026 14:19:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B06F769108; Fri, 30 Oct 2026 15:19:45 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.b="WCrdVLm5"; dkim=pass (2048-bit key; unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="CkBz7QSc"; dkim-atps=neutral Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 566D969102 for ; Fri, 30 Oct 2026 15:19:42 +0100 (CET) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 69UDnFVZ4019690 for ; Fri, 30 Oct 2026 14:19:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=0gy1LvqFGai MSAKr99NNv9bxS8kOglUJ8SkFFOdTs2Y=; b=WCrdVLm5B0LRj4UeYZqWVF/Cdm6 IVY4Gyi7pz2wOXYOiz7jla1EMMSPp+0yTNjGidD02mJr23ILAEUkowvBbdmb/O8K Pie1SG/Jle4wlINSdBFviHLHPty9BNJnUwC0zdgGRp24hKwhkZeUvBtiLAd5lCp8 mKF0oPT9gInipBqW01lviAcZwTFfa4LUBg8K0UfeVutjDrXOkV1yQNLXgpn6uDgh okM6NqH/BQt/jWr8YudbClfwvIv8dKa6YF3Tcc/EzVwWW24mGBWFUXa7bTTPwdxz wqGeO9trrAfbWqV3cGWhmRFJblWqrWhg3aKPRd8xyzA3UjkA1Xv+HI1I+Fw== Received: from mail-qk1-f200.google.com (mail-qk1-f200.google.com [209.85.222.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4hme6qken5-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 30 Oct 2026 14:19:40 +0000 (GMT) Received: by mail-qk1-f200.google.com with SMTP id af79cd13be357-93cb93c874bso348742885a.0 for ; Fri, 30 Oct 2026 07:19:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1793369980; x=1793974780; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=0gy1LvqFGaiMSAKr99NNv9bxS8kOglUJ8SkFFOdTs2Y=; b=CkBz7QScX2n8QT6RJH4habnXGzqPUhO/fMc7obVJXIhSi0vUkQh+ktodoGNkg4vn4B ZOtnQjuObN5jqnJ/FPSHbgbnVBGwBI4Ii5OftG2/P3ro93e8cYyfx2E3zHyQATuq+Ulb JFiXtw0zsB+ZGZlNZI67aYp+AFf65MFcY3v6gYQgAkdVeyq9nQYA6hhcV8TZfhdg77wV s0khJgBX1fLA8oEcO9T6wZqtShC6tXdXQrde7vsb81+w6pb4caDuPH0hhzOUWIXpR9rp r3yQ0nSx9AOnue50s2ERaGRBYqR+sdepxcrqm72jkTQMAu0iYzZ25enk+1KmDwGJuaQv ZhxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1793369980; x=1793974780; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=0gy1LvqFGaiMSAKr99NNv9bxS8kOglUJ8SkFFOdTs2Y=; b=xItg+gvtlRuoQq2rUVP+jx6A/CzQut3ESN3CuMvxkVEGctS6E6tbt40fgElL1TxxKD hxhasqVFN/Ikhp5x8qwVRmgnyhdwQb0DMBl9bJaadEpsYrbDO+jW3iMRy1rxq3uWWiFj th+pJOghRHaXO7uSQkOtQMP5DvcLcTNsbyc+Ss7xG1nWIkakAhu78ZdCdrIspuyOd/2h tIoee//hoTX56BNqPLI3o6QpbXKu04sBwhMKDvlTuK9A0H0ETqn0RRlcli1M4InhWnZI 4ztR+zyOsjKexbzVBxdY4LP8PheV3JZ7/z5MpgQVb8Ib5uMYyLNOK3LdSHuSip4wArn5 dK6A== X-Gm-Message-State: AFq9FYLkkyFkWMaMO4d1k171msyw4MH0fjMlUGMUtq30niaFqXYC3q16 f5LyZ+UowXYL+I8aSPn3gVNzOUYICfX8cXr/rAFj78+Mwj+lVzpKREI04V3Nle/yC/e9Fbkhl/T OeqyVEgW8YnocezIp23GdKMs7A/WIhXvy3qbyqJ9alckkQG4+wIRjHZtsyMuoMfLWDZxLiTAv0N aYmHmNtQFA X-Gm-Gg: AYBFou1B3O/3sRDK7NCNJ48eK+00556TI1dUvehfoTtDpjXG1enoUslYyINep12X4h9 MGqqYydkG9/PPUgVRlsdWBtRnTMRLB48NXIkLtOWglWN2SFvFgLGX23xTN0olDE5CKMXxYxUxB5 zniXhMYqQkhBxuILzUAAoNzPDBeyagEOwmIpbTjMVLanVf9uRoesEbJFmq5yBFhBecBhnp/s9fP J7icL7CYoXJvfNMNctvUCIDnEmKMSIxMX68rahsrLo1d5R87/VlzNeElbMyLYFpcDVfa1PHcUvP 09VIksPVKh4QzBMENIoq0469WjDe/Psy1z+Y5taQABP/gjKvZ0r/cdE9nptY+h/n06Q2xqc6WEY dxxLkHK2pkHflRQ+JXazCleyB2G4465RXJ6t77LxBNR3vbSXLOMiTeHe8RwivHlo+OISWZYdS0x 8kseiw5m9XBjlEpn510Pq4dnQHrEwYhHcNWer/Q9lPqGRYjDqe2I42/eyUOPe/qByz X-Received: by 2002:a05:620a:3185:b0:943:e872:f521 with SMTP id af79cd13be357-94413358c99mr873270085a.9.1793369979907; Fri, 30 Oct 2026 07:19:39 -0700 (PDT) X-Received: by 2002:a05:620a:3185:b0:943:e872:f521 with SMTP id af79cd13be357-94413358c99mr873265285a.9.1793369979434; Fri, 30 Oct 2026 07:19:39 -0700 (PDT) Received: from shalem (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c4cabcfd249sm70777166b.20.2026.10.30.07.19.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Oct 2026 07:19:38 -0700 (PDT) From: Hans de Goede To: libcamera-devel@lists.libcamera.org, Milan Zamazal Cc: Wenmeng Liu , Hans de Goede Subject: [PATCH v2 2/2] libcamera: pipeline: simple: Do not alloc CMA DMA-buffers for camss and ipu6/7 Date: Fri, 30 Oct 2026 15:19:36 +0100 Message-ID: <20261030141936.45238-2-johannes.goede@oss.qualcomm.com> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261030141936.45238-1-johannes.goede@oss.qualcomm.com> References: <20261030141936.45238-1-johannes.goede@oss.qualcomm.com> MIME-Version: 1.0 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMDMwMDA1NyBTYWx0ZWRfXwFYQTyQWIYtY DLn44INC59xZRStmge+w2xneNUyV8WiIpc9TfeMXWY46etvzHZDfpSJkFKFrw+bYiWN6s84ytJ0 tFJZ+t+9K3Tdl9OFXK5KUC846UAvzFlByoYKomOvCH2Neld6GtzrbE2vWWGfz5XnVLx+QNeeIRx lPiMKCCznj5FG5xMUlIhDNWoQ3DNQB/GXzlIHMrDm5PVM6yIigtFRCBssFFUm9Hpsnq/sbH0eWq auOUbzPnha/Afm96lxcE5XYELPeuhSha4r1ztsKrvkSudEqZip/sz2P+TMIPLHjm1YZTchHa1gn D/kJYfq54JUGgzBAWhck8nkmrd6TTsxMYs5FEEeQmO3LwKR0E5XSX2KVJttSaByWKZNevDGk6Em RZnBBpV+FFDpTGsVryBBp2+Prex+bhU66qLFZpZioLgHx/gyCBlFGxy87dv6JINVteIH/m0/OD9 cJLt3ZtLT4BfnSqkg+A== X-Proofpoint-ORIG-GUID: gwu53OApelal5bSRr8hTFfZMsJHGLRQT X-Authority-Analysis: v=2.4 cv=IeoSymqa c=1 sm=1 tr=0 ts=6ae4a77c cx=c_pps a=hnmNkyzTK/kJ09Xio7VxxA==:117 a=xqWC_Br6kY4A:10 a=660iZSQnnn4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=YAyIRdgMAAAA:8 a=EUspDBNiAAAA:8 a=20KFwNOVAAAA:8 a=nlI6UJXUNSGddTINY3AA:9 a=PEH46H7Ffwr30OY-TuGO:22 a=o1rO4XtwZBNj6n05oSJ_:22 X-Proofpoint-Spam-Info: AW1haW4tMjYxMDMwMDA1NyBTYWx0ZWRfX326KdwTGq/A4 /ZBlj6/q4ZZhZRy1VRAgLOpGI4JP0LWCZa++KwGk1ohppzij7SlhRvH/gQbv3Wwx2/bJlGL91yB hPpzv+4eekCXwauDwQj4vqQ/u44USec= X-Proofpoint-GUID: gwu53OApelal5bSRr8hTFfZMsJHGLRQT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293, Aquarius:18.0.1176, Hydra:6.1.138, FMLib:17.12.100.49 definitions=2026-10-30_04,2026-10-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 adultscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 malwarescore=0 impostorscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610190000 definitions=main-2610300057 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" On Qualcomm platforms with the camss CSI receiver block it is not necessary to allocate DMA-buffers from CMA and doing so may lead to starvation of the CMA pool for other processes. On Intel IPU6 / IPU7 there typically is no CMA memory reservation at all so trying to use memory from there is not useful. Reported-by: Wenmeng Liu Closes: https://lists.libcamera.org/pipermail/libcamera-devel/2026-September/062125.html Reviewed-by: Milan Zamazal Signed-off-by: Hans de Goede --- src/libcamera/pipeline/simple/simple.cpp | 25 ++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index b645227bc..cf419e811 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -252,20 +252,22 @@ struct SimplePipelineInfo { * The Software ISP can't be used together with the converters. */ bool swIspAllowed; + /* Flags controlling Software ISP behavior. */ + SoftwareIsp::SoftwareIspFlags swIspFlags; }; namespace { static const SimplePipelineInfo supportedDevices[] = { - { "dcmipp", {}, false }, - { "imx7-csi", { { "pxp", 1 } }, true }, - { "intel-ipu6", {}, true }, - { "intel-ipu7", {}, true }, - { "j721e-csi2rx", {}, true }, - { "mtk-seninf", { { "mtk-mdp", 3 } }, false }, - { "mxc-isi", {}, false }, - { "qcom-camss", {}, true }, - { "sun6i-csi", {}, false }, + { "dcmipp", {}, false, {} }, + { "imx7-csi", { { "pxp", 1 } }, true, SoftwareIsp::SoftwareIspFlag::AllocCmaDmaBuffers }, + { "intel-ipu6", {}, true, {} }, + { "intel-ipu7", {}, true, {} }, + { "j721e-csi2rx", {}, true, SoftwareIsp::SoftwareIspFlag::AllocCmaDmaBuffers }, + { "mtk-seninf", { { "mtk-mdp", 3 } }, false, {} }, + { "mxc-isi", {}, false, {} }, + { "qcom-camss", {}, true, {} }, + { "sun6i-csi", {}, false, {} }, }; bool isRaw(const StreamConfiguration &cfg) @@ -430,6 +432,7 @@ public: V4L2Subdevice *subdev(const MediaEntity *entity); std::shared_ptr converter() { return converter_; } bool swIspEnabled() const { return swIspEnabled_; } + SoftwareIsp::SoftwareIspFlags swIspFlags() const { return swIspFlags_; } protected: int queueRequestDevice(Camera *camera, Request *request) override; @@ -463,6 +466,7 @@ private: std::shared_ptr converter_; bool swIspEnabled_ = false; + SoftwareIsp::SoftwareIspFlags swIspFlags_; }; /* ----------------------------------------------------------------------------- @@ -619,7 +623,7 @@ int SimpleCameraData::init() */ if (!converter_ && pipe->swIspEnabled()) { swIsp_ = std::make_unique(pipe, sensor_.get(), - SoftwareIsp::SoftwareIspFlag::AllocCmaDmaBuffers, + pipe->swIspFlags(), &controlInfo_); if (!swIsp_->isValid()) { LOG(SimplePipeline, Warning) @@ -1964,6 +1968,7 @@ bool SimplePipelineHandler::matchDevice(std::shared_ptr media, */ numStreams = 2; swIspEnabled_ = true; + swIspFlags_ = info.swIspFlags; } else if (converter.dev) { converter_ = std::move(converter.dev); numStreams = converter.streams;