From patchwork Thu Aug 26 08:00:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13497 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 9002CBD87C for ; Thu, 26 Aug 2021 08:00:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9D72C688AE; Thu, 26 Aug 2021 10:00:31 +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="ksQRkvfq"; dkim-atps=neutral Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AFC5D6025A for ; Thu, 26 Aug 2021 10:00:29 +0200 (CEST) Received: by mail-pg1-x52c.google.com with SMTP id k24so2388190pgh.8 for ; Thu, 26 Aug 2021 01:00:29 -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=OwzjQWywEs5J9RMipBsiBdaVHtsTY69nhdRt6WGwIKI=; b=ksQRkvfq1GIGKkMCDmyo8aPXiubsvJ72VmTydgJYCo0Ot1X+4zPcNb8bqVECD0RNV7 YWrxCYSejl/vBCkD858s7bPkLUKadRbmV24foir3U7FORBDJIdU9EVkZ/z18M5ba++i9 LqiCukT+34s+AHw/kgR2WLVzWcDhXLbUUyC/k= 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=OwzjQWywEs5J9RMipBsiBdaVHtsTY69nhdRt6WGwIKI=; b=X50l10CC/KmaX+m1IDVJQeUuvDRqq/c6d/u7+VEgDBFMx2hUd6G2IMHnKwzhG5yJNF D+niMZygAVtpwFZZpn60jwsXegIAKaAf7+IaVzv1UepqrqGQ2U4g+NrXDfKuQTM4GxWN Y0J+QDB4LsasAZttLcDKkN+1YltyFTM5NUVS3QtB1KTBsQomzF2IhO5AwOrC01628fzM nIsF/KDMr/IEwQjkEDBU9bCOnJyH5t890/2yFNmzX8FkrFXh19BNDILHV7+wawF7vOk8 rqME+OXZjVqNf7Z/PPKrfZsHVGOb7MJHs1fscMb0k19x9rS2lTqP/s8B5GiSnH71k/lo nmQw== X-Gm-Message-State: AOAM5306o8RNYfNQ5U7etu+NrPJQY3JU4Elbkvj5pUAFmsLQjSNB5X/v 3NYSSi8fvVbjQ3KJDt+KQsISAWJVbhSahg== X-Google-Smtp-Source: ABdhPJwJBzGlmV+C2xmYvIoywHQHhdKINruH6hJIjlHdJFDO2vGrxYZgmzzfmaItN9gB2cGEmASFzg== X-Received: by 2002:a62:8144:0:b0:3af:7e99:f48f with SMTP id t65-20020a628144000000b003af7e99f48fmr2423023pfd.2.1629964827721; Thu, 26 Aug 2021 01:00:27 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:a5bc:b3dd:7208:bec1]) by smtp.gmail.com with ESMTPSA id g3sm2570805pgj.66.2021.08.26.01.00.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Aug 2021 01:00:27 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Aug 2021 17:00:18 +0900 Message-Id: <20210826080021.3454520-1-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.rc2.250.ged5fa647cd-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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 v3: - Address comments from Jacopo and Laurent 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 | 165 +++++++++++++++++++---- 4 files changed, 238 insertions(+), 58 deletions(-) --- 2.33.0.rc2.250.ged5fa647cd-goog