Patch Detail
Show a patch.
GET /api/patches/12022/?format=api
{ "id": 12022, "url": "https://patchwork.libcamera.org/api/patches/12022/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12022/", "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": "<20210421042346.312854-6-hiroh@chromium.org>", "date": "2021-04-21T04:23:44", "name": "[libcamera-devel,v2,5/7] libcamera: CameraSensor: Attach available test pattern modes", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "68bda35a5426d4a8d6948bfa4e250afa845f5dba", "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/12022/mbox/", "series": [ { "id": 1953, "url": "https://patchwork.libcamera.org/api/series/1953/?format=api", "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/12022/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12022/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 C74A7BDB16\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Apr 2021 04:24:05 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8520668846;\n\tWed, 21 Apr 2021 06:24:05 +0200 (CEST)", "from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com\n\t[IPv6:2607:f8b0:4864:20::42a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C0DA602C3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Apr 2021 06:24:03 +0200 (CEST)", "by mail-pf1-x42a.google.com with SMTP id a12so27472953pfc.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Apr 2021 21:24:03 -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.24.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 20 Apr 2021 21:24:01 -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=\"IVe/hgRN\"; 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=DgyIxqKBQJt6BM45ov5SUpTjBy04mX0jLBNjwW3YiL4=;\n\tb=IVe/hgRNVyHVfvt0I6aYNROHZwRu9SHOFBwKBtvvzHSmDb+gCxz+NnIXkqq5NtpeHv\n\tQSCMxDk7GvhyTz5REBlIGhfMq0Ey/AVAHdewf16Bd+EaYXUykVvAH575Wnt0/1BqdIvC\n\tvLEMHHduBHkYEZpokWIwd2dBgTGiDhSTqPNq0=", "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=DgyIxqKBQJt6BM45ov5SUpTjBy04mX0jLBNjwW3YiL4=;\n\tb=tvSE1YBCSvtORab3O9cxPlzTAzafZVV9BPtxZGyWB2Et18N+q9LBpbhkKhCiQeI9B5\n\tcClOy5UZOKxbNpei5fgJe5igJpWq8r+roZfL7hRi6vptNxfqJ30NbnKaaFqMIg3AdADj\n\td4nbyHuEuI8R5aWu0kt+iGhnfBWWFDDZsTe8jW6G/cDEYHrY5t/EMmCaV1mXErswUMdW\n\tsq1XMUEhlZVhjVrWTZBJH3IGmVzq8m7N7Lmjnlv6uCK8KxHpNzXli7PADl7ebund2kyK\n\t8r2O7GeAQXRgCamFfQBPogYhYvcuXbGh1vctaxF40dJJhc+Z6mtgL87xNT/sWBphhCDu\n\tOIog==", "X-Gm-Message-State": "AOAM530PUW8RMMo24rC+AL/IO/Qwb3BtQe5dLyUbFSA8mQ6eN3OSG9Vc\n\t92IptSyazG1GOWljnBNlQRe+CxyiF7QWPA==", "X-Google-Smtp-Source": "ABdhPJwOgQrS3d/ueLzok3I9H+uUCFcI9Hxeoqg68VOSghsg8GCPuhbDga8QuIGSU+6GWjG7NTCagQ==", "X-Received": "by 2002:a65:61a1:: with SMTP id\n\ti1mr20075098pgv.411.1618979041841; \n\tTue, 20 Apr 2021 21:24:01 -0700 (PDT)", "From": "Hirokazu Honda <hiroh@chromium.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 21 Apr 2021 13:23:44 +0900", "Message-Id": "<20210421042346.312854-6-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 5/7] libcamera: CameraSensor: Attach\n\tavailable 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>", "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 850c94b3..d20cfb4c 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, Debug) << \"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", "v2", "5/7" ] }