{"id":18022,"url":"https://patchwork.libcamera.org/api/1.1/patches/18022/?format=json","web_url":"https://patchwork.libcamera.org/patch/18022/","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":"<20221216122939.256534-9-paul.elder@ideasonboard.com>","date":"2022-12-16T12:29:29","name":"[libcamera-devel,v9,08/18] libcamera: pipeline: vimc, uvcvideo: Don't rely on bufferCount","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"592e1c5af6d20e7f949ea3954c8f269690116f4a","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/1.1/people/17/?format=json","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18022/mbox/","series":[{"id":3675,"url":"https://patchwork.libcamera.org/api/1.1/series/3675/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3675","date":"2022-12-16T12:29:21","name":"lc-compliance: Add test to queue more requests than hardware depth","version":9,"mbox":"https://patchwork.libcamera.org/series/3675/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18022/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18022/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 0112AC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Dec 2022 12:30:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BF79B633A9;\n\tFri, 16 Dec 2022 13:30:17 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 02484633A5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Dec 2022 13:30:16 +0100 (CET)","from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp\n\t[175.177.42.159])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8F07BA31;\n\tFri, 16 Dec 2022 13:30:14 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1671193817;\n\tbh=tWJBA3ZzmkGxJdFje1EEjYVPBGmeYjY0ojq/kBPOLBY=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=p4LGgptsXzIUHzAvmuoDbInrRyeF2+y8rQpAm7JoJmTnFb9dOBFkNFH9NjZ/2EKqt\n\tTmfLFRIdd7MHthTzdncu12vhqKnmoWt+eImzQIYO/Zu7mUuN8UKIsZAkSnQLZK9gvD\n\tWoE8DrQpJuWDlJRv2jNzM3a9riDxL10z74idBxvOSpdVQNoffc3/UBdoiC5/lds+lB\n\tLIP++So1Glo8gdEC+ImC1NpziUAt0YbKHm2gljxA6spjDegMUkvxzOZHo5VwDyESIP\n\thqd3JtNAdP1/aiOjV1I8Febvm0NDiftrk6LNHZXLwb3yKZDQUoRg8A5Islf24+/IWh\n\tt+YfrN1CqzX/w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1671193815;\n\tbh=tWJBA3ZzmkGxJdFje1EEjYVPBGmeYjY0ojq/kBPOLBY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=f/4vqUtUusR3QI8wuBxJiZA8c9hPEYCrJFyWLBsaxVQLPVIDrK+7FKp3QvQ/1OvQh\n\tOZg/fOhty4W797OYRq0ED7iRo2gdV9ZSeRAGWe1raUDXYkM3yDxA4XFgekjBRMXcDM\n\tx1jQCsUGmfwEUW57l2aTnOJUXBdhi9q7CnoZbiDs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"f/4vqUtU\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 16 Dec 2022 21:29:29 +0900","Message-Id":"<20221216122939.256534-9-paul.elder@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20221216122939.256534-1-paul.elder@ideasonboard.com>","References":"<20221216122939.256534-1-paul.elder@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v9 08/18] libcamera: pipeline: vimc,\n\tuvcvideo: Don't rely on bufferCount","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>","From":"Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Paul Elder <paul.elder@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"From: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n\nInstead of using bufferCount as the number of V4L2 buffer slots to\nreserve in the vimc and uvcvideo pipeline handlers, use a reasonably\nhigh constant: 16. Overallocating isn't a problem as buffer slots are\ncheap. Having too few, on the other hand, could degrade performance. It\nis expected that this number will be more than enough for most, if not\nall, use cases.\n\nThis makes way for removing bufferCount.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v9:\n- rebased\n\nChanges in v8:\n- New\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 5 +++--\n src/libcamera/pipeline/vimc/vimc.cpp         | 5 +++--\n 2 files changed, 6 insertions(+), 4 deletions(-)","diff":"diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 4ce240a4..18966d01 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -97,6 +97,8 @@ private:\n \t{\n \t\treturn static_cast<UVCCameraData *>(camera->_d());\n \t}\n+\n+\tstatic constexpr unsigned int kUVCBufferSlotCount = 16;\n };\n \n UVCCameraConfiguration::UVCCameraConfiguration(UVCCameraData *data)\n@@ -239,9 +241,8 @@ int PipelineHandlerUVC::exportFrameBuffers(Camera *camera,\n int PipelineHandlerUVC::start(Camera *camera, [[maybe_unused]] const ControlList *controls)\n {\n \tUVCCameraData *data = cameraData(camera);\n-\tunsigned int count = data->stream_.configuration().bufferCount;\n \n-\tint ret = data->video_->importBuffers(count);\n+\tint ret = data->video_->importBuffers(kUVCBufferSlotCount);\n \tif (ret < 0)\n \t\treturn ret;\n \ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex e58caf99..eaa6ebf7 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -106,6 +106,8 @@ private:\n \t{\n \t\treturn static_cast<VimcCameraData *>(camera->_d());\n \t}\n+\n+\tstatic constexpr unsigned int kVimcBufferSlotCount = 16;\n };\n \n namespace {\n@@ -334,9 +336,8 @@ int PipelineHandlerVimc::exportFrameBuffers(Camera *camera,\n int PipelineHandlerVimc::start(Camera *camera, [[maybe_unused]] const ControlList *controls)\n {\n \tVimcCameraData *data = cameraData(camera);\n-\tunsigned int count = data->stream_.configuration().bufferCount;\n \n-\tint ret = data->video_->importBuffers(count);\n+\tint ret = data->video_->importBuffers(kVimcBufferSlotCount);\n \tif (ret < 0)\n \t\treturn ret;\n \n","prefixes":["libcamera-devel","v9","08/18"]}