From patchwork Mon Nov 1 07:16:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14432 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 CE951BF415 for ; Mon, 1 Nov 2021 07:17:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0AC56600C3; Mon, 1 Nov 2021 08:17:02 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="OqJzuZuh"; dkim-atps=neutral Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 30A97600B6 for ; Mon, 1 Nov 2021 08:17:00 +0100 (CET) Received: by mail-pj1-x102b.google.com with SMTP id t5-20020a17090a4e4500b001a0a284fcc2so15393817pjl.2 for ; Mon, 01 Nov 2021 00:17:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vwPtrF6AMTuTKzHxSz5dWPADtvxJX2RDI5ZfO8iG15M=; b=OqJzuZuhAmjCVm9WTt9FGOEvFz7U7yMHAAAqeUchkZwl2qa/z5vKIuRUMampnqwFxn kQAFtpGtlDAX7feRizjbeoSsrlIFuo+2/EFYfsh1vj5z76Sx5ehIfYGZ5R3rm7E6XMxL NMgBGSlSgP8MfVcTT8CG/Az7ACtabFMiDLu3U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=vwPtrF6AMTuTKzHxSz5dWPADtvxJX2RDI5ZfO8iG15M=; b=7cMA9arI0N5WErM9tI4YV3vRnH1kv2mK1Wmc/5Fa1vT6sK/NvzVGFyLvQT9Ig84L5U M6LcFYv5uubE2j+Yg9fQQ4txyWwEakJ9OkJh8l57CICuz7fiGw0U5wraLSrpxckv0G42 NaH9jC8BMcZL0Pp9IRGiBKgmN87I31BXcai8t9xogG52P5DQT6GXp8MhKW7aOtLkWUvF jV394LTjAKA8KaR5xyZF+znst3bKWB54wH8PMgDdcrANeCDmyznDsutz7zeFqz0Bayeh vYacW8dltpIyfX4WC1UQ5NKfkx+7e6TCNr+8LNOLXBU1iWwlHu1h7PD9HNnsxEjpK8nl ZoLQ== X-Gm-Message-State: AOAM533fsk1s6V5aCP2k1jXUghSio7Ks+frjPpSg45lQmSkXQk/qSehi vo4YgEjX9PnwsXBVQSwx31E+9eqoYa18xQ== X-Google-Smtp-Source: ABdhPJygDFl8CCmr1s7O4CG4x7Je+Ewsvb/pf8FMGY9XocbP8z1Y0bzOpaQRz8ieX51XB7muLKnzyQ== X-Received: by 2002:a17:90a:c58f:: with SMTP id l15mr13776248pjt.168.1635751018094; Mon, 01 Nov 2021 00:16:58 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:3b39:f865:c90:680a]) by smtp.gmail.com with ESMTPSA id g14sm11910879pgo.88.2021.11.01.00.16.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Nov 2021 00:16:57 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 1 Nov 2021 16:16:50 +0900 Message-Id: <20211101071652.107912-1-hiroh@chromium.org> X-Mailer: git-send-email 2.33.1.1089.g2158813163f-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/2] Introduce PlatformFrameBufferAllocator 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" This is the initial work towards unifying identical stream requests by HAL client to a single stream configuration request to a camera. My previous patch (https://patchwork.libcamera.org/patch/13592/) has been reverted because it has the edge case that all the capture requests are resolved to CameraStream::Type::Mapped. That is, no buffer to be written by a native camera is provided. I resolve this problem by dyanically allocating a required FrameBuffer upon requesting such captrues. This patch series introduce PlatformFrameBufferAllocator for that. Note that the exting FrameBufferAllocator cannot used for this purpose, because it is not allowed to be used while Camera is running. Change in v2: - Address Jacopo's comments Hirokazu Honda (2): libcamera: framebuffer: Enable attaching additional data to FrameBuffer android: Introduce PlatformFrameBufferAllocator include/libcamera/framebuffer.h | 3 + include/libcamera/internal/framebuffer.h | 1 + src/android/frame_buffer_allocator.h | 54 +++++++ .../mm/cros_frame_buffer_allocator.cpp | 90 +++++++++++ .../mm/generic_frame_buffer_allocator.cpp | 144 ++++++++++++++++++ src/android/mm/meson.build | 6 +- src/libcamera/framebuffer.cpp | 26 +++- 7 files changed, 320 insertions(+), 4 deletions(-) create mode 100644 src/android/frame_buffer_allocator.h create mode 100644 src/android/mm/cros_frame_buffer_allocator.cpp create mode 100644 src/android/mm/generic_frame_buffer_allocator.cpp --- 2.33.1.1089.g2158813163f-goog