From patchwork Thu Oct 28 07:30:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 14373 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 7AC9ABDB1C for ; Thu, 28 Oct 2021 07:30:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id AA487600B8; Thu, 28 Oct 2021 09:30:47 +0200 (CEST) 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="GHvlKc7O"; dkim-atps=neutral Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4EC76600B5 for ; Thu, 28 Oct 2021 09:30:46 +0200 (CEST) Received: by mail-pl1-x62b.google.com with SMTP id y1so3796588plk.10 for ; Thu, 28 Oct 2021 00:30:46 -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=fw0NAhhpbdlFTtBrVurrNnk9+ALvqJU0wXsNWlQh7Rg=; b=GHvlKc7OYxeB9wX6XzoAsVSTJE298bl1QmGC4KgebXACIOOjbHFSdiLaXATeEh59F3 d4HFyc2wVUV/n4JJbc1dKSG3PWHWli4j+xieh20queC8enyhzsKhkbzo+fbBOoeGgRTJ j3HCz3pLfC1YCh0h3HuvqLtgC4+KT1DMHywN8= 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=fw0NAhhpbdlFTtBrVurrNnk9+ALvqJU0wXsNWlQh7Rg=; b=2v5kquJl4ii9y960MF4xMShBUtPZQ6CoLGZICY28kQHcwtEh+Zc/ESevhgOUpeoN7e Bztw+K5xScpHsRvggYhXoM+mag9k6e//SX7Xsv7w7iYjWEIXuuzHybdpeFUAkSUugfKz s/va5OqgskxHcxNqy076/q5ZcyFwM3mJcSD3l7bzQrZOnKre7eVH3LQJXiz1QFt7/Hvd LfoJ7xrkDFezQu/PSbFkeaah76+DWHJKA/L3a30pXPBtikJeDS/t2FA+iyw5h9Vq7xR8 etid5UAK7ljO3XeQUw9mLwlzfu+ZAe0h3dT0Atd9Edy5a57xwwpYlHxk5PNJhSF962MR 8LZg== X-Gm-Message-State: AOAM532Yh8HYeTiJJTmzosCo4Rxiad/8QN9G/WOuUjNgkQOVwvBHKet1 +4M/AbAOlvhhQ/iFBakG1wTttH58aHJRnQ== X-Google-Smtp-Source: ABdhPJwhl74XC4GyNWehP+27cMGLJNcOr2YGtuNYgH1fGfhZrKrSz3d/30vMfganQomm6AU8lTad9g== X-Received: by 2002:a17:90a:ce13:: with SMTP id f19mr2759080pju.151.1635406243963; Thu, 28 Oct 2021 00:30:43 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:3f47:e04c:b9be:d02e]) by smtp.gmail.com with ESMTPSA id b13sm6974392pjl.15.2021.10.28.00.30.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 00:30:43 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Thu, 28 Oct 2021 16:30:36 +0900 Message-Id: <20211028073038.653786-1-hiroh@chromium.org> X-Mailer: git-send-email 2.33.1.1089.g2158813163f-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 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. Hirokazu Honda (2): libcamera: framebuffer: Enable attaching additional data to FrameBuffer android: Introduce PlatformFrameBufferAllocator include/libcamera/framebuffer.h | 2 + include/libcamera/internal/framebuffer.h | 1 + src/android/frame_buffer_allocator.h | 55 +++++++ .../mm/cros_frame_buffer_allocator.cpp | 88 +++++++++++ .../mm/generic_frame_buffer_allocator.cpp | 140 ++++++++++++++++++ src/android/mm/meson.build | 6 +- src/libcamera/framebuffer.cpp | 17 ++- 7 files changed, 305 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