Patch Detail
Show a patch.
GET /api/patches/11840/?format=api
{ "id": 11840, "url": "https://patchwork.libcamera.org/api/patches/11840/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11840/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20210406085153.3818580-2-hiroh@chromium.org>", "date": "2021-04-06T08:51:52", "name": "[libcamera-devel,v2,1/2] pipeline: ipu3: Store requests in the case a buffer shortage", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a2fc497fa1d0a797ae2129698c0ca7868d23b7d9", "submitter": { "id": 63, "url": "https://patchwork.libcamera.org/api/people/63/?format=api", "name": "Hirokazu Honda", "email": "hiroh@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11840/mbox/", "series": [ { "id": 1893, "url": "https://patchwork.libcamera.org/api/series/1893/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1893", "date": "2021-04-06T08:51:51", "name": "ipu3: Enable to handle a number of concurrent requests", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1893/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11840/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11840/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 26240C0DA3\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 6 Apr 2021 08:52:08 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AC0D3687A1;\n\tTue, 6 Apr 2021 10:52:06 +0200 (CEST)", "from mail-pg1-x529.google.com (mail-pg1-x529.google.com\n\t[IPv6:2607:f8b0:4864:20::529])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5F4C360517\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 6 Apr 2021 10:52:02 +0200 (CEST)", "by mail-pg1-x529.google.com with SMTP id t22so2714646pgu.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 06 Apr 2021 01:52:02 -0700 (PDT)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:4180:40db:6f79:a143])\n\tby smtp.gmail.com with ESMTPSA id\n\ty7sm18070135pfq.70.2021.04.06.01.51.59\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 06 Apr 2021 01:52:00 -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=\"G7Z3eFdo\"; 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=G7Z3eFdo5SZ1bdUSsW2DK9l7xWVlgOrw/+m/bcqaGqbXatPzltg+GPhXCq//aSCGd5\n\ttwfeCTaeKxF25jfhs0FN8kQlKeMakv+ax7WwuusrD2equtGU0VdMocAr0CLGFXOjvGP9\n\tqlYz6Mq8hALb+MUzErVUEEpvCPCoNzKngN0Bc=", "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=rFHaUZKAbZK6fgQbblIvEm+c3MgkNTmshDg2+XJvl2fbMMudvlTx/geIqXyd3WZiVV\n\tSMOP7tCILNPB+iV/d0FZT9ZoZpVwENqwtCMlCEzNA7Deyx/Q8YfMx23DYgBWQV1Nc8/B\n\twa8LnQvWZczIlkSrgQXY0/EmFJXRMzRlI9h6Aa8CgJHMboiCxQR0SBCVPpYosQc4EqNI\n\t5iSjBo8oThJrOZpl1WfH1hzSjtR9PxbpPlC7qcjmVsAHszElfohx2wJOUlJyjSwvedUd\n\tH6Yz2wng+1/r4CxQS+q5lKSfaF+gWQDPLrPlZ/PTnT3XdfJyT+HowjS+uEkhkb1SGP0W\n\t/ViA==", "X-Gm-Message-State": "AOAM531o1KxaDbGwytE/njLjzngWEtWvlaLGs/nbPBCh54MaS/JRB6kc\n\t589pDBAcujTqzqqxqcD9cUc16b4vTkf7RQ==", "X-Google-Smtp-Source": "ABdhPJzHRJ/6cYo8ZQ17dQ2eexqlYq3aiIv9gOBa8nsSfYmCiiecPIZy7zK3gFatn3qmeC6x6reyQA==", "X-Received": "by 2002:aa7:900d:0:b029:230:2d6a:2940 with SMTP id\n\tm13-20020aa7900d0000b02902302d6a2940mr24676496pfo.23.1617699120395; \n\tTue, 06 Apr 2021 01:52:00 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 6 Apr 2021 17:51:52 +0900", "Message-Id": "<20210406085153.3818580-2-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.31.0.208.g409f899ff0-goog", "In-Reply-To": "<20210406085153.3818580-1-hiroh@chromium.org>", "References": "<20210406085153.3818580-1-hiroh@chromium.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v2 1/2] pipeline: ipu3: Store requests in\n\tthe 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", "v2", "1/2" ] }