{"id":12947,"url":"https://patchwork.libcamera.org/api/1.1/patches/12947/?format=json","web_url":"https://patchwork.libcamera.org/patch/12947/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210714183857.2046425-2-nfraprado@collabora.com>","date":"2021-07-14T18:38:48","name":"[libcamera-devel,v6,01/10] libcamera: property: Add MinNumRequests property","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"b8b39a62e57d47a30b005042920e3b4968165971","submitter":{"id":84,"url":"https://patchwork.libcamera.org/api/1.1/people/84/?format=json","name":"Nícolas F. R. A. Prado","email":"nfraprado@collabora.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12947/mbox/","series":[{"id":2232,"url":"https://patchwork.libcamera.org/api/1.1/series/2232/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2232","date":"2021-07-14T18:38:47","name":"lc-compliance: Add test to queue more requests than hardware depth","version":6,"mbox":"https://patchwork.libcamera.org/series/2232/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12947/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12947/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 5EE56C3225\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 14 Jul 2021 18:39:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 27F4268529;\n\tWed, 14 Jul 2021 20:39:15 +0200 (CEST)","from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1F65868523\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 14 Jul 2021 20:39:13 +0200 (CEST)","from localhost.localdomain (unknown\n\t[IPv6:2804:14c:1a9:2434:6553:ad0c:9d2a:24db])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nfraprado)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id E769A1F43219;\n\tWed, 14 Jul 2021 19:39:10 +0100 (BST)"],"From":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 14 Jul 2021 15:38:48 -0300","Message-Id":"<20210714183857.2046425-2-nfraprado@collabora.com>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20210714183857.2046425-1-nfraprado@collabora.com>","References":"<20210714183857.2046425-1-nfraprado@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v6 01/10] libcamera: property: Add\n\tMinNumRequests property","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"kernel@collabora.com, =?utf-8?q?Andr=C3=A9_Almeida?=\n\t<andrealmeid@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The MinNumRequests property reports the bare minimum number of requests\nneeded in the camera pipeline for capture to be possible. It is equal to\nthe number of buffers required by the driver. At this quantity, there's\nno guarantee that frames won't be dropped or that manual per-frame\ncontrols will apply correctly. The quantity needed for those may be\nadded as separate properties in the future.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n---\n\nChanges in v6:\n- Thanks to Naushir:\n  - Removed comment from Raspberrypi MinNumRequests setting\n- Removed an extra blank line\n\n src/libcamera/pipeline/ipu3/ipu3.cpp               | 6 ++++++\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 ++\n src/libcamera/pipeline/rkisp1/rkisp1.cpp           | 2 ++\n src/libcamera/pipeline/simple/simple.cpp           | 2 ++\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       | 2 ++\n src/libcamera/pipeline/vimc/vimc.cpp               | 2 ++\n src/libcamera/property_ids.yaml                    | 8 ++++++++\n 7 files changed, 24 insertions(+)","diff":"diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 76c3bb3d8aa9..017018c845fa 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -1111,6 +1111,12 @@ int PipelineHandlerIPU3::registerCameras()\n \t\t/* Initialize the camera properties. */\n \t\tdata->properties_ = cio2->sensor()->properties();\n \n+\t\t/*\n+\t\t * \\todo Make sure this is correct even after the stream is\n+\t\t * configured to CIO2\n+\t\t */\n+\t\tdata->properties_.set(properties::MinNumRequests, 1);\n+\n \t\tret = initControls(data.get());\n \t\tif (ret)\n \t\t\tcontinue;\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex f821d8fe1b6c..98a97ffca15d 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1046,6 +1046,8 @@ bool PipelineHandlerRPi::match(DeviceEnumerator *enumerator)\n \t/* Initialize the camera properties. */\n \tdata->properties_ = data->sensor_->properties();\n \n+\tdata->properties_.set(properties::MinNumRequests, 1);\n+\n \t/*\n \t * Set a default value for the ScalerCropMaximum property to show\n \t * that we support its use, however, initialise it to zero because\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 42911a8fdfdb..c81ebf14c6bf 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -24,6 +24,7 @@\n #include <libcamera/ipa/core_ipa_interface.h>\n #include <libcamera/ipa/rkisp1_ipa_interface.h>\n #include <libcamera/ipa/rkisp1_ipa_proxy.h>\n+#include <libcamera/property_ids.h>\n #include <libcamera/request.h>\n #include <libcamera/stream.h>\n \n@@ -944,6 +945,7 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \n \t/* Initialize the camera properties. */\n \tdata->properties_ = data->sensor_->properties();\n+\tdata->properties_.set(properties::MinNumRequests, 3);\n \n \t/*\n \t * \\todo Read dealy values from the sensor itself or from a\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex b29fff9820e5..c4adea61519f 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -25,6 +25,7 @@\n \n #include <libcamera/camera.h>\n #include <libcamera/control_ids.h>\n+#include <libcamera/property_ids.h>\n #include <libcamera/request.h>\n #include <libcamera/stream.h>\n \n@@ -436,6 +437,7 @@ int SimpleCameraData::init()\n \t}\n \n \tproperties_ = sensor_->properties();\n+\tproperties_.set(properties::MinNumRequests, 3);\n \n \treturn 0;\n }\ndiff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 0f634b8da609..0258111ad6cf 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -525,6 +525,8 @@ int UVCCameraData::init(MediaDevice *media)\n \tproperties_.set(properties::PixelArraySize, resolution);\n \tproperties_.set(properties::PixelArrayActiveAreas, { Rectangle(resolution) });\n \n+\tproperties_.set(properties::MinNumRequests, 1);\n+\n \t/* Initialise the supported controls. */\n \tControlInfoMap::Map ctrls;\n \ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 12f7517fd0ae..60ec473db0ba 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -21,6 +21,7 @@\n #include <libcamera/control_ids.h>\n #include <libcamera/controls.h>\n #include <libcamera/formats.h>\n+#include <libcamera/property_ids.h>\n #include <libcamera/request.h>\n #include <libcamera/stream.h>\n \n@@ -516,6 +517,7 @@ int VimcCameraData::init()\n \n \t/* Initialize the camera properties. */\n \tproperties_ = sensor_->properties();\n+\tproperties_.set(properties::MinNumRequests, 2);\n \n \treturn 0;\n }\ndiff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml\nindex 12ecbce5eed4..0208f92074d3 100644\n--- a/src/libcamera/property_ids.yaml\n+++ b/src/libcamera/property_ids.yaml\n@@ -678,6 +678,14 @@ controls:\n         \\todo Turn this property into a \"maximum control value\" for the\n         ScalerCrop control once \"dynamic\" controls have been implemented.\n \n+  - MinNumRequests:\n+      type: int32_t\n+      description: |\n+        The bare minimum number of requests needed in the camera pipeline for\n+        capture to be possible, as required by the driver. Note that this\n+        quantity does not guarantee that frames won't be dropped or that manual\n+        per-frame controls will be applied properly.\n+\n   # ----------------------------------------------------------------------------\n   # Draft properties section\n \n","prefixes":["libcamera-devel","v6","01/10"]}