From patchwork Wed Aug 25 04:44:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13478 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 BFB89BD87C for ; Wed, 25 Aug 2021 04:44:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 20894688A3; Wed, 25 Aug 2021 06:44:25 +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="JzE/fYTd"; dkim-atps=neutral Received: from mail-pg1-x535.google.com (mail-pg1-x535.google.com [IPv6:2607:f8b0:4864:20::535]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D5B6E60257 for ; Wed, 25 Aug 2021 06:44:22 +0200 (CEST) Received: by mail-pg1-x535.google.com with SMTP id t1so21891125pgv.3 for ; Tue, 24 Aug 2021 21:44:22 -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=HFWiZ7/46hvLig4tJBBwK/difHzvrUqpECM3jt3/+54=; b=JzE/fYTdPOyvC8n2htLpdLzy54RE07LVqGahJjDkd7ijMD0M7AtxGbf+sHk4F2zYcy q6/AKPWMaVFCXkph7gJJLQxfyKg5Bdr5ACeOC+3+ngfdwlsaOOQF01DW/dSzliwC0MsA TIZ8Tn8tnVs9RQR8GrLZvXMnaWpcUw9VTWQns= 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:mime-version :content-transfer-encoding; bh=HFWiZ7/46hvLig4tJBBwK/difHzvrUqpECM3jt3/+54=; b=G7WZ7awkFatyOI1s8rqb/pWxWMV07wIk0NKJbrw2K0UNmoD8fQyTOxU7UjgmxVoZL2 BgfnMFJF6wI2bjRW5IuuqUE+2v7Rn+5hmwEADuDJ89lViEeb+f4niD1BTOev1F1eiCc+ +SlXrGqnre2hV1GdgcTI5M2r9f68pr6pwV1HQMBnVCdtkzmsM7fyUU4+z+6BnzWMPg3I KzPyK9sUdLCqPKPr6gi45egcKdVc5SnNpjc8neQVzy1ucIMY11b7HJfbOV1eviKod9U/ QkG/MXor36PZAwNCXx+LnDu1UwA7PiphEsfXvrje+2XvQjsYQh42ncomRYCZGU5p4ZTi Kv2Q== X-Gm-Message-State: AOAM530ls4iXE95vAI/4tl15VlwLNhWEYgMiM4jB55ru/TZ8n+VxyiII UQEnYOH0F8Sp83slo29wcpqQDJXuNOuenw== X-Google-Smtp-Source: ABdhPJxyonyZvzn2W0ajGKumpruBgiTjUmlpapNtLx42RhDLBFlS68gINiYKPdC1x+2bfHHU8U/Btg== X-Received: by 2002:a63:770f:: with SMTP id s15mr40239761pgc.137.1629866661028; Tue, 24 Aug 2021 21:44:21 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:ddfd:dd12:81a2:3205]) by smtp.gmail.com with ESMTPSA id n20sm2797544pfa.91.2021.08.24.21.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Aug 2021 21:44:20 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 25 Aug 2021 13:44:07 +0900 Message-Id: <20210825044410.2787433-1-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.rc2.250.ged5fa647cd-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/3] Improve CameraBuffer implementation 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 improves CameraBuffer implementation as follows: * Maps planes with reasonable assumtion on non ChromeOS platforms * Maps planes in the first plane() call * Adds stride/offset/size getter functions Change in v2: - Address Laurent's comments Hirokazu Honda (3): android: generic_camera_buffer: Correct buffer mapping android: camera_buffer: Map buffer in the first plane() call android: camera_buffer: Add stride/offset/size function src/android/camera_buffer.h | 30 +++- src/android/camera_stream.cpp | 4 +- src/android/mm/cros_camera_buffer.cpp | 97 ++++++++----- src/android/mm/generic_camera_buffer.cpp | 169 +++++++++++++++++++---- 4 files changed, 240 insertions(+), 60 deletions(-) --- 2.33.0.rc2.250.ged5fa647cd-goog