From patchwork Thu Mar 2 08:13:46 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: 18323 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 17555BF415 for ; Thu, 2 Mar 2023 08:13:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 95E76626C1; Thu, 2 Mar 2023 09:13:57 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1677744837; bh=93X9ynrFJ4UbYfUioUZ9gR+tSIlYWQB27sNjARBPr3s=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=VBc32ReMw/4SH3lOPSwgyqRE5xvI5eDtRnEcOqQ3f0sK7vaRkJkFiMkP3ccrFqFlw YyxVZeEQ48hvKoKzLOEbGPwogg05Z94zBSPX6K0+kfXJ8pqe4yk0++ROAD/ttMWbw1 rMQnaNQlsBtLUUnKZlSYrGeuuWJQxoM6S22tr9/bC9FxPGS/7cWOjaN8SvA8VXVUax eSfeG69jMYmZWJ/RX7yZC4wFMzXmU9BDUkrAZyeMjvcBCCt80e+oOBAX5Tr7NuBqUc Z+xRkoELKl5Uuvvsps9KpOWuCBC4J5ehzVZZWDyUH7OhO6Fr5/ZKgc2ncQelaZdjZI dQCzS9VcRXWhg== Received: from mail-pf1-x435.google.com (mail-pf1-x435.google.com [IPv6:2607:f8b0:4864:20::435]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9EB3A61EDF for ; Thu, 2 Mar 2023 09:13:56 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="bE4h7Pdp"; dkim-atps=neutral Received: by mail-pf1-x435.google.com with SMTP id cp12so8827907pfb.5 for ; Thu, 02 Mar 2023 00:13:56 -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=fqSDexSw2izQs27vhNavnPMDZrsDuDeJ/7ud7dO4OXI=; b=bE4h7PdpSQKp5ChO0xHwmbIJpciaddMDtXXY7bI4Sj61s2+eNQzmBp30HK38w8EOHa 0U42nWlKZu/TAH6ZI6IIECd8mdFDI0iEWEr9aedJduS67UBRPoiRYmS4+H/9Q2fvpenS zEH4DJcNc8NdTYm2prq5TwSwnMscpd0A+EpIU= 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=fqSDexSw2izQs27vhNavnPMDZrsDuDeJ/7ud7dO4OXI=; b=cEYo/IPiUD7s4WNv8oZ7OkoSIj6OfmoxsbKeMSSpDj2jyPVv/kYsptV/n305q6ifnT aXnMSoC1Rykf6V17VHAH8+dPDzOSI8F7c4q+CwbZUOfDYsN4C4XyyDYIAbp8zKDoHZfd az12cnraWedOMzkIXeCriUIs6N2RjOIXdLNmnVs9QJXVpAXxTtKsUkGfGVwdS27jBuHN 1oPBKAD6PwW2HzCUy9op7mw+u4jiTt6Hd6Xiwlw422BvC1p4g5b67/4pcLvrIwwomM31 b/anHA2ShSRu8mrGT9u/GNSjY1bTV54N+jx2mmZUJbItBJWtJcKvcfFECFDg/0MPJfeN Xc7g== X-Gm-Message-State: AO0yUKVIAIgo/pBVn7sN2Qg4eEkylpBYl6aJbVH8szOfZaD+klaGc806 z2gPX4I9D+nvJZ4+CQu7TxMJd/Qjm1Y2rRhM X-Google-Smtp-Source: AK7set/AYk04xs/2s+gsQJEH1pYzDsMUQ1ZvvwhL1czw94ZgCcT17KN8ooK4PDEKRltBKghuhSIAqw== X-Received: by 2002:aa7:98de:0:b0:592:fc9f:8ae5 with SMTP id e30-20020aa798de000000b00592fc9f8ae5mr8019155pfm.23.1677744834840; Thu, 02 Mar 2023 00:13:54 -0800 (PST) Received: from chenghaoyang-low.c.googlers.com.com (112.157.221.35.bc.googleusercontent.com. [35.221.157.112]) by smtp.gmail.com with ESMTPSA id p9-20020aa78609000000b005a8bdc18453sm9179755pfn.35.2023.03.02.00.13.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Mar 2023 00:13:54 -0800 (PST) X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Date: Thu, 2 Mar 2023 08:13:46 +0000 Message-Id: <20230302081349.3334290-1-chenghaoyang@google.com> X-Mailer: git-send-email 2.39.2.722.g9855ee24e9-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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. Fixed the c'tor of DmaHeap, where I incorrectly mixed some udma heap code. 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} | 35 +++--- 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, 342 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} (69%) 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