Show a patch.

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

{
    "id": 10905,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/10905/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/10905/",
    "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": "<20210120083449.642418-2-naush@raspberrypi.com>",
    "date": "2021-01-20T08:34:45",
    "name": "[libcamera-devel,1/5] pipeline: raspberrypi: Refactor stream configuration routine",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "417496d31944ef517f4b33d63d1df8b17d63f396",
    "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/10905/mbox/",
    "series": [
        {
            "id": 1587,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1587/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1587",
            "date": "2021-01-20T08:34:44",
            "name": "Raspberry Pi: Colour denoise",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1587/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/10905/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/10905/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 9053DC0F2A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 20 Jan 2021 08:34:58 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C4C8568178;\n\tWed, 20 Jan 2021 09:34:57 +0100 (CET)",
            "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CC81168174\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Jan 2021 09:34:55 +0100 (CET)",
            "by mail-wr1-x433.google.com with SMTP id l12so16981456wry.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 20 Jan 2021 00:34:55 -0800 (PST)",
            "from naushir-VirtualBox.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\t33sm2809284wrn.35.2021.01.20.00.34.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 20 Jan 2021 00:34:54 -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=\"HvgQ1heE\"; 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=8CsZbCNSoM5n/uECUpVfmsDnCu3jKktYa/VPQ0evMBI=;\n\tb=HvgQ1heES08ymj40Lr09kpTbmNZ4LyE4QfCwyu3dCvzW369Rtpw0706Rb06siZUTXc\n\tU9brRf4OK1cS4EM6IMM3hy8qGjIg/5Sb5kMSQQFaF+tf+qJEKbsqyQwGwSNDGTHTGzWS\n\tg+uEXrWumWUBkAMOGpZf29FpiniiE5VvpF8mzKBAqMGOIwYGEYDZ1Sx+1KiBAsGXhRUp\n\toz9PnIMzlmbvNk3uCZHLaOOya1CC23S/9KQ27fQwzgQ8mz1Do4uvUEWv9BFiXQnsBM8T\n\tdjtnoA+m0c1rj3dwsBH9XzNbkys7osOxptbss7Q12IeQsYitT+iOsGjdxjU/r84Y2mZx\n\tlJew==",
        "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=8CsZbCNSoM5n/uECUpVfmsDnCu3jKktYa/VPQ0evMBI=;\n\tb=t3TTVqy3FvjXYc9clbXeI8D4lMppLECNwG6X4yPuEiNASsozWwnMUYEacEjhr1HLlf\n\tDOWwRZ0OI5gQUMrAtWD6Orzx0WSwjjlk/ng2zX6UrgPhY5gAm2wy3N4P19fefnKgQptO\n\t4AglMW1qxLZOJp/PojPRcTSR8YmUWEJdLMP0mXGysn3MGO14TqgASWZ/FHY+aIaTmSqY\n\t4OUM78qVaD9qMbYzPzcoou/EpmCmIDwZTFQZaEjWXXQuEevmCfaJ3vydDnfGAYfpqnlW\n\tJNBmqKxXCPP/0nEGpi1ktKdaEwO0mVWQ7wVJOhlwrgXqxpF+AdwgESmnJNEocYGBmmZ9\n\tDFfA==",
        "X-Gm-Message-State": "AOAM533vpkyb61S3WWEHyB7iePxMkTZSq6fAyUMwRPvHVluYrE29l29D\n\tPoYR3azU75UHEe5JKv/mF9Irv50ACqrWXQ==",
        "X-Google-Smtp-Source": "ABdhPJyuyR9Dosczh3mi7Mj2Pdc2A+n3hD7RBaO2bCGgt8dBdVIU/VJ3akp0CGTF6k91lPKhcJ9MZQ==",
        "X-Received": "by 2002:adf:ce90:: with SMTP id\n\tr16mr8217214wrn.100.1611131695213; \n\tWed, 20 Jan 2021 00:34:55 -0800 (PST)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 20 Jan 2021 08:34:45 +0000",
        "Message-Id": "<20210120083449.642418-2-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210120083449.642418-1-naush@raspberrypi.com>",
        "References": "<20210120083449.642418-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 1/5] pipeline: raspberrypi: Refactor\n\tstream configuration routine",
        "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": "Refactor the high/low resolution stream format and output selection\nroutine. This change is in preparation of adding 1/4 resolution output\nfor fast colour denoise.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 57 ++++++-------------\n 1 file changed, 16 insertions(+), 41 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex f121328ee9a9..e03bcb036f9f 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -624,52 +624,27 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n \t\t\tcontinue;\n \t\t}\n \n-\t\tif (i == maxIndex) {\n-\t\t\t/* ISP main output format. */\n-\t\t\tV4L2VideoDevice *dev = data->isp_[Isp::Output0].dev();\n-\t\t\tV4L2PixelFormat fourcc = dev->toV4L2PixelFormat(cfg.pixelFormat);\n-\t\t\tformat.size = cfg.size;\n-\t\t\tformat.fourcc = fourcc;\n-\n-\t\t\tret = dev->setFormat(&format);\n-\t\t\tif (ret)\n-\t\t\t\treturn -EINVAL;\n-\n-\t\t\tif (format.size != cfg.size || format.fourcc != fourcc) {\n-\t\t\t\tLOG(RPI, Error)\n-\t\t\t\t\t<< \"Failed to set format on ISP capture0 device: \"\n-\t\t\t\t\t<< format.toString();\n-\t\t\t\treturn -EINVAL;\n-\t\t\t}\n-\n-\t\t\tcfg.setStream(&data->isp_[Isp::Output0]);\n-\t\t\tdata->isp_[Isp::Output0].setExternal(true);\n-\t\t}\n+\t\t/* The largest resolution gets routed to the ISP Output 0 node. */\n+\t\tRPi::Stream *stream = (i == maxIndex) ? &data->isp_[Isp::Output0] :\n+\t\t\t\t\t\t\t&data->isp_[Isp::Output1];\n \n-\t\t/*\n-\t\t * ISP second output format. This fallthrough means that if a\n-\t\t * second output stream has not been configured, we simply use\n-\t\t * the Output0 configuration.\n-\t\t */\n-\t\tV4L2VideoDevice *dev = data->isp_[Isp::Output1].dev();\n-\t\tformat.fourcc = dev->toV4L2PixelFormat(cfg.pixelFormat);\n+\t\tV4L2PixelFormat fourcc = stream->dev()->toV4L2PixelFormat(cfg.pixelFormat);\n \t\tformat.size = cfg.size;\n+\t\tformat.fourcc = fourcc;\n \n-\t\tret = dev->setFormat(&format);\n-\t\tif (ret) {\n+\t\tret = stream->dev()->setFormat(&format);\n+\t\tif (ret)\n+\t\t\treturn -EINVAL;\n+\n+\t\tif (format.size != cfg.size || format.fourcc != fourcc) {\n \t\t\tLOG(RPI, Error)\n-\t\t\t\t<< \"Failed to set format on ISP capture1 device: \"\n-\t\t\t\t<< format.toString();\n-\t\t\treturn ret;\n-\t\t}\n-\t\t/*\n-\t\t * If we have not yet provided a stream for this config, it\n-\t\t * means this is to be routed from Output1.\n-\t\t */\n-\t\tif (!cfg.stream()) {\n-\t\t\tcfg.setStream(&data->isp_[Isp::Output1]);\n-\t\t\tdata->isp_[Isp::Output1].setExternal(true);\n+\t\t\t\t<< \"Failed to set format on \" << stream->name()\n+\t\t\t\t<< \" to \" << format.toString();\n+\t\t\treturn -EINVAL;\n \t\t}\n+\n+\t\tcfg.setStream(stream);\n+\t\tstream->setExternal(true);\n \t}\n \n \t/* ISP statistics output format. */\n",
    "prefixes": [
        "libcamera-devel",
        "1/5"
    ]
}