Show a patch.

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

{
    "id": 15077,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/15077/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/15077/",
    "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": "<20211208094211.1251311-2-naush@raspberrypi.com>",
    "date": "2021-12-08T09:42:11",
    "name": "[libcamera-devel,2/2] pipeline: raspberrypi: Restrict the advertised maximum ISP output resolution",
    "commit_ref": "f16acb275c85518c13e81ffa6503347abcc01dc5",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "1bef47682228f1560bb91cf586710994a71e0fa1",
    "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/15077/mbox/",
    "series": [
        {
            "id": 2825,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2825/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2825",
            "date": "2021-12-08T09:42:10",
            "name": "[libcamera-devel,1/2] pipeline: raspberrypi: Reduce logging verbosity",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2825/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/15077/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/15077/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 6127FC324B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  8 Dec 2021 09:42:18 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9AF916087A;\n\tWed,  8 Dec 2021 10:42:17 +0100 (CET)",
            "from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n\t[IPv6:2a00:1450:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4132B60225\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  8 Dec 2021 10:42:16 +0100 (CET)",
            "by mail-wr1-x42c.google.com with SMTP id i5so3026911wrb.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 08 Dec 2021 01:42:16 -0800 (PST)",
            "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:27d5:9305:f572:6623])\n\tby smtp.gmail.com with ESMTPSA id\n\tt127sm5279951wma.9.2021.12.08.01.42.15\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 08 Dec 2021 01:42:15 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"DXJSWAi8\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=A7WhXwvVvQd6xB5i0I/8oDkRHjG4O5d4gvylgMkQj+A=;\n\tb=DXJSWAi8ebmdnPc6VKYRd3LY4YNvdb5WDPrv2M5kYviF5yG5j3sdQkq/0LL/sUh5le\n\tstQJUmW4c7f5Taw6dpfs10tI6U1o2j3arQYf/kGmrZzkp2CEpAp02ga/hIETldHpzFZY\n\ty+s/zuSuPI6z3tX1npV1Ed9evckua1uh7nxCKDovU7UpZ+fKX79gVk73ioJVu6jlz9/F\n\tyVKJmDnZo5rGfi4RH1jwv20FLuSpUWaYGhOl9X4XmX2cE2V08NR3KJpdXOydUK77GDiK\n\tPydDXK3TQpWJ/wXry8iNwnMy0mnwlgktkPMBjwObEAmM7zxlbTRgUYs41TTF2FafCb9c\n\th5hQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=A7WhXwvVvQd6xB5i0I/8oDkRHjG4O5d4gvylgMkQj+A=;\n\tb=P87WMEEZHy1DgHNJ4+MzVtNEFAlLcxvdVBQn2HZjZriVOB763gjPvfP30Yyy9mS1Lh\n\t5DAWWb0QwGYLCY8Sx+L+gBTI2dPo8j9VOGyFAgMJAnCuPMoQtv5Qda72joeynMXeMAYT\n\tnK07vnevPGnJG50RxkHNCcn7IqHfIvD1N+ck9J6gGbDhRBsHrSWo6kOLw44mq35cP1bE\n\t/NiigYw3rW2xFauGoUfr8bgqkMpBtAzmvZWKdK3UN0DEmeEC/GZYy+KNoq8AW+w7FPa6\n\tIjsd514pKvnGnlaG8wMFR+c+0TMxFRsFEjiseOXxW5hXE/KddKF5VQZBpWVqik5YtuhE\n\tEAJw==",
        "X-Gm-Message-State": "AOAM532qm+WmHKTBx25NitWopcCwEBGDryYarYgxJ3UrRTUUv88gQ4zJ\n\tWObNmoet/sbOlFntrjxWYGhPv9mlgI8DL8AB",
        "X-Google-Smtp-Source": "ABdhPJzDRmRgek1+FXZOIdT29C9wfh5eNSUETnHiItOZvNcSM/s5N5vftrHSg35CZR6B10a10lywuQ==",
        "X-Received": "by 2002:adf:e512:: with SMTP id\n\tj18mr58155084wrm.532.1638956535788; \n\tWed, 08 Dec 2021 01:42:15 -0800 (PST)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  8 Dec 2021 09:42:11 +0000",
        "Message-Id": "<20211208094211.1251311-2-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20211208094211.1251311-1-naush@raspberrypi.com>",
        "References": "<20211208094211.1251311-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 2/2] pipeline: raspberrypi: Restrict the\n\tadvertised maximum ISP output resolution",
        "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": "Limit the advertised ISP output sizes available to the sensor resolution in\nPipelineHandlerRPi::generateConfiguration(). The user is free to configure a\nlarger resolution than this, and this will work. However, this stops strange\nbehavior in applications that use the V4L2 compatability layer to run, and\nrequest the largest possible advertised resolution, which is much larger than\nthe sensor resolution.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 13 +++++++++----\n 1 file changed, 9 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 4479e732a645..6ee975e85567 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -531,10 +531,11 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n \n \tunsigned int rawCount = 0;\n \tunsigned int outCount = 0;\n+\tSize sensorSize = data->sensor_->resolution();\n \tfor (const StreamRole role : roles) {\n \t\tswitch (role) {\n \t\tcase StreamRole::Raw:\n-\t\t\tsize = data->sensor_->resolution();\n+\t\t\tsize = sensorSize;\n \t\t\tsensorFormat = findBestFormat(data->sensorFormats_, size, defaultRawBitDepth);\n \t\t\tpixelFormat = mbusCodeToPixelFormat(sensorFormat.mbus_code,\n \t\t\t\t\t\t\t    BayerFormat::Packing::CSI2);\n@@ -547,7 +548,7 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n \t\t\tfmts = data->isp_[Isp::Output0].dev()->formats();\n \t\t\tpixelFormat = formats::NV12;\n \t\t\t/* Return the largest sensor resolution. */\n-\t\t\tsize = data->sensor_->resolution();\n+\t\t\tsize = sensorSize;\n \t\t\tbufferCount = 1;\n \t\t\toutCount++;\n \t\t\tbreak;\n@@ -600,11 +601,15 @@ CameraConfiguration *PipelineHandlerRPi::generateConfiguration(Camera *camera,\n \t\t\t\t\t\tstd::forward_as_tuple(format.second.begin(), format.second.end()));\n \t\t\t}\n \t\t} else {\n-\t\t\t/* Translate the V4L2PixelFormat to PixelFormat. */\n+\t\t\t/*\n+\t\t\t * Translate the V4L2PixelFormat to PixelFormat. Note that we\n+\t\t\t * limit the recommended largest ISP output size to match the\n+\t\t\t * sensor resolution.\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\tdeviceFormats[pf] = format.second;\n+\t\t\t\t\tdeviceFormats[pf].emplace_back(sensorSize);\n \t\t\t}\n \t\t}\n \n",
    "prefixes": [
        "libcamera-devel",
        "2/2"
    ]
}