Patch Detail
Show a patch.
GET /api/patches/11903/?format=api
{ "id": 11903, "url": "https://patchwork.libcamera.org/api/patches/11903/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11903/", "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": "<20210413075013.3069213-5-hiroh@chromium.org>", "date": "2021-04-13T07:50:12", "name": "[libcamera-devel,RFC,v2,4/5] libcamera: CameraSensor: Attach available test pattern modes", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "78fd4292249da2b4c7b5993a719de73711a8c1fc", "submitter": { "id": 63, "url": "https://patchwork.libcamera.org/api/people/63/?format=api", "name": "Hirokazu Honda", "email": "hiroh@chromium.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11903/mbox/", "series": [ { "id": 1916, "url": "https://patchwork.libcamera.org/api/series/1916/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1916", "date": "2021-04-13T07:50:08", "name": "Report available test pattern modes", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1916/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11903/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11903/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 2166DBD224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 13 Apr 2021 07:50:35 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D2E3C68804;\n\tTue, 13 Apr 2021 09:50:34 +0200 (CEST)", "from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com\n\t[IPv6:2607:f8b0:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9D3C1687FF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Apr 2021 09:50:32 +0200 (CEST)", "by mail-pf1-x42f.google.com with SMTP id i190so10887614pfc.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 13 Apr 2021 00:50:32 -0700 (PDT)", "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:84f5:7981:dfbe:8f02])\n\tby smtp.gmail.com with ESMTPSA id\n\tn25sm11525125pff.154.2021.04.13.00.50.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 13 Apr 2021 00:50:30 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"YNujL2sQ\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=3hSgGx1cbP3KI7myLORs12z6yfh34QoYFMukHPMp0PY=;\n\tb=YNujL2sQmmGBC0adVaUlrH05ckirDBFSaXifh+OoKJYXK4ihXwBfbqI2N0grsSbTTM\n\tuz+6ROuaox7FWjDsQxgGKFofqUiF0YFlFSERT49ty5a1qOt8Wr/kpoUDCwL9+WKDMEW5\n\toNAI6Jl6Y6nSPnc6SRP4JFVB7MbKMYMvNcAPM=", "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=3hSgGx1cbP3KI7myLORs12z6yfh34QoYFMukHPMp0PY=;\n\tb=fBJP2Onla/+4HLeQedKjNBaFvuAXUJ9qVY8V7Cs1o61gWgEWYxWSPC26/33ahnkDOr\n\tCb17Vk3SyQnqrRBOW/+xsQfNoxdZgBKCBj9+RC/BCfWTuTlAYxbpHLbEajkpH4Atan1r\n\tCOePXrT48B7jjtHyQcp3fmDpknAAvyCtmhTQESWbW/XSl8L6buQsWF3/NBzPNbAEJ1b0\n\t7bnRwLtCVwh81NQZxSfp6tYNOWa3y81xhub6kJ/u6kjfjZef62wdz4Qa5fXd5g898W5l\n\thPsrkVTGFIg5jHL0HE39t0anxuVRjPV7hT+dwVCg/BDK/k4kmrSq/7+fjxJf4ip9ort1\n\tdy2w==", "X-Gm-Message-State": "AOAM530Gd9ZzJo/Y3cBAzzD3FYL0zmWaXfyweS1YcsbCQCoOqS10Quae\n\tozrSUZbzAcK6jg1SQEdgES8lM380pIUmJw==", "X-Google-Smtp-Source": "ABdhPJwZV1H38Sfga37Y3UM9Ne4GuqgxVC9cf2Q9Lld/h7Vi8JnhMNulAPVyCb8Rvt6z0Fwq2OgBjg==", "X-Received": "by 2002:a62:1591:0:b029:251:27c2:c185 with SMTP id\n\t139-20020a6215910000b029025127c2c185mr926071pfv.33.1618300230730; \n\tTue, 13 Apr 2021 00:50:30 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 13 Apr 2021 16:50:12 +0900", "Message-Id": "<20210413075013.3069213-5-hiroh@chromium.org>", "X-Mailer": "git-send-email 2.31.1.295.g9ea45b61b8-goog", "In-Reply-To": "<20210413075013.3069213-1-hiroh@chromium.org>", "References": "<20210413075013.3069213-1-hiroh@chromium.org>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [RFC PATCH v2 4/5] libcamera: CameraSensor:\n\tAttach available test pattern modes", "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>", "Cc": "jmondi@jacopo.org", "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": "This add available test pattern modes to libcamera to\nCameraSensorInfo.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n include/libcamera/internal/camera_sensor.h | 2 ++\n src/libcamera/camera_sensor.cpp | 38 ++++++++++++++++++++++\n 2 files changed, 40 insertions(+)", "diff": "diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\nindex 3fa3a419..75b884db 100644\n--- a/include/libcamera/internal/camera_sensor.h\n+++ b/include/libcamera/internal/camera_sensor.h\n@@ -38,6 +38,8 @@ struct CameraSensorInfo {\n \n \tuint32_t minFrameLength;\n \tuint32_t maxFrameLength;\n+\n+\tstd::vector<int32_t> availableTestPatternModes;\n };\n \n class CameraSensor : protected Loggable\ndiff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp\nindex c012385f..81d6af44 100644\n--- a/src/libcamera/camera_sensor.cpp\n+++ b/src/libcamera/camera_sensor.cpp\n@@ -840,6 +840,44 @@ int CameraSensor::sensorInfo(CameraSensorInfo *info) const\n \tinfo->minFrameLength = info->outputSize.height + vblank.min().get<int32_t>();\n \tinfo->maxFrameLength = info->outputSize.height + vblank.max().get<int32_t>();\n \n+\tconst SensorInfo *staticInfo = SensorDatabase::get(model_);\n+\tif (!staticInfo) {\n+\t\tLOG(CameraSensor, Warning)\n+\t\t\t<< \"No static properties available for '\" << model_ << \"'\";\n+\t\tLOG(CameraSensor, Warning)\n+\t\t\t<< \"Please consider updating the sensor database\";\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tconst auto &v4l2TestPattern = controls().find(V4L2_CID_TEST_PATTERN);\n+\tif (v4l2TestPattern == controls().end()) {\n+\t\tLOG(CameraSensor, Error) << \"No static test pattern map for \\'\"\n+\t\t\t\t\t << model() << \"\\'\";\n+\t\treturn 0;\n+\t}\n+\n+\tfor (const ControlValue &value : v4l2TestPattern->second.values()) {\n+\t\tconst ControlMenu &menu = value.get<ControlMenu>();\n+\t\tASSERT(menu.isName);\n+\n+\t\tint32_t matchedTestPattern = -1;\n+\t\tfor (const auto &[name, testPattern] : staticInfo->testPatternModeMap) {\n+\t\t\tif (strcmp(menu.name, name) == 0) {\n+\t\t\t\tmatchedTestPattern = testPattern;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (matchedTestPattern != -1) {\n+\t\t\tLOG(CameraSensor, Debug) << \"Test pattern mode named \\'\"\n+\t\t\t\t\t\t << menu.name << \"\\' added\";\n+\t\t\tinfo->availableTestPatternModes.push_back(matchedTestPattern);\n+\t\t} else {\n+\t\t\tLOG(CameraSensor, Debug) << \"Test pattern mode named \\'\"\n+\t\t\t\t\t\t << menu.name << \"\\' ignored\";\n+\t\t}\n+\t}\n+\n \treturn 0;\n }\n \n", "prefixes": [ "libcamera-devel", "RFC", "v2", "4/5" ] }