{"id":12021,"url":"https://patchwork.libcamera.org/api/patches/12021/?format=json","web_url":"https://patchwork.libcamera.org/patch/12021/","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":"<20210421042346.312854-5-hiroh@chromium.org>","date":"2021-04-21T04:23:43","name":"[libcamera-devel,v2,4/7] libcamera: SensorDatabase: Adds table of v4l2 name and test pattern","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"6352dbed1cc412a8f82470a98e53b7b832a94c07","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/12021/mbox/","series":[{"id":1953,"url":"https://patchwork.libcamera.org/api/series/1953/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1953","date":"2021-04-21T04:23:39","name":"Report Android HAL client test pattern modes","version":2,"mbox":"https://patchwork.libcamera.org/series/1953/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12021/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12021/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 69AFABDB16\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Apr 2021 04:24:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 293AD68843;\n\tWed, 21 Apr 2021 06:24:04 +0200 (CEST)","from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com\n\t[IPv6:2607:f8b0:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DCB356884B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Apr 2021 06:24:01 +0200 (CEST)","by mail-pf1-x42c.google.com with SMTP id i190so27461086pfc.12\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Apr 2021 21:24:01 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:7aaa:cbeb:5d87:4ab6])\n\tby smtp.gmail.com with ESMTPSA id\n\tz18sm461316pfa.39.2021.04.20.21.23.59\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 20 Apr 2021 21:23:59 -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=\"FfllY6BK\"; 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=HrT9i7XhDSbb+NstUsVDkxKE8NA2VTx4jZnojrfc6r0=;\n\tb=FfllY6BKD8QyJ2roNcdIFLR4yEdiQafZx9t816HQEvBC59mfrpU6HmSxBQwaLoZz0Q\n\tCzyKAEaJ6GQZBGwEdD3mIil4H2N5zGl9QT0BNsOLVaYwGdDV2gKD1J6ztoP24UsOfuxe\n\t1NvjR6Xds/JMw36m4GFq42ROH0kjXnTGFYib4=","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=HrT9i7XhDSbb+NstUsVDkxKE8NA2VTx4jZnojrfc6r0=;\n\tb=lSDRnMWYvpCwVb3XDNYrH3tnMZuqqRGFLwB+d+fudYuWkTSKrDvyib8AFpVkg0dvt0\n\tFQCJKh0KJuqGbGzSDEA+h/PBfFQ/10nozQfm4WmzdaEeFAMeRGIHeJ1r0xKzfqRzJ3IO\n\tZszYywz1wCsdlPbmt8A8EzX1gq1ZHat2PkKFV0LLFKyy6ayEtp6CcY/UXGobz4WhUgEU\n\tvUzizKwo2+iXeqLODRUp2mYFEDNKA55sGG2N0JCVCfAh73DSa1WcLAIJnL/1PquUNVTo\n\t2edDZjSqyodob8NhocTFVWY+24VdFKxmVXtqato77j9gH9HHMVJbhJFrc7Bm/aS4Ltis\n\tHFXw==","X-Gm-Message-State":"AOAM5336mcDpo3Du2MQWHcko1NvsqgxEo3UBHew7dlLfiF9yRAsng+Hl\n\twPGl8PXXrBUDx9Ten0XAOqS0yeLhRxrpzw==","X-Google-Smtp-Source":"ABdhPJwR4OtpYKCfcJbosQ6h8CaY27RPBijXsxAZJM110sXHIQPkPU0i1S4TnnHg7JF8HQY7UENlag==","X-Received":"by 2002:a65:4486:: with SMTP id\n\tl6mr20307671pgq.347.1618979040278; \n\tTue, 20 Apr 2021 21:24:00 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 21 Apr 2021 13:23:43 +0900","Message-Id":"<20210421042346.312854-5-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.1.368.gbe11c130af-goog","In-Reply-To":"<20210421042346.312854-1-hiroh@chromium.org>","References":"<20210421042346.312854-1-hiroh@chromium.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 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            | 37 ++++++++++++++++++--\n 2 files changed, 36 insertions(+), 3 deletions(-)","diff":"diff --git a/include/libcamera/internal/sensor_database.h b/include/libcamera/internal/sensor_database.h\nindex 7d743e46..c0b181f8 100644\n--- a/include/libcamera/internal/sensor_database.h\n+++ b/include/libcamera/internal/sensor_database.h\n@@ -10,11 +10,13 @@\n #include <string>\n \n #include <libcamera/geometry.h>\n+#include <libcamera/span.h>\n \n namespace libcamera {\n \n struct SensorInfo {\n \tSize unitCellSize;\n+\tSpan<const std::pair<const char *, int32_t>> testPatternModeMap;\n };\n \n class SensorDatabase\ndiff --git a/src/libcamera/sensor_database.cpp b/src/libcamera/sensor_database.cpp\nindex 68e69e8b..da469b67 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,54 @@ namespace libcamera {\n \n namespace {\n \n+constexpr std::pair<const char *, 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+constexpr std::pair<const char *, int32_t> ov5670TestPatternModeMap[] = {\n+\t{ \"Disabled\", controls::draft::TestPatternModeOff },\n+\t{ \"Vertical Color Bar Type 1\", controls::draft::TestPatternModeColorBars },\n+};\n+\n+constexpr std::pair<const char *, 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+\t.unitCellSize = { 1120, 1120 },\n+\t.testPatternModeMap =\n+\t\tlibcamera::Span<const std::pair<const char *, int32_t>>(\n+\t\t\timx219TestPatternModeMap),\n };\n \n /**\n  * \\brief Omnivision ov5670 sensor properties\n  */\n constexpr SensorInfo ov5670Info = {\n-\t.unitCellSize = { 1120, 1120 }\n+\t.unitCellSize = { 1120, 1120 },\n+\t.testPatternModeMap =\n+\t\tlibcamera::Span<const std::pair<const char *, int32_t>>(\n+\t\t\tov5670TestPatternModeMap),\n };\n \n /**\n  * \\brief Omnivision 13858 sensor properties\n  */\n constexpr SensorInfo ov13858Info = {\n-\t.unitCellSize = { 1120, 1120 }\n+\t.unitCellSize = { 1120, 1120 },\n+\t.testPatternModeMap =\n+\t\tlibcamera::Span<const std::pair<const char *, int32_t>>(\n+\t\t\tov13858TestPatternModeMap),\n+\n };\n \n #define SENSOR_INFO(_sensor) \\\n","prefixes":["libcamera-devel","v2","4/7"]}