From patchwork Fri Sep 18 09:42:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 9645 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 E9A98C3B5B for ; Fri, 18 Sep 2020 09:43:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 487B262FB1; Fri, 18 Sep 2020 11:43:57 +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="JIJ6t16s"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 80D7C60367 for ; Fri, 18 Sep 2020 11:43:55 +0200 (CEST) Received: by mail-wr1-x431.google.com with SMTP id e16so4955528wrm.2 for ; Fri, 18 Sep 2020 02:43:55 -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=7kMhUF+YAuDJnuxuR8bsx+I4/zt11xRwomq8dwpvBB8=; b=JIJ6t16szPE/oBjDOqvd2v4kZbfM552DNpAB+K9RgZHbr4toO9R3MYcDT5ksL8Qps6 ko/p/et+d72AHu98WGQRqBeoayVrc912c8oIPdLXue/r57di3O/Pz/F5ubR6adG8pFxe gsFe80zppICEMlqTQZyVq3hjMwVQa2bS1JpphYggLCoYWboceRH0bpMw5IlyoTtuDMki 5qNsoY1sMig6REEPwXV4ZChunIQxIrS49c2qNAOrlz5zj4vPdsXsYOEYFoeUZs9wm1xt /URXUfZU0aTseccjRIu46EQzlF9CanUCykP5enCtcj70Ldf2TCASxgby/hj9ZPapvHlg 0Y0w== 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=7kMhUF+YAuDJnuxuR8bsx+I4/zt11xRwomq8dwpvBB8=; b=Wna1oNb2lEW1e1xA41tAJMJtWmc5N2WMNozG6nZs97kdLuHFBZb9TTZcv5EgVmP+mq lMbRlV7eESOhHme55EoY1SaZZBu/fRjMJ3v6twpMoQkAtrR1MJJEAyRcb5kqdv9VcOxd I0JXlOxiV8TmZN4Rf0pUJtNTEwNijXqCdL2bj4WSWffiojZteWZRyntAD1u00atO4C06 gFkvp+z+Q8OtqZyuO5cX5hlcePSRDmRxaYB3gK9Fhgl9l/oq9qIhe5/6RludxWJ1fIgM byeoVP8vIJERJBe+YA85wjh5tCjUPE6Wk7wgGx9OzNEyBGOzvH4YDM5JalsaPOgWXHxZ RtuA== X-Gm-Message-State: AOAM530SuWmhJo1/Gxw3F1r/YmDuNvcRUoCyoQGX31rDmSCmNh9iygRf l6RuXBNQKflQsnxszYp+jMQt1dRzDImLDA== X-Google-Smtp-Source: ABdhPJzw3yRi9NcbaVCiTaAYHXDVupSFkwYTUDfgWtfwrJXPX1j+Ce2+OLIZLST1tQnqgJ4Gno+d2w== X-Received: by 2002:a5d:60c6:: with SMTP id x6mr3519834wrt.157.1600422234496; Fri, 18 Sep 2020 02:43:54 -0700 (PDT) Received: from naushir-VirtualBox.pitowers.org ([2a00:1098:3142:14:a00:27ff:fe4d:f6a2]) by smtp.gmail.com with ESMTPSA id n2sm4792472wma.29.2020.09.18.02.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Sep 2020 02:43:53 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Fri, 18 Sep 2020 10:42:21 +0100 Message-Id: <20200918094233.5273-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v8 00/12] 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 all, Here is patch v8 for the zero-copy work. The only difference between this and v7 is how the stream internally generates ids for buffers. To keep things modular, i've added a IdGenerator class in patch 10/12. This simply uses an incrementing counter and stores a queue of retuned ids for reuse. If we decide that something more efficient may be needed (e.g. Laurent's idea of using a bitfield, assuming we can ensure we have limited set of buffers in flight), then it should be easy enough just to change the class implementation. However, for now, I think this implementation provides a good compromise between simplicity and performance. Thanks, Naush Naushir Patuck (12): libcamera: pipeline: raspberrypi: Move RPiStream into a separate file 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: ipa: raspberrypi: Remove use of FrameBuffer cookie pipeline: raspberrypi: Use an unordered_map for the stream buffer list pipeline: raspberrypi: Use an unordered_set to store IPA buffer ids pipeline: ipa: raspberrypi: Handle any externally allocated FrameBuffer include/libcamera/ipa/raspberrypi.h | 13 +- src/ipa/raspberrypi/raspberrypi.cpp | 26 +- .../pipeline/raspberrypi/meson.build | 1 + .../pipeline/raspberrypi/raspberrypi.cpp | 575 ++++++++---------- .../pipeline/raspberrypi/rpi_stream.cpp | 236 +++++++ .../pipeline/raspberrypi/rpi_stream.h | 180 ++++++ 6 files changed, 681 insertions(+), 350 deletions(-) create mode 100644 src/libcamera/pipeline/raspberrypi/rpi_stream.cpp create mode 100644 src/libcamera/pipeline/raspberrypi/rpi_stream.h