From patchwork Mon Jul 13 08:47:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 8750 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 3E60ABD790 for ; Mon, 13 Jul 2020 08:47:36 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA401605B4; Mon, 13 Jul 2020 10:47:35 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Lu1BWRt9"; dkim-atps=neutral Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 676DD6055F for ; Mon, 13 Jul 2020 10:47:34 +0200 (CEST) Received: by mail-wm1-x334.google.com with SMTP id j18so12484906wmi.3 for ; Mon, 13 Jul 2020 01:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=l4GQcte6WruaPFP0ijJ706A69abSIPxOkAsmMQZVBJM=; b=Lu1BWRt9APFGc8crDbLvLHjSBB/Obs4janMCPgbKl3n7snUwZ8CKlTfpWubkAfG9aT pngF/YsZEy7EMGZv/qm6otuvarfs19YjK73etipLOXXLz2yJYiouIq5hBQYkxqtHe6U7 /5LHo83d7sgA4mkxaWujYI/4yppYRQK4W9CfmyWnDWfVOBaL/KfVcQ8w9NINkYwK5fmN +vtSeIUDPHh84HUkq5pAEdhtIVz9iovryJ8V0H1rrJw7Nlh7bB39nJ5XLjpyhNwdF/8l RlKrZV9kdSAoDodrI2dLAnkSMe9c95NFEAVB3iYhHQeISqJZX0ySHry5FKZKzgMj1T5T Wf0A== 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=l4GQcte6WruaPFP0ijJ706A69abSIPxOkAsmMQZVBJM=; b=tF9B3BAPrL9e1lb8SHDvJz0T7RWHNxFEPoR8mFUCVjZTeOrwp5R5+yfxHyq2pYpEd7 8L/kWRXsjomnrDtZF9iQAB7jjz9qRW/eTXAbidvHqRHngXbOInSvXArGmkVd+ssx9/PZ lepE0w0RVdihFVILNTFSxsuB0kJ743USewVPrMc8Tk0fci+I5p57gP1HEi4VJuxKoPbx /pyizSTXJMINEEURiAzy/A1AnXzCegrk6a+/lfriejpGFFuE0ku4jyiSVSLqbh2DuTDz 4pWjetp1x8hKw4D0b47vNLeQXAXNv9Y/LpbWB3x8kQwDYPV0hqsQrYNN0uNGBCGXbQ8m AVCw== X-Gm-Message-State: AOAM531N8UVhfjJgSYFktSWpO6CYTYuJ5ptYZoMZSSVueaHWfuTsfSOz Vuw6uXP4MHez9Xd/6gap/ukB3U7qgzo= X-Google-Smtp-Source: ABdhPJxlHUfBQMx4O27zimCQv8aLguTVzzVIPXuUfliej0F1KQanHJUWGfKpayoNmSEb88n1vadE7A== X-Received: by 2002:a7b:c763:: with SMTP id x3mr16912229wmk.47.1594630053686; Mon, 13 Jul 2020 01:47:33 -0700 (PDT) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id g14sm23203357wrm.93.2020.07.13.01.47.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jul 2020 01:47:33 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Mon, 13 Jul 2020 09:47:18 +0100 Message-Id: <20200713084727.232422-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [WIP PATCH 0/9] Zero-copy RAW stream work 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, Here is a preliminary set of patches to rework the Raspberry Pi stream handling to support zero-copy captures. The biggest change here is that we now export/import buffers for all our streams, instead of v4l2_videodevice::allocate(). This will allow any stream buffer to be returned to the application without a copy step. This includes the statistics buffer (once we have a mechanism for requesting it). This is still a work in progress, and in particular, patch 2 needs to be reworked once Laurent's change for passing IPA configuration parameters is merged. However, everything else is in a more-or-less finished state, so I would appreciate any comments. Regards, Naush Naushir Patuck (9): libcamera: pipeline: raspberrypi: Move RPiStream into a separate header libcamera: pipeline: ipa: raspberrypi: Rework drop frame signalling libcamera: pipeline: raspberrypi: Add some debug logging libcamera: pipeline: raspberrypi: Increase the number of RAW buffers libcamera: pipeline: raspberrypi: Remove const qualifier from RPiStream libcamera: pipeline: raspberrypi: Rework stream buffer logic for zero-copy libcamera: pipeline: raspberrypi: Fix bug in passing configuration to IPA libcamera: pipeline: raspberrypi: Add more robust stream buffer logic libcamera: pipeline: raspberrypi: Move RPiStream methods to a cpp file include/libcamera/ipa/raspberrypi.h | 2 +- src/ipa/raspberrypi/raspberrypi.cpp | 21 +- .../pipeline/raspberrypi/meson.build | 1 + .../pipeline/raspberrypi/raspberrypi.cpp | 415 ++++++------------ .../pipeline/raspberrypi/rpi_stream.cpp | 167 +++++++ .../pipeline/raspberrypi/rpi_stream.h | 154 +++++++ 6 files changed, 464 insertions(+), 296 deletions(-) create mode 100644 src/libcamera/pipeline/raspberrypi/rpi_stream.cpp create mode 100644 src/libcamera/pipeline/raspberrypi/rpi_stream.h