From patchwork Mon Aug 16 04:31:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13359 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 533EAC3241 for ; Mon, 16 Aug 2021 04:31:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3834368894; Mon, 16 Aug 2021 06:31:49 +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="EafXNiny"; dkim-atps=neutral Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4CFF26888A for ; Mon, 16 Aug 2021 06:31:48 +0200 (CEST) Received: by mail-pl1-x62e.google.com with SMTP id a5so19385681plh.5 for ; Sun, 15 Aug 2021 21:31:48 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=O8KjuN3pQ3H8El8/lL+5eqPsdn/Esip4kifoaHHNeUs=; b=EafXNinylckofYhe9+3Le9A6tfmOfYTlYt/GM8jXO1FiIfcaFUO2/ka/egUutpZo5f o6grWE/p1/oqcZzm/srRIXgacg31fymXVXYvcnCAUp+DF1ESdD3piQo+r9z+bmPC507q CEE1wRL83FIXA4PxleDd8xbiXsk3NZXs87nIY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O8KjuN3pQ3H8El8/lL+5eqPsdn/Esip4kifoaHHNeUs=; b=DcggiVtsRnTVD9T4J9dndKt5CWi1jXTU3HgjlS5iyv7UxPlXcjbHnXIhdqH8lVBOoy 7C49+Jo0lhuqlwDhPd0CFSX635MdiPZ8vAIsktZeUY6oxOhPf1kUPCb83LM6YQ5CXjvP Bvj4jIhweb4opBl2lwGyiE1Q29s+DKlBoPIE37bIVeelQmx78TtzIMMluDjACuI22EkM BXzWx9ECNDtIy4JUzKLijpHoiaFM9WYl2r3iRJrDQlNFDWhs4DCS8xpQHL/86xmKovyd r2L/rMnToUZEeOyuzl0zWF9wyzX6Z3zVlZTaV2z8DS46eRa/TUdV4fJeQsfoSnSdChHt 3llA== X-Gm-Message-State: AOAM531LMLlYNDnTdoXCAGv4D7GEiGfADE51kGxylhV41lO3s0OzsUR9 z+oL6J8lbbPnd6FRiSVg4bcVFZc9eSrIMw== X-Google-Smtp-Source: ABdhPJyuwbWJdc4C2F7LKtm4iSIM3OmJ5c9qXmsMeisqTLDe2G577h11p+gKXXp/yr4NQFRNOgeMRg== X-Received: by 2002:a17:90a:4d8e:: with SMTP id m14mr15153782pjh.106.1629088306426; Sun, 15 Aug 2021 21:31:46 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:6f5f:1479:a6ab:4229]) by smtp.gmail.com with ESMTPSA id u10sm2767417pgj.48.2021.08.15.21.31.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 21:31:46 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 16 Aug 2021 13:31:29 +0900 Message-Id: <20210816043138.957984-2-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog In-Reply-To: <20210816043138.957984-1-hiroh@chromium.org> References: <20210816043138.957984-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 01/10] libcamera: framebuffer: Add offset to FrameBuffer::Plane 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 adds offset to FrameBuffer::Plane. It enables represents V4L2 multi-planar format and mapping with MappedFrameBuffer. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- include/libcamera/framebuffer.h | 1 + src/libcamera/framebuffer.cpp | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/libcamera/framebuffer.h b/include/libcamera/framebuffer.h index 28307890..5de3c744 100644 --- a/include/libcamera/framebuffer.h +++ b/include/libcamera/framebuffer.h @@ -42,6 +42,7 @@ class FrameBuffer final : public Extensible public: struct Plane { FileDescriptor fd; + unsigned int offset; unsigned int length; }; diff --git a/src/libcamera/framebuffer.cpp b/src/libcamera/framebuffer.cpp index 42c73134..1d7d5ea3 100644 --- a/src/libcamera/framebuffer.cpp +++ b/src/libcamera/framebuffer.cpp @@ -131,7 +131,7 @@ FrameBuffer::Private::Private() * * The static information describes the memory planes that make a frame. The * planes are specified when creating the FrameBuffer and are expressed as a set - * of dmabuf file descriptors and length. + * of dmabuf file descriptors, offset and length. * * The dynamic information is grouped in a FrameMetadata instance. It is updated * during the processing of a queued capture request, and is valid from the @@ -151,8 +151,8 @@ FrameBuffer::Private::Private() * * Planar pixel formats use multiple memory regions to store the different * colour components of a frame. The Plane structure describes such a memory - * region by a dmabuf file descriptor and a length. A FrameBuffer then - * contains one or multiple planes, depending on the pixel format of the + * region by a dmabuf file descriptor, an offset and a length. A FrameBuffer + * then contains one or multiple planes, depending on the pixel format of the * frames it is meant to store. * * To support DMA access, planes are associated with dmabuf objects represented @@ -170,6 +170,11 @@ FrameBuffer::Private::Private() * \brief The dmabuf file descriptor */ +/** + * \var FrameBuffer::Plane::offset + * \brief The plane offset in bytes +*/ + /** * \var FrameBuffer::Plane::length * \brief The plane length in bytes