{"id":13075,"url":"https://patchwork.libcamera.org/api/patches/13075/?format=json","web_url":"https://patchwork.libcamera.org/patch/13075/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20210722232851.747614-2-nfraprado@collabora.com>","date":"2021-07-22T23:28:41","name":"[libcamera-devel,v7,01/11] libcamera: property: Add MinimumRequests property","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"98c408297335bd54df94b1aeaca0115076f7c820","submitter":{"id":84,"url":"https://patchwork.libcamera.org/api/people/84/?format=json","name":"Nícolas F. R. A. Prado","email":"nfraprado@collabora.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/13075/mbox/","series":[{"id":2269,"url":"https://patchwork.libcamera.org/api/series/2269/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2269","date":"2021-07-22T23:28:40","name":"lc-compliance: Add test to queue more requests than hardware depth","version":7,"mbox":"https://patchwork.libcamera.org/series/2269/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/13075/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/13075/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 4A235C0109\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Jul 2021 23:29:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 115E2687A9;\n\tFri, 23 Jul 2021 01:29:28 +0200 (CEST)","from bhuna.collabora.co.uk (bhuna.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CD19A6877A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 23 Jul 2021 01:29:25 +0200 (CEST)","from localhost.localdomain (unknown\n\t[IPv6:2804:14c:1a9:2434:a4c5:aa5e:1d8c:5e2c])\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 0115C1F447C9;\n\tFri, 23 Jul 2021 00:29:23 +0100 (BST)"],"From":"=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 22 Jul 2021 20:28:41 -0300","Message-Id":"<20210722232851.747614-2-nfraprado@collabora.com>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20210722232851.747614-1-nfraprado@collabora.com>","References":"<20210722232851.747614-1-nfraprado@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v7 01/11] libcamera: property: Add\n\tMinimumRequests 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 MinimumRequests property reports the minimum number of capture\nrequests that the camera pipeline requires to have queued in order to\nsustain capture operations. At this quantity, there's no guarantee that\nframes won't be dropped or that manual per-frame controls will apply\ncorrectly. The quantity needed for those may be added as separate\nproperties in the future.\n\nBy default the property is set to 1 in the CameraSensor constructor, and\nit can be overridden by each pipeline. The uvcvideo pipeline explicitly\nsets the property to 1 since it doesn't have a CameraSensor.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n---\n\nChanges in v7:\n- Thanks to Kieran:\n  - Renamed property from MinNumRequests to MinimumRequests\n- Thanks to Jacopo:\n  - Changed property's description\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/camera_sensor.cpp              |  1 +\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              | 10 ++++++++++\n 6 files changed, 19 insertions(+)","diff":"diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex cde431cc4c80..d8ed010bfd08 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -57,6 +57,7 @@ CameraSensor::CameraSensor(const MediaEntity *entity)\n \t: entity_(entity), pad_(UINT_MAX), bayerFormat_(nullptr),\n \t  properties_(properties::properties)\n {\n+\tproperties_.set(properties::MinimumRequests, 1);\n }\n \n /**\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 42911a8fdfdb..cb4ca9a85fa8 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::MinimumRequests, 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..348c554c8be4 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::MinimumRequests, 3);\n \n \treturn 0;\n }\ndiff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 0f634b8da609..6ad7fb3c9f0c 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::MinimumRequests, 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..44c198ccf8b8 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::MinimumRequests, 2);\n \n \treturn 0;\n }\ndiff --git a/src/libcamera/property_ids.yaml b/src/libcamera/property_ids.yaml\nindex 12ecbce5eed4..23ef0e9d38c4 100644\n--- a/src/libcamera/property_ids.yaml\n+++ b/src/libcamera/property_ids.yaml\n@@ -678,6 +678,16 @@ controls:\n         \\todo Turn this property into a \"maximum control value\" for the\n         ScalerCrop control once \"dynamic\" controls have been implemented.\n \n+  - MinimumRequests:\n+      type: int32_t\n+      description: |\n+        The minimum number of capture requests that the camera pipeline requires\n+        to have queued in order to sustain capture operations.\n+\n+        This property usually corresponds to the minimum number of memory\n+        buffers needed to fill the capture pipeline composed of hardware\n+        processing blocks.\n+\n   # ----------------------------------------------------------------------------\n   # Draft properties section\n \n","prefixes":["libcamera-devel","v7","01/11"]}