Show a patch.

GET /api/patches/19952/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 19952,
    "url": "https://patchwork.libcamera.org/api/patches/19952/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19952/",
    "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": "<20240425105200.41167-1-david.plowman@raspberrypi.com>",
    "date": "2024-04-25T10:52:00",
    "name": "pipeline: rpi: Avoid duplicating size range for the same pixel format",
    "commit_ref": "5e85157bcf156137259c57a2ebc5d5616dbb2e37",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "191ae52da9a60585abc63b1d8e38905cb598f4c0",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/19952/mbox/",
    "series": [
        {
            "id": 4272,
            "url": "https://patchwork.libcamera.org/api/series/4272/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4272",
            "date": "2024-04-25T10:52:00",
            "name": "pipeline: rpi: Avoid duplicating size range for the same pixel format",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4272/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19952/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19952/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 A231EC3220\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Apr 2024 10:52:06 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B6D3E633F4;\n\tThu, 25 Apr 2024 12:52:05 +0200 (CEST)",
            "from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 48ECB61A9B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Apr 2024 12:52:04 +0200 (CEST)",
            "by mail-wm1-x32c.google.com with SMTP id\n\t5b1f17b1804b1-41b5e74f7d1so1613115e9.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Apr 2024 03:52:04 -0700 (PDT)",
            "from pi5-davidp.pitowers.org\n\t([2001:4d4e:300:1f:c732:5d0a:406b:ae46])\n\tby smtp.gmail.com with ESMTPSA id\n\te4-20020a05600c4e4400b0041b0f10fc7asm4956519wmq.31.2024.04.25.03.52.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 25 Apr 2024 03:52:03 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"tUlUJ4ta\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1714042323; x=1714647123;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:from:to:cc:subject:date:message-id:reply-to;\n\tbh=JPcAxzTXAmFFhUiHHwW69jiZxNOr3P+QZ25HWVEtvv0=;\n\tb=tUlUJ4tabWxmpML7OULjRUs8WpST5vWTRNhjZzSpmNaVJMD3Tt0p/RiRy/H17YtLQn\n\tgOhCmsKT18BEFDAXMXI9iEaBHAfSLfNs40wovPg0582AZfbNnrTyKdaf1cAjpahCFB5u\n\tDyBs6FzQYy0tPZCGkyLj2/MUks72VYMrtmit9rXyq2EsnMcTt9YExMgd6gIw5JARt/Vh\n\tv9pdmXtuntXF+7XNkcpTT91b2iT9XsMaBvbAhVX2lMEFVDo2Z4AqhwMyd1k8enU1naHj\n\tIpcO7i17s0sPc9K8jlH1GD/hOkdqt9ETTTKOCr0O2PaakYD++zLouWsoGqCoI80K60is\n\tdAXQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1714042323; x=1714647123;\n\th=content-transfer-encoding:mime-version:message-id:date:subject:cc\n\t:to:from:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=JPcAxzTXAmFFhUiHHwW69jiZxNOr3P+QZ25HWVEtvv0=;\n\tb=XmA0bu7H2qvIJOyhU4fMLrWpA5gLgf+CrL9DYpKDfAQjKH2rkOCEd2StM1GSRglG2Y\n\tJJzaezHzaCif3T6KoewZOPDommN+lFACiuRSiRF7oaUmAD/yVpiT9u8Ggn7kdUwi4nlf\n\t2O7Ik0p18blGVJIpdlDiqetnt0OxcaRzTMXK4RYyNGXCd0SvhXigIfzieefs4awxQUE9\n\tgHxyzXHoT5Vgsh/b1vyivguR21/P2x3RsrIgW1OSSSJdC7VlJj+nBVebDRPLB9unjb6R\n\t45UexAO59gxuoE1dINk3Qbjwn5b76Iej+y0EhroJlegEg3pOn0C8U+NvK4GY9mkpHGKW\n\tzfXQ==",
        "X-Gm-Message-State": "AOJu0YyHZ+C6KYiWFA97bibi9yQES825ffgqYEmRNm6Dn0B85hjlLb7a\n\ttvw8mLXobyY6Q0BIgNTg2hfFpis8De0ZQWKLaucvfq859gaH5Rc5X6oxo3oVhKaSZA8nZ5KJVX/\n\tY",
        "X-Google-Smtp-Source": "AGHT+IHKWXQG5KhpzWyW+0qtCxDxqvTjQTywlmGZh61qQfC+X3lqPZ2collt171dg/AFaRpUHSnFbQ==",
        "X-Received": "by 2002:a05:600c:470b:b0:418:969b:cb46 with SMTP id\n\tv11-20020a05600c470b00b00418969bcb46mr3776341wmo.28.1714042323445; \n\tThu, 25 Apr 2024 03:52:03 -0700 (PDT)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "David Plowman <david.plowman@raspberrypi.com>",
        "Subject": "[PATCH] pipeline: rpi: Avoid duplicating size range for the same\n\tpixel format",
        "Date": "Thu, 25 Apr 2024 11:52:00 +0100",
        "Message-Id": "<20240425105200.41167-1-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Some V4L2 formats translate to the same pixel format, e.g. YU12 and\nYM12 both produce YUV420. In this case our ISP driver advertises the\nsame size range for both, but we must not record the same thing twice\nfor the same pixel format (which will cause a failure later on).\n\nInstead, ignore the V4l2 format if the pixel format has already been\nseen.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\nindex 7e420b3f..0034e06d 100644\n--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n@@ -474,7 +474,11 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole\n \t\t\t */\n \t\t\tfor (const auto &format : fmts) {\n \t\t\t\tPixelFormat pf = format.first.toPixelFormat();\n-\t\t\t\tif (pf.isValid()) {\n+\t\t\t\t/*\n+\t\t\t\t * Some V4L2 formats translate to the same pixel format (e.g. YU12, YM12\n+\t\t\t\t * both give YUV420). We must avoid duplicating the range in this case.\n+\t\t\t\t */\n+\t\t\t\tif (pf.isValid() && deviceFormats.find(pf) == deviceFormats.end()) {\n \t\t\t\t\tconst SizeRange &ispSizes = format.second[0];\n \t\t\t\t\tdeviceFormats[pf].emplace_back(ispSizes.min, sensorSize,\n \t\t\t\t\t\t\t\t       ispSizes.hStep, ispSizes.vStep);\n",
    "prefixes": []
}