Patch Detail
Show a patch.
GET /api/1.1/patches/11867/?format=api
{ "id": 11867, "url": "https://patchwork.libcamera.org/api/1.1/patches/11867/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11867/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210408085101.1691729-2-hiroh@chromium.org>", "date": "2021-04-08T08:50:59", "name": "[libcamera-devel,RFC,v3,1/3] pipeline: ipu3: Store requests in the case a buffer shortage", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "a2fc497fa1d0a797ae2129698c0ca7868d23b7d9", "submitter": { "id": 63, "url": "https://patchwork.libcamera.org/api/1.1/people/63/?format=api", "name": "Hirokazu Honda", "email": "hiroh@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11867/mbox/", "series": [ { "id": 1904, "url": "https://patchwork.libcamera.org/api/1.1/series/1904/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1904", "date": "2021-04-08T08:50:58", "name": "ipu3: Enable to handle a number of concurrent requests", "version": 3, "mbox": "https://patchwork.libcamera.org/series/1904/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11867/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11867/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 E291FBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 8 Apr 2021 08:51:12 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9D173687F5;\n\tThu, 8 Apr 2021 10:51:12 +0200 (CEST)", "from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com\n\t[IPv6:2607:f8b0:4864:20::1036])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D174F687F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 8 Apr 2021 10:51:10 +0200 (CEST)", "by mail-pj1-x1036.google.com with SMTP id nh5so750424pjb.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 08 Apr 2021 01:51:10 -0700 (PDT)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:8822:ec6c:14d8:eea9])\n\tby smtp.gmail.com with ESMTPSA id\n\tg80sm1755993pfb.181.2021.04.08.01.51.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 08 Apr 2021 01:51:08 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"ZedJYsVd\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=jfeyZ2yvrHTGMVCEciDVuNQQtKjTpqBhEM2MU+DjD78=;\n\tb=ZedJYsVdw0/R6tucllKAqrcPeETfisZsq9nTfyJwzvF2o4p32aOb0xgppf6ePTT2Ws\n\tAarcJOrDyW/wC2bTPkbv9PNjmR6m48mBFMpd0yWE8LxN4pgUcHiLSvkxxGo4+Z/MhMFE\n\tSLLZk7pbdKWKzzugXRpHBuYZOwDAd0EbOupDQ=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=jfeyZ2yvrHTGMVCEciDVuNQQtKjTpqBhEM2MU+DjD78=;\n\tb=h6ltvNWFnG/aU0eDqZlKd3MuGmpThnHy/+6v/hcVfv+Henwm4o9xxRJsZFmC7SUTGS\n\t5MdpbKq1cRidssHUFp2rCEyL/BW5QDnR36RCKdDO3i/udv7m0YOcVJWl/DEFf+6ZAHCs\n\tZmF5IM/WYXXO/+e8DppaxRG0MptCXkxV6E6q+anl/ye5hgjV29nFQgQw90tlXes3KgC2\n\tqpfNv024VE8QVDzo1uKEwIPFQRvc+0AdtBd6cbdhKhpV2BkZuIf68bk8BD+/JXM+gqTD\n\tPgMGkr2oqDT18+5WEtnggWKz9m95v1hJHYhTfjZig3FeZ/FK4GvV2QGAwaaDtRQCJXAl\n\tAT2Q==", "X-Gm-Message-State": "AOAM532Tv/tvIJfZOAF4Jv4UYIv0Mu5fEUokkrs2Taz2nRpr5R86rX0I\n\tu7mRhpdzjtKTL6xQ9HiE842dM/0TkdLemQ==", "X-Google-Smtp-Source": "ABdhPJyDT5wq/hNwi/rllrKbH1VQB5XhMyMDG5Gyo2aC3QECUBa8d48lsr1MEZKwDN+P9bm9NkmtKA==", "X-Received": "by 2002:a17:902:b783:b029:e9:3a03:2a5c with SMTP id\n\te3-20020a170902b783b02900e93a032a5cmr6758487pls.79.1617871869065; \n\tThu, 08 Apr 2021 01:51:09 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 8 Apr 2021 17:50:59 +0900", "Message-Id": "<20210408085101.1691729-2-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.31.0.208.g409f899ff0-goog", "In-Reply-To": "<20210408085101.1691729-1-hiroh@chromium.org>", "References": "<20210408085101.1691729-1-hiroh@chromium.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [RFC PATCH v3 1/3] pipeline: ipu3: Store requests\n\tin the case a buffer shortage", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "PipelineHandlerIPU3 returns -ENOBUFS and -ENOMEM on queueing a\nrequest when there are not sufficient buffers for the request.\nSince the request will be successful if it is queued later when\nenough buffers are available. The requests failed due to a buffer\nshortage should be stored and retried later in the FIFO order.\nThis introduces the queue in IPU3CameraData to do that.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/libcamera/pipeline/ipu3/ipu3.cpp | 58 ++++++++++++++++++----------\n 1 file changed, 37 insertions(+), 21 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 519cad4f..c73e4f7c 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -66,6 +66,7 @@ public:\n \tvoid cio2BufferReady(FrameBuffer *buffer);\n \tvoid paramBufferReady(FrameBuffer *buffer);\n \tvoid statBufferReady(FrameBuffer *buffer);\n+\tint queuePendingRequests();\n \n \tCIO2Device cio2_;\n \tImgUDevice *imgu_;\n@@ -84,6 +85,7 @@ public:\n \n \tstd::unique_ptr<ipa::ipu3::IPAProxyIPU3> ipa_;\n \n+\tstd::queue<Request *> pendingRequests_;\n private:\n \tvoid queueFrameAction(unsigned int id,\n \t\t\t const ipa::ipu3::IPU3Action &action);\n@@ -764,6 +766,8 @@ void PipelineHandlerIPU3::stop(Camera *camera)\n \tIPU3CameraData *data = cameraData(camera);\n \tint ret = 0;\n \n+\tdata->pendingRequests_ = {};\n+\n \tdata->ipa_->stop();\n \n \tret |= data->imgu_->stop();\n@@ -774,36 +778,48 @@ void PipelineHandlerIPU3::stop(Camera *camera)\n \tfreeBuffers(camera);\n }\n \n-int PipelineHandlerIPU3::queueRequestDevice(Camera *camera, Request *request)\n+int IPU3CameraData::queuePendingRequests()\n {\n-\tIPU3CameraData *data = cameraData(camera);\n+\twhile (!pendingRequests_.empty()) {\n+\t\tRequest *request = pendingRequests_.front();\n \n-\tIPU3Frames::Info *info = data->frameInfos_.create(request);\n-\tif (!info)\n-\t\treturn -ENOBUFS;\n+\t\tIPU3Frames::Info *info = frameInfos_.create(request);\n+\t\tif (!info)\n+\t\t\tbreak;\n \n-\t/*\n-\t * Queue a buffer on the CIO2, using the raw stream buffer provided in\n-\t * the request, if any, or a CIO2 internal buffer otherwise.\n-\t */\n-\tFrameBuffer *reqRawBuffer = request->findBuffer(&data->rawStream_);\n-\tFrameBuffer *rawBuffer = data->cio2_.queueBuffer(request, reqRawBuffer);\n-\tif (!rawBuffer) {\n-\t\tdata->frameInfos_.remove(info);\n-\t\treturn -ENOMEM;\n-\t}\n+\t\t/*\n+\t\t * Queue a buffer on the CIO2, using the raw stream buffer\n+\t\t * provided in the request, if any, or a CIO2 internal buffer\n+\t\t * otherwise.\n+\t\t */\n+\t\tFrameBuffer *reqRawBuffer = request->findBuffer(&rawStream_);\n+\t\tFrameBuffer *rawBuffer = cio2_.queueBuffer(request, reqRawBuffer);\n+\t\tif (!rawBuffer) {\n+\t\t\tframeInfos_.remove(info);\n+\t\t\tbreak;\n+\t\t}\n \n-\tinfo->rawBuffer = rawBuffer;\n+\t\tinfo->rawBuffer = rawBuffer;\n \n-\tipa::ipu3::IPU3Event ev;\n-\tev.op = ipa::ipu3::EventProcessControls;\n-\tev.frame = info->id;\n-\tev.controls = request->controls();\n-\tdata->ipa_->processEvent(ev);\n+\t\tipa::ipu3::IPU3Event ev;\n+\t\tev.op = ipa::ipu3::EventProcessControls;\n+\t\tev.frame = info->id;\n+\t\tev.controls = request->controls();\n+\t\tipa_->processEvent(ev);\n+\n+\t\tpendingRequests_.pop();\n+\t}\n \n \treturn 0;\n }\n \n+int PipelineHandlerIPU3::queueRequestDevice(Camera *camera, Request *request)\n+{\n+\tIPU3CameraData *data = cameraData(camera);\n+\tdata->pendingRequests_.emplace(request);\n+\treturn data->queuePendingRequests();\n+}\n+\n bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)\n {\n \tint ret;\n", "prefixes": [ "libcamera-devel", "RFC", "v3", "1/3" ] }