From patchwork Mon Aug 16 04:31:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13358 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 8997CBD87D for ; Mon, 16 Aug 2021 04:31:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DB7D268891; Mon, 16 Aug 2021 06:31:48 +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="FIPF8zPL"; dkim-atps=neutral Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id D2B8E6025C for ; Mon, 16 Aug 2021 06:31:46 +0200 (CEST) Received: by mail-pj1-x1031.google.com with SMTP id bo18so24631440pjb.0 for ; Sun, 15 Aug 2021 21:31: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=+OyQKYmyBOIO/1bAo2PIwgas8EED1Gw/Bk4kvTqECCw=; b=FIPF8zPLpCkAyBPgvZHq+qNYWMVMMd6WVtANAONCfonlmBcL9i3Y7w8O3MBr72gof3 UDz19sX1FUMnOoBpVtU/oPuqvbX64eEY76hmnSiWem/v29VlN1iOtPx5lqEd4V6Txdfl L2yKjwKs6t751Yn633fmdeRRh36JfwiT0v19M= 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=+OyQKYmyBOIO/1bAo2PIwgas8EED1Gw/Bk4kvTqECCw=; b=E/jlx+2jQGrE22R3v+STrvZQ9hR3UuXVGjiuGVjTRZd7PK3/XdBheIRWr46CGl1OtE XO6Hq5Ry9wIry4X9yOiZJCW221O7X4zjxFh7cOCVrAWvHfvY6o6TtHDL/WPhLIfi/ODy tyAYp8zH72Jik3bFYLN/qFOo1gqRjinowWJCmQfmuNPE3YWTFJkpLTCBKQEzre52LQcC /EAt0Y6TFAfJmSNzylR4BW641caDrtj9pqIjHT/oNHUi8lhrTuKzHejgHGmI+aF4EUus 0XDNT1kvLAmHr7wLzfZH9j1sPYigXhTeH53yvANbEq+qeRIePllGYF9pXV1mpKiD+6PV qfUQ== X-Gm-Message-State: AOAM530gUf/G6iQGB2FGKMCHISmcHMluJw4Q6I/DzZTySD4JPN0U11fL BQsKPGIkm5wGzLSaqsj6Xqekhhz98PeaJg== X-Google-Smtp-Source: ABdhPJz/cgWbF77ZzbDf3yVMfkN3q3oZazD8SBuRfIAEjfZK07kSN93BxMx6snIw87qZYI8xXTmQMw== X-Received: by 2002:a17:90b:1950:: with SMTP id nk16mr15164726pjb.11.1629088304711; Sun, 15 Aug 2021 21:31:44 -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.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 21:31:44 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 16 Aug 2021 13:31:28 +0900 Message-Id: <20210816043138.957984-1-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 00/10] 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" Since FrameBuffer::Plane doesn't have an offset variable, it is impossible to map the FrameBuffer::Plane correctly. This series fixes the issue by adding an offset and alignes some code of mapping and creating FrameBuffer::Plane with the new offset. I probably miss some code of using FrameBuffer::Plane. To detect the bug, I add the assertion to FrameBuffer. Hirokazu Honda (10): libcamera: framebuffer: Add offset to FrameBuffer::Plane libcamera: ipa_data_serializer: Modify (de)serialization for offset libcamera: mapped_framebuffer: Return plane begin address by MappedBuffer::maps() cam: file_sink: Use offset in mapping FrameBuffer ipa: rkisp1: Use offset in mapping IPABuffer qcam: main_window: Use offset mapping FrameBuffer gstreamer: gstlibcameraallocator: Use offset in creating a buffer libcamera: v4l2_videodevice: Create color-format planes in CreateBuffer() android: camera_device: Fill offset and right length in CreateFrameBuffer() libcamera: framebuffer: Add assertion to detect offset is unfilled include/libcamera/framebuffer.h | 12 ++++- .../libcamera/internal/mapped_framebuffer.h | 4 +- include/libcamera/internal/v4l2_videodevice.h | 4 +- src/android/camera_device.cpp | 38 +++++++------- src/cam/file_sink.cpp | 5 +- src/cam/file_sink.h | 1 + src/gstreamer/gstlibcameraallocator.cpp | 3 +- src/ipa/rkisp1/rkisp1.cpp | 4 +- src/libcamera/framebuffer.cpp | 11 ++-- src/libcamera/ipa_data_serializer.cpp | 5 +- src/libcamera/mapped_framebuffer.cpp | 51 +++++++++++++++---- src/libcamera/v4l2_videodevice.cpp | 28 +++++++++- src/qcam/main_window.cpp | 15 ++++-- src/qcam/main_window.h | 1 + 14 files changed, 136 insertions(+), 46 deletions(-) --- 2.33.0.rc1.237.g0d66db33f3-goog