From patchwork Wed Oct 9 07:41:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harvey Yang X-Patchwork-Id: 21552 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 6C8F9C32DE for ; Wed, 9 Oct 2024 07:46:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6B7506536B; Wed, 9 Oct 2024 09:46:51 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="U/AZMujx"; dkim-atps=neutral Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0104963527 for ; Wed, 9 Oct 2024 09:46:48 +0200 (CEST) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-7e9f355dd5dso1628321a12.0 for ; Wed, 09 Oct 2024 00:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1728460007; x=1729064807; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Mz3u/94bnCh/U98/PtkSENxw8Rhg8Nixu9hDJQxJ93U=; b=U/AZMujxXlxw6O0/JUwsx+A70qxSj0GJ3CiX4Nbgox7wUkzYDFzUdDlas7Kex/32Jr S2VjTIgYxE0Son/zgY1zpDiO6E6RKVuOyYBzIktIobeWHBDewHP1lOORyypgN4CXM4vm AD9N80rE8gVmdOHGG+ikWDxE1R3P04EdnQ7nw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728460007; x=1729064807; 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=Mz3u/94bnCh/U98/PtkSENxw8Rhg8Nixu9hDJQxJ93U=; b=Ak/dGZkSFTmpgSl9947nEej1ClEU6y+awtfuy23lk+c5evalH3ICUpqKGRK4Jf5Des Ce7Ivwy4uNJazdpWoekn7ZjWFbPY/X+Rri7HAo9WhvoGwZCpbwHyoiWWV3EUCavn2KYh LIuOKFlISCQmZ88MD2i9FqXj9V/MvScfibQ6XhidiorSUAYtclOir4skkOUwTBxkSpk/ lLkxu+AJiWx4Iyf813XThTQGE2UheyIaZfTVaDvApfdMVgXsGXVInLgUH/v7l4gqOmO6 XoDYHf2rEjiUfoVtyS4IStHfCXF3DDXWGIZiNWtwmagPBHv9KNlhTI87GNXJC3XJ4zw1 gijQ== X-Gm-Message-State: AOJu0YxjXgAkq/VIxkQpGRfhAy2Ia7Wu5EOc2WRH/M3bD80r9w1YZs24 03P24PjRcR2dlCgISWvf4Ah0e5WqphcTWDxxA/krnPShQYhsUQC5uO3xwll1XX29NmKHXx3SZjc = X-Google-Smtp-Source: AGHT+IHi1jp6secJM6TCIuPKHg0AIasr2KWPa+YfCnmPKox4AsZFm73DCUrEOhqqhII6+Y04NeRz0Q== X-Received: by 2002:a05:6a20:db0c:b0:1d4:becc:6eeb with SMTP id adf61e73a8af0-1d8a3c5e4e1mr2616327637.31.1728460006998; Wed, 09 Oct 2024 00:46:46 -0700 (PDT) Received: from chenghaoyang-low.c.googlers.com.com (199.211.81.34.bc.googleusercontent.com. [34.81.211.199]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e2a57077c2sm944414a91.17.2024.10.09.00.46.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Oct 2024 00:46:46 -0700 (PDT) From: Harvey Yang To: libcamera-devel@lists.libcamera.org Cc: Harvey Yang Subject: [PATCH 0/5] Add InfoFrame Date: Wed, 9 Oct 2024 07:41:18 +0000 Message-ID: <20241009074642.2965791-1-chenghaoyang@chromium.org> X-Mailer: git-send-email 2.47.0.rc0.187.ge670bccf7e-goog MIME-Version: 1.0 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" Hi folks, This series of patches adds MailBox, Pool and InfoFrame as helper classes, which are useful to save duplicated code in the upcoming mtkisp7 implementation. We also think that they're helpful for other pipeline handlers. It's based on the `Add VirtualPipelineHandler` series, as one of the patch updates struct FrameBuffer. We can also check if we should append DmaBufAllocator to support strideAlign and scanAlign, so that InfoFramePool can save some duplicated code. It passed the gitlab pipeline: https://gitlab.freedesktop.org/chenghaoyang/libcamera/-/pipelines/1286167 Please take a look. Thanks! BR, Harvey Han-Lin Chen (2): libcamera: Add mailbox template helper libcamera: format: Extend plane size calculation to accept scanline alignment Harvey Yang (3): libcamera: Add template for pool implementation libcamera: Add stride in FrameBuffer::Plane libcamera: Add InfoFrame implememtation include/libcamera/framebuffer.h | 1 + include/libcamera/internal/formats.h | 5 +- include/libcamera/internal/info_frame.h | 105 ++++++++ include/libcamera/internal/mailbox.h | 75 ++++++ include/libcamera/internal/meson.build | 3 + include/libcamera/internal/pool.h | 119 ++++++++++ src/libcamera/dma_buf_allocator.cpp | 3 +- src/libcamera/formats.cpp | 17 +- src/libcamera/framebuffer.cpp | 5 + src/libcamera/info_frame.cpp | 302 ++++++++++++++++++++++++ src/libcamera/ipa_data_serializer.cpp | 3 + src/libcamera/mailbox.cpp | 60 +++++ src/libcamera/meson.build | 3 + src/libcamera/pool.cpp | 70 ++++++ 14 files changed, 764 insertions(+), 7 deletions(-) create mode 100644 include/libcamera/internal/info_frame.h create mode 100644 include/libcamera/internal/mailbox.h create mode 100644 include/libcamera/internal/pool.h create mode 100644 src/libcamera/info_frame.cpp create mode 100644 src/libcamera/mailbox.cpp create mode 100644 src/libcamera/pool.cpp