From patchwork Wed Feb 8 09:59:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 18267 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 6DA68BEFBE for ; Wed, 8 Feb 2023 09:59:33 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AC69E625E3; Wed, 8 Feb 2023 10:59:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675850372; bh=+fQ0GfPJ0+8yoipL+rsZ51osdqVh8E2fj88mMnfAogk=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Xqt2FNuvrOM1EPTJS9HIppBz55PhvKEdIqgjdc8ADZIRX9hHZzZgA/wWqUfJF2cM3 guVTJAGd7b+P4xrQTgWQ5BLFUDc/CCVD2JHBvOIbFNRbHuMa1PPHVpU3GOHrihmTzH TNVK/ZKG5rOVlUU8PrIo3KBj/u278/g8g+3WqRhLwb5N4Hja2McrKW9gusGdcNwKCc wJFOfwHjayTuJVjKFHNtiK9XX3+rmIyMtY4blgPDqRrcz3xauDW/ENnsrmzndZ0XvJ MRSeQi021F2UXMZ3yJuF51OfIP5Q9BC0+fRPulrRkd2+nHXd1HxtoObZMJQBtYRmsg K6ViV1VqLUEIQ== Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7103A625DD for ; Wed, 8 Feb 2023 10:59:30 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Ngp5LsBq"; dkim-atps=neutral Received: by mail-pl1-x632.google.com with SMTP id e19so10754878plc.9 for ; Wed, 08 Feb 2023 01:59:30 -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=9tSJspk9PKE+Vq/At+DvIdGRnF5cyFlM2mPLZGkSu8o=; b=Ngp5LsBqV6kNtguAdpO83y7vCqROA15to9D15wIuTANwyAJ3pd8D5qezq4s0iIrm8F LriD4i4ge4qN+k2fBG3U3AA94HsuwwSUokH2rGhD7pyZVq0gmg/QDBp+S9SCk7NP6NSV 7qA9IVHZnXijKxo/Ir50oBOgRCr+u/avviUjI= 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=9tSJspk9PKE+Vq/At+DvIdGRnF5cyFlM2mPLZGkSu8o=; b=zVZ3NUgeKryxApUrO9wkgFoa2NDyWWfk53Y85k8K+2yo6yv6H3bTwpPLLcaheZhBwS XcU60h6GhS1d/AUcv4Pz7zcWGigz6zzeWOwd/b9XU51DGZdUu8Z+g2bgEwHIH6hhGKWw c4cDNGZaV0ViyeJ3Py5GQ/vbqxrEqRTE3s4MdnrTm6X1SEYUmUI6jBXDpSDMGRPYHMO8 ICEgb5pLuymIaeUm62JrYZBep0TWoRLOb1cR7Xpdz1VLU+Ep154muAruHcG74BTgFyZT G+jmWMytYFbRnGZcHOF5YZoXh2bVNvpekCWlTAteenrX++OUMrb/z7F0yrYpTp3/G661 Y7yw== X-Gm-Message-State: AO0yUKWI2KzGoPaVKj+W4VoYxqP2YajbwEUGkLvZy0ZDukFZajq3LPDg EaeZ92WgKyOKkKBekfyXx/fBtjnn/w1C1kRu X-Google-Smtp-Source: AK7set9yCwwJXJZ7Z/zMWfqCPLKs7AGUpnxbUrBaZ9f8lvboPO658F4jFYZUTsEHjWmgk8PIH3Nrrg== X-Received: by 2002:a05:6a20:4421:b0:bf:58d1:ce83 with SMTP id ce33-20020a056a20442100b000bf58d1ce83mr20806874pzb.2.1675850368416; Wed, 08 Feb 2023 01:59:28 -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 m2-20020a17090a4d8200b00230b8402760sm1077773pjh.38.2023.02.08.01.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 01:59:28 -0800 (PST) X-Google-Original-From: Harvey Yang To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Feb 2023 09:59:19 +0000 Message-Id: <20230208095922.1471175-1-chenghaoyang@google.com> X-Mailer: git-send-email 2.39.1.519.gcb327c4b5f-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 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: Harvey Yang Reply-To: Harvey Yang Cc: Harvey Yang Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi Kieran and all, The series of patches added HeapAllocator, which uses DmaHeap (moved from Raspberry Pi pipeline handler) and UdmaHeap to allocate heap buffers. 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} | 54 +++++--- 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, 360 insertions(+), 58 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} (56%) 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