{"id":12127,"url":"https://patchwork.libcamera.org/api/patches/12127/?format=json","web_url":"https://patchwork.libcamera.org/patch/12127/","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":"<20210428073617.373422-5-hiroh@chromium.org>","date":"2021-04-28T07:36:14","name":"[libcamera-devel,v3,4/7] libcamera: SensorDatabase: Adds table of v4l2 name and test pattern","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"1bb37e5b873e221878464efb7feccc2e413621fd","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/12127/mbox/","series":[{"id":1983,"url":"https://patchwork.libcamera.org/api/series/1983/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1983","date":"2021-04-28T07:36:10","name":"Report Android HAL client test pattern modes","version":3,"mbox":"https://patchwork.libcamera.org/series/1983/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12127/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12127/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 7F6E5BDE44\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Apr 2021 07:36:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E8CF6688CA;\n\tWed, 28 Apr 2021 09:36:33 +0200 (CEST)","from mail-pg1-x536.google.com (mail-pg1-x536.google.com\n\t[IPv6:2607:f8b0:4864:20::536])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 94ABD688B7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Apr 2021 09:36:30 +0200 (CEST)","by mail-pg1-x536.google.com with SMTP id q10so44118482pgj.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Apr 2021 00:36:30 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:489:a5f4:117:7d51])\n\tby smtp.gmail.com with ESMTPSA id\n\tm11sm1661265pgs.4.2021.04.28.00.36.27\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 28 Apr 2021 00:36:28 -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=\"dm+8N95l\"; 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=CTcArTkFMUPimjbWFygFLSHDbZaIwI0tGHz0MD3v2c4=;\n\tb=dm+8N95lTeH6yTgiJr9Qo+sijNIpDTr3XSQkZK6gB2cCyoQ9XNujlpPhc1ZZI/xwJ5\n\tTfwAW4EZN3zy4PwohaMP2lsYvjcASqncv6vldjr5xngxKob552OcPNIKHoo7O1VSB9RW\n\tP4ay6UIKklJwGXvTrov/muw7YciokgpCi73Mc=","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=CTcArTkFMUPimjbWFygFLSHDbZaIwI0tGHz0MD3v2c4=;\n\tb=oK0S9juad0xyc9/Ve0ZanhPzK6WqgvhsMCDiACT5PKDvqenqjDQ4JJnEnH3hGupB9r\n\tuzyqnO63nSepah3LjR34OkbOHccozwacSo2bCOQfXeSEjB4TzcN6xfTLWKTYt3yTj3Q5\n\tRdKwrJZgvsDFcgfCZYlewQ0VB5HtX6xKK1Gc0tyGlmqPr+jEG74PwIUlwOnIrWGl8a5p\n\tlkmXQi2Q5fWhxFac8Ofj5l6Pw99ZlB645IrcXxWqJD9oaJtcZLFxXjKxL79xWLwlZJ9T\n\tMRiE6SadUHkIiFXLBmpzDrjP7Jm8d3uJ+p20sxZtLIGY+2FK2yIDTEIYkiTJpL8hWmPF\n\tHtCA==","X-Gm-Message-State":"AOAM533UXKO/XrPY4d7flv+3UYF+M9PFNsLpix7VplgigyqsfgLemwmw\n\tC8R1+Lv3hiU1JHwoOQkWoMKDqrBgrfmGVA==","X-Google-Smtp-Source":"ABdhPJz57im4klh/Qk0WFqyA94o0ikEvAEIcSGPViIWTFlKiLMJTJN7vds2mNJUQsLViqjIYfILgiw==","X-Received":"by 2002:aa7:8d03:0:b029:259:f2ed:1849 with SMTP id\n\tj3-20020aa78d030000b0290259f2ed1849mr28050908pfe.30.1619595389004; \n\tWed, 28 Apr 2021 00:36:29 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 28 Apr 2021 16:36:14 +0900","Message-Id":"<20210428073617.373422-5-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.1.498.g6c1eba8ee3d-goog","In-Reply-To":"<20210428073617.373422-1-hiroh@chromium.org>","References":"<20210428073617.373422-1-hiroh@chromium.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 4/7] libcamera: SensorDatabase: Adds\n\ttable of v4l2 name 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>","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":"In V4L2 API, a driver returns a name to represent a test pattern,\nbut it is a driver specific what test pattern is represented by\nthe name. Therefore, this adds a mapping table from the name to\na test pattern into a static configuration of a sensor.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n include/libcamera/internal/sensor_database.h |  2 +\n src/libcamera/sensor_database.cpp            | 39 ++++++++++++++++----\n 2 files changed, 34 insertions(+), 7 deletions(-)","diff":"diff --git a/include/libcamera/internal/sensor_database.h b/include/libcamera/internal/sensor_database.h\nindex 7d743e46..04a5783c 100644\n--- a/include/libcamera/internal/sensor_database.h\n+++ b/include/libcamera/internal/sensor_database.h\n@@ -7,6 +7,7 @@\n #ifndef __LIBCAMERA_SENSOR_DATABASE_H__\n #define __LIBCAMERA_SENSOR_DATABASE_H__\n \n+#include <map>\n #include <string>\n \n #include <libcamera/geometry.h>\n@@ -15,6 +16,7 @@ namespace libcamera {\n \n struct SensorInfo {\n \tSize unitCellSize;\n+\tstd::map<std::string, int32_t> testPatternModeMap;\n };\n \n class SensorDatabase\ndiff --git a/src/libcamera/sensor_database.cpp b/src/libcamera/sensor_database.cpp\nindex 68e69e8b..a4d4f686 100644\n--- a/src/libcamera/sensor_database.cpp\n+++ b/src/libcamera/sensor_database.cpp\n@@ -9,6 +9,8 @@\n \n #include <algorithm>\n \n+#include \"libcamera/control_ids.h\"\n+\n namespace libcamera {\n \n /**\n@@ -43,25 +45,48 @@ namespace libcamera {\n \n namespace {\n \n+const std::map<std::string, int32_t> imx219TestPatternModeMap = {\n+\t{ \"Disabled\", controls::draft::TestPatternModeOff },\n+\t{ \"Color Bars\", controls::draft::TestPatternModeColorBars },\n+\t{ \"Solid Color\", controls::draft::TestPatternModeSolidColor },\n+\t{ \"Grey Color Bars\", controls::draft::TestPatternModeColorBarsFadeToGray },\n+\t{ \"PN9\", controls::draft::TestPatternModePn9 },\n+};\n+\n+const std::map<std::string, int32_t> ov5670TestPatternModeMap = {\n+\t{ \"Disabled\", controls::draft::TestPatternModeOff },\n+\t{ \"Vertical Color Bar Type 1\", controls::draft::TestPatternModeColorBars },\n+};\n+\n+const std::map<std::string, int32_t> ov13858TestPatternModeMap = {\n+\t{ \"Disabled\", controls::draft::TestPatternModeOff },\n+\t{ \"Vertical Color Bar Type 1\", controls::draft::TestPatternModeColorBars },\n+\t{ \"Vertical Color Bar Type 2\", controls::draft::TestPatternModeColorBarsFadeToGray },\n+};\n+\n /**\n  * \\brief Sony IMX219 sensor properties\n  */\n-constexpr SensorInfo imx219Info = {\n-\t.unitCellSize = { 1120, 1120 }\n+const SensorInfo imx219Info = {\n+\t.unitCellSize = { 1120, 1120 },\n+\t.testPatternModeMap = imx219TestPatternModeMap,\n };\n \n /**\n  * \\brief Omnivision ov5670 sensor properties\n  */\n-constexpr SensorInfo ov5670Info = {\n-\t.unitCellSize = { 1120, 1120 }\n+const SensorInfo ov5670Info = {\n+\t.unitCellSize = { 1120, 1120 },\n+\t.testPatternModeMap = ov5670TestPatternModeMap,\n };\n \n /**\n  * \\brief Omnivision 13858 sensor properties\n  */\n-constexpr SensorInfo ov13858Info = {\n-\t.unitCellSize = { 1120, 1120 }\n+const SensorInfo ov13858Info = {\n+\t.unitCellSize = { 1120, 1120 },\n+\t.testPatternModeMap = ov13858TestPatternModeMap,\n+\n };\n \n #define SENSOR_INFO(_sensor) \\\n@@ -70,7 +95,7 @@ constexpr SensorInfo ov13858Info = {\n /*\n  * \\brief The database of sensor properties\n  */\n-constexpr std::pair<const char *const, const SensorInfo *> sensorDatabase__[] = {\n+const std::pair<const char *const, const SensorInfo *> sensorDatabase__[] = {\n \tSENSOR_INFO(imx219),\n \tSENSOR_INFO(ov5670),\n \tSENSOR_INFO(ov13858),\n","prefixes":["libcamera-devel","v3","4/7"]}