Patch Detail
Show a patch.
GET /api/1.1/patches/18883/?format=api
{ "id": 18883, "url": "https://patchwork.libcamera.org/api/1.1/patches/18883/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18883/", "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": "<20230725085540.24863-2-naush@raspberrypi.com>", "date": "2023-07-25T08:55:37", "name": "[libcamera-devel,v2,1/4] pipeline: rpi: Increase buffer import count to 32", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "7af37abdc46a653a1395f7db53f2ed03147d50f3", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18883/mbox/", "series": [ { "id": 3984, "url": "https://patchwork.libcamera.org/api/1.1/series/3984/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3984", "date": "2023-07-25T08:55:36", "name": "Raspberry Pi: External buffer handling", "version": 2, "mbox": "https://patchwork.libcamera.org/series/3984/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18883/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18883/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 A605DBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 Jul 2023 08:56:13 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 415C9628C9;\n\tTue, 25 Jul 2023 10:56:12 +0200 (CEST)", "from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2E9F1600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Jul 2023 10:56:09 +0200 (CEST)", "by mail-wr1-x42e.google.com with SMTP id\n\tffacd0b85a97d-307d58b3efbso3979651f8f.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 Jul 2023 01:56:09 -0700 (PDT)", "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tl7-20020adfe587000000b0030c4d8930b1sm1951225wrm.91.2023.07.25.01.56.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 25 Jul 2023 01:56:08 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1690275372;\n\tbh=ndwGG39Zi/V4yxjywlwnNVk3qm5qDJ4+3Q6rmZjUI1w=;\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=NGuwR2VuCqMBEd6bBVMZyVlk5U7TZlGaA6X07/DW7+RIZANO4gIIk6dWCrJuNSwvv\n\t8r1Cu348hdQLWA2o+Hix/D+jZM7beQg4M7vEH1YL7L1rLdcjgG9mQIh/kn3w2AjgE2\n\tvlESi7FCAu0Saa0PbyG//V+huTT2NzNrmQDJ2qYi+CpWZ+mD4NQ8DRDcIV40umlxXl\n\tpEw9yrLZh+b1j7VjndaiwVfRqMbCff74j1YiRKF3GftYZ4i5qU2C/ss+vbwGGwMLKY\n\tRtyb0k5Zckgp18eBFzvKsMMU9xqWENNTpyzvwKcL/pjdrIq/f3m9Dyqew+y8LTaZhJ\n\tF+dKd5GvaR2Wg==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1690275368; x=1690880168;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=i0qfxmPM4aPbKwF9/i7e0Pipi64he2NaFnBbAWHpLMg=;\n\tb=t234JUu7TL+1bEeaieC+sbjjqwb5kHSTZkhxqc0oBTI/ZmVFajc7X9uEVhc+HS8s2H\n\t7yZNZ0wiJxaq56m3LZHXMrBSJaJ0SKEyh2qDVAyzthsjb0UuyLJI9VU9LZTwnZ23nb8B\n\tLdxCMMfzRY/AYV5LplfMAT63djhBQE0mKVBcKWGoDcpCZzuk7+nBspiMZmnJZW7ZIm36\n\teHP8UZN2Rlqn8SZaflZ4LJVxFLPus7UVJfD1luaVQ7zLi0MFE3h8nrGMNzxpEPT6sydv\n\teBfhP/otpgnUwy8G12rG8OjuvQaPikGM7lyxAGl1Yc5Tz7xCk2HB2qPt99oIYvstQxXd\n\tryAg==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"t234JUu7\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1690275368; x=1690880168;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=i0qfxmPM4aPbKwF9/i7e0Pipi64he2NaFnBbAWHpLMg=;\n\tb=kvaqhcIeIJKydx4saa4/53+0pxZGO/j9Lt9DPJopyS6tOJ3gNp9gkaIpr4P+LaN5v8\n\tBj72uXkCTjEscSP26y8uuciv33zuHJ1frZkDlPeRX0DD5IdfivHFhyqjP5atDhMNO4Jz\n\tTbbmjg3z1/mROnhGsHrwFP/g9e9fRabnttNXh9Dh2F2gsANq9KLqoOofzAQHzmadnsI6\n\tu1iXwh+Y0SG3FeRaLdQwFlPTzeoj4wUB5o/+JCnh673pOSZqWoCzhiNerx7r/tALja2B\n\toKG6ltaVDa22uo4BiPZ0/670jje8ScgsDRcJjJLgMerW16JFQpUQ8UM5v9aCeYMjKq1U\n\tLHlw==", "X-Gm-Message-State": "ABy/qLbyCR9gBmxeqYX43WXOnrs1CxOFXBWVIbHqOFfa7yH3fM7hs8EL\n\tFQZ1dBtlJU2fmZKvgwd/Pa//1bcIb3dvMJGbGj+Elg==", "X-Google-Smtp-Source": "APBJJlGzHBdSKbGoKLpbBOy4nOsxFY4/MQkqUbp0y99ZZd6QeicipK/y0WLukUU88gYln/IXh0qWaA==", "X-Received": "by 2002:a5d:6244:0:b0:311:142d:5d97 with SMTP id\n\tm4-20020a5d6244000000b00311142d5d97mr8394773wrv.31.1690275368352; \n\tTue, 25 Jul 2023 01:56:08 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 25 Jul 2023 09:55:37 +0100", "Message-Id": "<20230725085540.24863-2-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230725085540.24863-1-naush@raspberrypi.com>", "References": "<20230725085540.24863-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 1/4] pipeline: rpi: Increase buffer\n\timport count to 32", "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": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Naushir Patuck <naush@raspberrypi.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Hardcode the maximum number of buffers imported to the V4L2 video device\nto 32. This only has a minor disadvantage of over-allocating cache slots\nand V4L2 buffer indexes, but does allow more headroom for using dma\nbuffers allocated from outside of libcamera.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/rpi/common/rpi_stream.cpp | 33 +++++--------------\n 1 file changed, 8 insertions(+), 25 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\nindex c158843cb0ed..e9ad1e6f0848 100644\n--- a/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n+++ b/src/libcamera/pipeline/rpi/common/rpi_stream.cpp\n@@ -95,34 +95,17 @@ int Stream::prepareBuffers(unsigned int count)\n \tint ret;\n \n \tif (!(flags_ & StreamFlag::ImportOnly)) {\n-\t\tif (count) {\n-\t\t\t/* Export some frame buffers for internal use. */\n-\t\t\tret = dev_->exportBuffers(count, &internalBuffers_);\n-\t\t\tif (ret < 0)\n-\t\t\t\treturn ret;\n-\n-\t\t\t/* Add these exported buffers to the internal/external buffer list. */\n-\t\t\tsetExportedBuffers(&internalBuffers_);\n-\t\t\tresetBuffers();\n-\t\t}\n+\t\t/* Export some frame buffers for internal use. */\n+\t\tret = dev_->exportBuffers(count, &internalBuffers_);\n+\t\tif (ret < 0)\n+\t\t\treturn ret;\n \n-\t\t/* We must import all internal/external exported buffers. */\n-\t\tcount = bufferMap_.size();\n+\t\t/* Add these exported buffers to the internal/external buffer list. */\n+\t\tsetExportedBuffers(&internalBuffers_);\n+\t\tresetBuffers();\n \t}\n \n-\t/*\n-\t * If this is an external stream, we must allocate slots for buffers that\n-\t * might be externally allocated. We have no indication of how many buffers\n-\t * may be used, so this might overallocate slots in the buffer cache.\n-\t * Similarly, if this stream is only importing buffers, we do the same.\n-\t *\n-\t * \\todo Find a better heuristic, or, even better, an exact solution to\n-\t * this issue.\n-\t */\n-\tif ((flags_ & StreamFlag::External) || (flags_ & StreamFlag::ImportOnly))\n-\t\tcount = count * 2;\n-\n-\treturn dev_->importBuffers(count);\n+\treturn dev_->importBuffers(32);\n }\n \n int Stream::queueBuffer(FrameBuffer *buffer)\n", "prefixes": [ "libcamera-devel", "v2", "1/4" ] }