From patchwork Tue Aug 31 22:37:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= X-Patchwork-Id: 13586 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 168BDBD87D for ; Tue, 31 Aug 2021 22:37:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9106569178; Wed, 1 Sep 2021 00:37:44 +0200 (CEST) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2C38A60258 for ; Wed, 1 Sep 2021 00:37:29 +0200 (CEST) Received: from localhost.localdomain (unknown [IPv6:2804:14c:1a9:2434:b693:c9:5cb6:b688]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: nfraprado) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 2586A1F43840; Tue, 31 Aug 2021 23:37:26 +0100 (BST) From: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= To: libcamera-devel@lists.libcamera.org Date: Tue, 31 Aug 2021 19:37:00 -0300 Message-Id: <20210831223705.1928000-1-nfraprado@collabora.com> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 0/5] libcamera: pipeline: Add internal request queue 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: , Cc: kernel@collabora.com, =?utf-8?q?Andr=C3=A9_Almeida?= Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This series adds an internal request queue for the vimc, uvcvideo, rkisp1 and simple pipeline handlers. Each patch is independent of the others, but I've grouped them in this series because they're very similar, so it should ease the review. Additionally, patch 5 documents this pattern in the pipeline-handler guide so that future pipeline handlers also implement it. Note: starting in v2 this series actually depends on [1], due to the usage of buffer slots counters for the VIMC, UVC and simple pipeline handlers, which rely on constants defined in that series. Note: the simple pipeline handler patch wasn't tested since I don't have any of the hardware targeted by it. The patches here are based on these patches that added the same functionality for the ipu3 pipeline handler: 5a9d19210fad ("libcamera: pipeline: ipu3: Try queuing pending requests if a buffer is available") and 89dae5844964 ("libcamera: pipeline: ipu3: Store requests in the case a buffer shortage"). With these patches applied, the lc-compliance test from [1] passes in all pipeline handlers, even if the number of buffer slots in them is lowered below 8. [1] https://lists.libcamera.org/pipermail/libcamera-devel/2021-August/023773.html Previous standalone versions of the patches: uvcvideo [2] and rkisp1 [3] [2] https://lists.libcamera.org/pipermail/libcamera-devel/2021-July/022029.html [3] https://lists.libcamera.org/pipermail/libcamera-devel/2021-July/022135.html Changes in v2: (thanks to Laurent) - Added a counter to keep track of the number of available buffer slots in the VIMC and UVC pipeline handlers - Moved processControls() from PipelineHandlerVimc to VimcCameraData - Moved cancellation of pending requests to after video devices stop - Added patch for the simple pipeline handler - Added patch to document this pattern in the pipeline-handler guide NĂ­colas F. R. A. Prado (5): libcamera: pipeline: vimc: Add internal request queue libcamera: pipeline: uvcvideo: Add internal request queue libcamera: pipeline: rkisp1: Add internal request queue libcamera: pipeline: simple: Add internal request queue Documentation: guides: pipeline-handler: Document internal queue pattern Documentation/guides/pipeline-handler.rst | 129 ++++++++++---- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 73 ++++++-- src/libcamera/pipeline/simple/simple.cpp | 101 ++++++++--- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 98 +++++++++-- src/libcamera/pipeline/vimc/vimc.cpp | 167 +++++++++++++------ 5 files changed, 436 insertions(+), 132 deletions(-)