From patchwork Tue Feb 14 09:37:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cheng-Hao Yang X-Patchwork-Id: 18280 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 319A5BDB1C for ; Tue, 14 Feb 2023 09:37:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6597B625F5; Tue, 14 Feb 2023 10:37:44 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1676367464; bh=QK6fuipJ9lB9I9xylKKEwbcjqNFLSwLeweQJ1f9aXhs=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=2r0y2lvRrFr9+FdsBHYEZ8DTf2pxoC2y2vx0qJc+7AXx+Ija40f5j4vbvTlGxCxxx y+maWm6O+DNcbmnMeeveLX3bYHdmnQr5o0sd6Q5wE+bpWKj5T6y/rl9fBsR9Hmq1Wa L4GRNgXNqCEX8TRAunD5AGTjv3vRbzm3AICx52ArvUr7MnxJSCKeDlyCkDOIog+Exk raixmMsy5vVKHxAJgH8ZWJy0SRRmNd0HXCrJ1Q2/gHlbsr5AlQIcPuKxD9r4zsdm59 TSUcRvfezuUF6tuFQ1hn9CBCsktGLqvuwooKTHTamzHB+XzDK9O4FH0+KRGcKNLB+F czbe1MSt8gT/w== Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E73BA61EEC for ; Tue, 14 Feb 2023 10:37:42 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TKMW0v5B"; dkim-atps=neutral Received: by mail-pf1-x42d.google.com with SMTP id s20so9762701pfe.2 for ; Tue, 14 Feb 2023 01:37:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=YO1agUYBNTXDg2SZ9UlMrpgTsftMbnP2RhoQtd2olMs=; b=TKMW0v5Bnp5VFUhL8C/Ob6vfYeYhNmHdBtraD0mdFXhme7X6Pumg6OkCk/pBWdRRa7 Fw7w2fLnCkfNo3pV6sNgEsLm/ooEQzJhkuNsCRMf30G2wcomtxyBRsBY+OLSU9Ktk9Kj NHoS1mYJ2lwyrIdQidfUYiOd9hHHuUnFAzRBk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=YO1agUYBNTXDg2SZ9UlMrpgTsftMbnP2RhoQtd2olMs=; b=6hPsiK/vT6DIh2aQjeWAeGVMHX9i9JphEFIRq/WhXBD7/BatJfsIE2b8TPMNbg/HqO 7CDFN25YTs6IZ1pX1ZYfMGju4fE99urCEk0DS6uQu5hgzby3mBvj78KtZbxiMr56R0mJ J7ALWYsLGiytGMtLXYuelOJmXux6YGHISlv1oF9lwQB2EBKFz7CBM03UmsLVfsZGUOxL XgH7FP5P7fn6hHMOqmjIG/Q4iHrNxevt4Bhi9GfHBfgFfw6l5VT+vHRU5v7WTTmWlfa0 oMxIpkaRsxlaHnMy9AHlJY7pzRMWCZ3xLUZuEf+GdcGUkjl1o0eDQZMH5IAH1fQRvKFn Qb5w== X-Gm-Message-State: AO0yUKUF/GQUrIfFqnuNePyTYAvk5YW6HOzaNKmlQytx0/rOWW68BiLQ +dLkM8VKkQ9Vmlc4NtftskCQNC8kGmSPKE0J X-Google-Smtp-Source: AK7set+w3vTr0vP+mSUSZmvJWukJbUyO0RuWYKNWi9qaRaTA84zj4R0b95i2MpcOZY7liTrATseePg== X-Received: by 2002:a62:8412:0:b0:5a8:2b95:badd with SMTP id k18-20020a628412000000b005a82b95baddmr1519124pfd.33.1676367461033; Tue, 14 Feb 2023 01:37:41 -0800 (PST) Received: from chenghaoyang-low.c.googlers.com.com (46.165.189.35.bc.googleusercontent.com. [35.189.165.46]) by smtp.gmail.com with ESMTPSA id z9-20020aa791c9000000b0059416691b64sm9696172pfa.19.2023.02.14.01.37.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 01:37:40 -0800 (PST) X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Date: Tue, 14 Feb 2023 09:37:33 +0000 Message-Id: <20230214093736.4067033-1-chenghaoyang@google.com> X-Mailer: git-send-email 2.39.1.581.gbfd45094c4-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/3] Add HeapAllocator 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: , X-Patchwork-Original-From: Harvey Yang via libcamera-devel From: Cheng-Hao Yang Reply-To: Harvey Yang Cc: Harvey Yang Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi all, The series of patches added HeapAllocator, which uses DmaHeap (moved from Raspberry Pi pipeline handler) and UdmaHeap to allocate heap buffers. Updated Dma's & Udma's copyright info according to Dave's & Kieran's comments. Let me know if I mis-overwrite the copyright info again :( I've only build-test it, and I'll need to test it on my virtual pipeline handler patches, but please take a look and let me know if it makes sense. Thanks! BR, Harvey Harvey Yang (3): libcamera: Move DmaHeap to HeapAllocator as a base class libcamera: Add UdmaHeap if DmaHeap is not valid libcamera: Add exportFrameBuffers in HeapAllocator include/libcamera/dma_heap.h | 20 +++ include/libcamera/heap.h | 27 ++++ include/libcamera/heap_allocator.h | 40 ++++++ include/libcamera/meson.build | 4 + include/libcamera/udma_heap.h | 20 +++ .../dma_heaps.cpp => dma_heap.cpp} | 52 +++++--- src/libcamera/heap_allocator.cpp | 90 ++++++++++++++ src/libcamera/meson.build | 3 + .../pipeline/raspberrypi/dma_heaps.h | 32 ----- .../pipeline/raspberrypi/meson.build | 1 - .../pipeline/raspberrypi/raspberrypi.cpp | 10 +- src/libcamera/udma_heap.cpp | 117 ++++++++++++++++++ 12 files changed, 359 insertions(+), 57 deletions(-) create mode 100644 include/libcamera/dma_heap.h create mode 100644 include/libcamera/heap.h create mode 100644 include/libcamera/heap_allocator.h create mode 100644 include/libcamera/udma_heap.h rename src/libcamera/{pipeline/raspberrypi/dma_heaps.cpp => dma_heap.cpp} (58%) create mode 100644 src/libcamera/heap_allocator.cpp delete mode 100644 src/libcamera/pipeline/raspberrypi/dma_heaps.h create mode 100644 src/libcamera/udma_heap.cpp