{"id":12547,"url":"https://patchwork.libcamera.org/api/patches/12547/?format=json","web_url":"https://patchwork.libcamera.org/patch/12547/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210610082539.529739-3-hiroh@chromium.org>","date":"2021-06-10T08:25:36","name":"[libcamera-devel,v8,3/6] libcamera: CameraSensorProperties: Add table of v4l2 index and test pattern","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"6f9bc92e979a4cf3842e40099d3ce9a50cd74188","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12547/mbox/","series":[{"id":2117,"url":"https://patchwork.libcamera.org/api/series/2117/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2117","date":"2021-06-10T08:25:34","name":"[libcamera-devel,v8,1/6] libcamera: controls: Add sensor test pattern mode","version":8,"mbox":"https://patchwork.libcamera.org/series/2117/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12547/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12547/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 284AFBD78E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 10 Jun 2021 08:25:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D203A6892C;\n\tThu, 10 Jun 2021 10:25:51 +0200 (CEST)","from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com\n\t[IPv6:2607:f8b0:4864:20::1036])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BE7916892C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jun 2021 10:25:49 +0200 (CEST)","by mail-pj1-x1036.google.com with SMTP id\n\tm13-20020a17090b068db02901656cc93a75so3289585pjz.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 10 Jun 2021 01:25:49 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:98e0:b356:1c8a:25d4])\n\tby smtp.gmail.com with ESMTPSA id\n\tx3sm2087011pgx.8.2021.06.10.01.25.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 10 Jun 2021 01:25:47 -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=\"gr1ag6l/\"; 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=PUYx5PJu6hrDJL7A0XDt0lAHR0rHKJv94avBEeNop2k=;\n\tb=gr1ag6l/iMO24dO+nim4I1Fe1iCYzONdK2K147XSTjHtDfv0bsTfu2XBVIXxhWTeIC\n\t06I8AS2PWXRXiNwJWZnb47FNIOMraYr2IuX2Amch9ucaNEnuX3rDQSNRfkRmhhfh0n2l\n\tgjh80BYtXaWay1cK33wUyF37XKUolQLBch46s=","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=PUYx5PJu6hrDJL7A0XDt0lAHR0rHKJv94avBEeNop2k=;\n\tb=B4hHxRmLdeguCx/PUBUItzr31pxWVlxfCn1sY2wzQM82UYVW7JxwzV4fqdEiZ3dtDs\n\tyDrbGtA6ecW+HKUxmQX7SpJnDojwlAW9Q9sWTnQvjtLKqqKG4qJLtXHGJtxRK1u51n9P\n\tK+u4c7SRH0YzGxqZf3XO/Rvf7pjPT1ij+PijjIy7yVv++l9SJqf6DvTzNIEqKDK5FLxy\n\tM3P7BvCZAKz/bKyHdDtTUxIiozH3m4ul7hGz8g6uVNmuR9TA2QEETZG/5aD1DxLTpZb9\n\tiHU54pAKBozuh3wn/UoCXXjlObi4MfiYXz4uBeTxOEr4cxCWsi8MmnHYbP7ODa8f9usd\n\tVNrw==","X-Gm-Message-State":"AOAM532j/ZK3tsYaxee719XfXVP6696QZkchyORo8+iT4T718fYt7Tcu\n\t+8Wal4rivrzcuRxlFDtVY0wbK8boXsaH+g==","X-Google-Smtp-Source":"ABdhPJzDC1GHyuUa+ehxEThet9f+er9MYUuc6c/9JOSdTTjk1Jg10E1GQcS6VBKMa0Ldg++8nO8jQQ==","X-Received":"by 2002:a17:90a:9481:: with SMTP id\n\ts1mr2211734pjo.48.1623313548189; \n\tThu, 10 Jun 2021 01:25:48 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu, 10 Jun 2021 17:25:36 +0900","Message-Id":"<20210610082539.529739-3-hiroh@chromium.org>","X-Mailer":"git-send-email 2.32.0.rc1.229.g3e70b5a671-goog","In-Reply-To":"<20210610082539.529739-1-hiroh@chromium.org>","References":"<20210610082539.529739-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v8 3/6] libcamera: CameraSensorProperties:\n\tAdd table of v4l2 index and test pattern","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":"The V4L2 specification defines the sensor test pattern modes\nthrough a menu control, where a numerical index is associated to\na string that describes the test pattern. The index-to-pattern\nmapping is driver specific and requires a corresponding representation\nin the library.\n\nAdd to the static list of CameraSensorProperties a map of indexes to\nlibcamera::controls::TestPatternModes values to be able to map the\nindexes returned by the driver to the corresponding test pattern mode.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n .../internal/camera_sensor_properties.h       |  2 ++\n src/libcamera/camera_sensor_properties.cpp    | 33 +++++++++++++++++++\n 2 files changed, 35 insertions(+)","diff":"diff --git a/include/libcamera/internal/camera_sensor_properties.h b/include/libcamera/internal/camera_sensor_properties.h\nindex f5e242cb..67c77920 100644\n--- a/include/libcamera/internal/camera_sensor_properties.h\n+++ b/include/libcamera/internal/camera_sensor_properties.h\n@@ -7,6 +7,7 @@\n #ifndef __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__\n #define __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__\n \n+#include <map>\n #include <string>\n \n #include <libcamera/geometry.h>\n@@ -17,6 +18,7 @@ struct CameraSensorProperties {\n \tstatic const CameraSensorProperties *get(const std::string &sensor);\n \n \tSize unitCellSize;\n+\tstd::map<int32_t, int32_t> testPatternModes;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp\nindex a2c04009..f660743a 100644\n--- a/src/libcamera/camera_sensor_properties.cpp\n+++ b/src/libcamera/camera_sensor_properties.cpp\n@@ -9,6 +9,8 @@\n \n #include <map>\n \n+#include <libcamera/control_ids.h>\n+\n #include \"libcamera/internal/log.h\"\n \n /**\n@@ -34,6 +36,11 @@ LOG_DEFINE_CATEGORY(CameraSensorProperties)\n  *\n  * \\var CameraSensorProperties::unitCellSize\n  * \\brief The physical size of a pixel, including pixel edges, in nanometers.\n+ *\n+ * \\var CameraSensorProperties::testPatternModes\n+ * \\brief Map that associates the indexes of the sensor test pattern modes as\n+ * returned by V4L2_CID_TEST_PATTERN with the corresponding TestPattern\n+ * control value\n  */\n \n /**\n@@ -47,18 +54,44 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen\n \tstatic const std::map<std::string, const CameraSensorProperties> sensorProps = {\n \t\t{ \"imx219\", {\n \t\t\t.unitCellSize = { 1120, 1120 },\n+\t\t\t.testPatternModes = {\n+\t\t\t\t{ 0, controls::draft::TestPatternModeOff },\n+\t\t\t\t{ 1, controls::draft::TestPatternModeColorBars },\n+\t\t\t\t{ 2, controls::draft::TestPatternModeSolidColor },\n+\t\t\t\t{ 3, controls::draft::TestPatternModeColorBarsFadeToGray },\n+\t\t\t\t{ 4, controls::draft::TestPatternModePn9 },\n+\t\t\t},\n \t\t} },\n \t\t{ \"imx258\", {\n \t\t\t.unitCellSize = { 1120, 1120 },\n+\t\t\t/* \\todo fill test pattern modes for imx258. */\n+\t\t\t.testPatternModes = {},\n \t\t} },\n \t\t{ \"ov5670\", {\n \t\t\t.unitCellSize = { 1120, 1120 },\n+\t\t\t.testPatternModes = {\n+\t\t\t\t{ 0, controls::draft::TestPatternModeOff },\n+\t\t\t\t{ 1, controls::draft::TestPatternModeColorBars },\n+\t\t\t},\n \t\t} },\n \t\t{ \"ov13858\", {\n \t\t\t.unitCellSize = { 1120, 1120 },\n+\t\t\t.testPatternModes =  {\n+\t\t\t\t{ 0, controls::draft::TestPatternModeOff },\n+\t\t\t\t{ 1, controls::draft::TestPatternModeColorBars },\n+\t\t\t},\n \t\t} },\n \t\t{ \"ov5693\", {\n \t\t\t.unitCellSize = { 1400, 1400 },\n+\t\t\t.testPatternModes = {\n+\t\t\t\t{ 0, controls::draft::TestPatternModeOff },\n+\t\t\t\t{ 2, controls::draft::TestPatternModeColorBars },\n+\t\t\t\t/*\n+\t\t\t\t * No corresponding test pattern mode for\n+\t\t\t\t * 1: \"Random data\" and 3: \"Colour Bars with\n+\t\t\t\t * Rolling Bar\".\n+\t\t\t\t */\n+\t\t\t},\n \t\t} },\n \t};\n \n","prefixes":["libcamera-devel","v8","3/6"]}