Show a patch.

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

{
    "id": 16177,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/16177/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/16177/",
    "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": "<20220606085825.1145654-2-naush@raspberrypi.com>",
    "date": "2022-06-06T08:58:25",
    "name": "[libcamera-devel,1/1] camera_sensor: Suppress error message if test patterns are unavailable",
    "commit_ref": "7ee7dc3369ebf26d142b6352cb3d309f48600433",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "aa8c01dddbd6911fd8c0ae00336dd6ff7399825e",
    "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/16177/mbox/",
    "series": [
        {
            "id": 3163,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3163/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3163",
            "date": "2022-06-06T08:58:24",
            "name": "Suppress test pattern error message",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3163/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/16177/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/16177/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 AB965C326B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Jun 2022 08:58:55 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0F3A56563D;\n\tMon,  6 Jun 2022 10:58:55 +0200 (CEST)",
            "from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com\n\t[IPv6:2a00:1450:4864:20::42b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0153365633\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Jun 2022 10:58:53 +0200 (CEST)",
            "by mail-wr1-x42b.google.com with SMTP id q26so8553052wra.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 06 Jun 2022 01:58:53 -0700 (PDT)",
            "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:e73c:a66f:e321:48cf])\n\tby smtp.gmail.com with ESMTPSA id\n\tp8-20020a1c5448000000b003942a244ed7sm16315565wmi.28.2022.06.06.01.58.52\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 06 Jun 2022 01:58:52 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1654505935;\n\tbh=mlEbzloUCfOHmap+OJtdXrzJm5Q6nU6PeeLrf0cS7ws=;\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=mlooGETvlco68Ni2UjOePMkyR5I9le4iyFs/OWWEl+0/AyD7Ci/qSPfGHvOIUE57E\n\tRvIPwGFwSMlNoWpWzzCHARf+w9K4lea5aF1MuZNDFtnS93cFRH6yf1Olfr87W2z3jC\n\t7VQKDO8dHoCKEsVbQxD+5wSbKny9g9L9BZXGwwCMcS+J6MouSWEwGUPpL567CfOZe+\n\tzh3QX3ya7L87uUQu69yUf83XreunUo+C9zCtsmb0CqcKMrGCYiFY90cdD5OSbIJM+m\n\tTvJdM0uH32nEUTQsLI+tcQfaHfGBHsY4nODI/JpoI/MRpw5tL/eX/7xpdCBaEQJ+Tr\n\tLgGLziuY4eueg==",
            "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=TwZ9q8R2jtEVzc/oXMZe9zQnwVFeDOp8WcEV7te+Cqk=;\n\tb=PFZaWLjCwOcZWBeRENYq+RyIubOkvisn0IcCZSEcAt9OklJFwmQ4InTcPerUWtRcWf\n\t++krs0XxWlctr7D1JlIYowa4oGfKVMur7WfSCYtR9ZOBMhybW3N2Ue/NJsJRX+U/GwWP\n\teTv7iPwh1nsesKBC0mPHphKoICiZEp9qcMtNFmy3CId3bkSbhRZcR2430bBhBWQG9fYE\n\tTCeQLn8KUHQuW+DeJqj6UT+Q55VYW33gXRJSz5RhYVnowZVppFgkPqs0OXaowATaSKVG\n\t2NE74jISwt4heg0GS0SeSfju6OAdwPR9jgT9H57Irhd06DPfM1yLKS1hhi0W3F3I7uXH\n\tnGJw=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"PFZaWLjC\"; dkim-atps=neutral",
        "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=TwZ9q8R2jtEVzc/oXMZe9zQnwVFeDOp8WcEV7te+Cqk=;\n\tb=vLKVOKcP3A9S1T6HN5nQ494N3P9mD8vtVWcDM1+MIUXAv/tRsyvOQLbwXB1hsTtevA\n\tptkj4DmDuP+fwYMzCGEGiAJ6GijniJy99RFKRtoniMsTGiwuUX9wNKnPDcCJi5ml8iXt\n\tRHBSwD9lB3lnLfqpqX0e+4Fua6qpRw4NPghZwmpxM+Oz/ojfEloVe00u+cU2VSpt9qZ7\n\tEHvK5QwNTLt/Lw7gJe8FwKfPmss6sAgZi/q0dMNc2xdqcSRDoGK9RGxw7Yt5qM1wT79g\n\tFfnc6azLJZRugBoQEASyFFTJF/0oE4R92kC2qW/GbGCG5gjoP8C2mix26EfNjjWS3yCj\n\tNF/w==",
        "X-Gm-Message-State": "AOAM5314E79qFmxf+TnfP0CVonbZSRz5c6054zuFncU768NZy2LgNU62\n\tNtFu0c2VGqwepmJXVHoFjj0Vmk4q6NJpcg==",
        "X-Google-Smtp-Source": "ABdhPJxKWZtxmvn7ctxrFZMgph2lQU1xvCPWvUBAVim0TO/70ziyOwt0q6eI+oag0Q0qlcvV4WCcfQ==",
        "X-Received": "by 2002:adf:d84b:0:b0:212:1c7c:5790 with SMTP id\n\tk11-20020adfd84b000000b002121c7c5790mr19593221wrl.366.1654505933326; \n\tMon, 06 Jun 2022 01:58:53 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  6 Jun 2022 09:58:25 +0100",
        "Message-Id": "<20220606085825.1145654-2-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20220606085825.1145654-1-naush@raspberrypi.com>",
        "References": "<20220606085825.1145654-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 1/1] camera_sensor: Suppress error message\n\tif test patterns are unavailable",
        "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": "If a sensor driver does not support test patterns (e.g. IMX477), libcamera\nthrows an unnecessary error message during initialisation when it sets the test\npattern to off.\n\nFix this by moving the error message into setTestPatternMode() where the\npipeline handler explicitly requests to set a test pattern.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/libcamera/camera_sensor.cpp | 11 +++++++----\n 1 file changed, 7 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex 4bb2066f0fd4..d055c16a4885 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -582,16 +582,19 @@ int CameraSensor::setTestPatternMode(controls::draft::TestPatternModeEnum mode)\n \tif (testPatternMode_ == mode)\n \t\treturn 0;\n \n+\tif (testPatternModes_.empty()) {\n+\t\tLOG(CameraSensor, Error)\n+\t\t\t<< \"Camera sensor does not support test pattern modes.\";\n+\t\treturn -EINVAL;\n+\t}\n+\n \treturn applyTestPatternMode(mode);\n }\n \n int CameraSensor::applyTestPatternMode(controls::draft::TestPatternModeEnum mode)\n {\n-\tif (testPatternModes_.empty()) {\n-\t\tLOG(CameraSensor, Error)\n-\t\t\t<< \"Camera sensor does not support test pattern modes.\";\n+\tif (testPatternModes_.empty())\n \t\treturn 0;\n-\t}\n \n \tauto it = std::find(testPatternModes_.begin(), testPatternModes_.end(),\n \t\t\t    mode);\n",
    "prefixes": [
        "libcamera-devel",
        "1/1"
    ]
}