Patch Detail
Show a patch.
GET /api/patches/10958/?format=api
{ "id": 10958, "url": "https://patchwork.libcamera.org/api/patches/10958/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10958/", "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": "<20210122131451.726584-1-naush@raspberrypi.com>", "date": "2021-01-22T13:14:46", "name": "[libcamera-devel,v3,1/6] pipeline: raspberrypi: Refactor stream configuration routine", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "3c53070314cb60664d10f5e1f9b3de039ba31e6f", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/10958/mbox/", "series": [ { "id": 1599, "url": "https://patchwork.libcamera.org/api/series/1599/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1599", "date": "2021-01-22T13:14:46", "name": "[libcamera-devel,v3,1/6] pipeline: raspberrypi: Refactor stream configuration routine", "version": 3, "mbox": "https://patchwork.libcamera.org/series/1599/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10958/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10958/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 75424BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 22 Jan 2021 13:14:57 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3C36C6827B;\n\tFri, 22 Jan 2021 14:14:57 +0100 (CET)", "from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E9096826A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Jan 2021 14:14:56 +0100 (CET)", "by mail-wm1-x32d.google.com with SMTP id c124so4271362wma.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 22 Jan 2021 05:14:56 -0800 (PST)", "from naushir-VirtualBox.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\ti8sm7228870wry.90.2021.01.22.05.14.54\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 22 Jan 2021 05:14: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=\"AUtk3XPv\"; 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:mime-version\n\t:content-transfer-encoding;\n\tbh=dWRbgbE+HncN05cFEYdg9lbeQWBZhpOTBcbxiMPzCu8=;\n\tb=AUtk3XPv/065qGvPxz8xQlLQ5mmzoYIIYIoDsHzTuv3I2NOzfTZk5qZQrHb5yNqdiv\n\tnQ+b5PX3JJ8FGFteqBRINtpoPf1Vs2DEMuwWwPpBl6HuHHnbw/PTRydPTYF35/1msD3e\n\ttkuBYWGgso6rBp78DHoGEFF0+4RKGaMc47yjVPp5+K/B++vRNhGUcz8cPZiu46ZtN+QS\n\tV8rxMS7vqgeGRnvyn2M2BLBwgfrGhje/h7pamVsfIuGow5c3UCAwWLWSZ0QZ9HybZYIH\n\tBVtpoicIeZc/1HTAIeyipwEeBd8jnLDRVFytWm8ldpXXj/watVgVxlazJ9r0tMg4R/Pl\n\trtJw==", "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:mime-version\n\t:content-transfer-encoding;\n\tbh=dWRbgbE+HncN05cFEYdg9lbeQWBZhpOTBcbxiMPzCu8=;\n\tb=UpR6+HEY1QCfpusggRia9EGtM3C0Q3ZR+EzdL+mAFXaWQm5WWQPNLCHBa+3NwTtym0\n\txCFOUp2YG8ih2Knt5x52tCut/GEEZ0//zcBll+Nuh8ystcPyEFcFR/Sejd2/Jzaawygk\n\tdK1T+VxE17apXrJ6OorCQ9GaAcLDQOao/1TWgOYhOUJ4KGEpy6ycIQHk0ZFo7SzVWoxx\n\t4uxeZT2UZFDRQdqa3Ln5n5qvV4WLnDBqrjWQdurHz3fAdbx9EYBRbLZ8+YvOY+rDk3Vk\n\tdPVXIVpBz6wDzY9CJeOcebq32OCHtDmtJealH3LiRdNNOmg0raG1dF2nssF8HvC/UM7V\n\tf5AA==", "X-Gm-Message-State": "AOAM530gpteSg2qJC7kO1mSitdQ2zZtVAl7WEd5Rs2RANiPQPWS7g2ev\n\tCKjed+sI6Orglftk1rRiCz0YugibR6gU4w==", "X-Google-Smtp-Source": "ABdhPJxGdTjhZPzIbLZbBl3kIYvbVA94V+gb2Oizaf0ka4C+0KRmjalfop2A+Nfjq7gcuOFxbuHqQA==", "X-Received": "by 2002:a7b:cf3a:: with SMTP id m26mr3991369wmg.55.1611321295485;\n\tFri, 22 Jan 2021 05:14:55 -0800 (PST)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 22 Jan 2021 13:14:46 +0000", "Message-Id": "<20210122131451.726584-1-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v3 1/6] 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>\nReviewed-by: David Plowman <david.plowman@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 524cc960dd37..d9895c779725 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 : &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 get requested format on \" << stream->name()\n+\t\t\t\t<< \", returned \" << 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", "v3", "1/6" ] }