From patchwork Mon Jun 7 01:13:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12494 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C4761C320B for ; Mon, 7 Jun 2021 01:14:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D30196892D; Mon, 7 Jun 2021 03:14:10 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="XjpDt1VS"; dkim-atps=neutral Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6F51C68921 for ; Mon, 7 Jun 2021 03:14:09 +0200 (CEST) Received: by mail-pj1-x1032.google.com with SMTP id g24so8805426pji.4 for ; Sun, 06 Jun 2021 18:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Kp7vtkneKHWsTVr8H9RoZEqk8QShPlfAx9tM5R6qx14=; b=XjpDt1VSP397KivQ2auR1Y+ONNYCWqnfnyn+FrO4Uc9cJ5M44iZE2/X+vPxYN+v40d K15GILSWZnX7yBNSivT43zDYM0AFFXVyvy80RHt4bJbPAsfuuHZ7JPJDJg8H4MrV+j3x 8RT7UZ7VkC/18ERMiaItNeMsaGw4JitwinOEc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Kp7vtkneKHWsTVr8H9RoZEqk8QShPlfAx9tM5R6qx14=; b=jbJ5ma8q2h94agvHO+UccDyH83zlHjTd3+g1EllRmx9zcJT9jxWKhhRdYJghSx0Cq0 Q95/jmoHAISEz1ewucaj9RXG0m1GDk6rJbV6uAU7I1d1a8hqP28PFgAUYdDuyZj2UZ0v aslS8lkX6NqFYNhspqbZOQ5HAl60Vxo1SOJvaRS2G9Fo3Qtw0inDA9JhD7MZ+WO2wi/d QWUN5StvXQb7bQOPxnMIFVL6MdcRG++JfWXCmAar6aLwoBPYXeN+XRYLjNCvWPYDGXxT 1dXCPntKlmZCoqpFi5gVUSZLuUe/tYO6Dm3g8u2w5aKS/ZAlt+DK1WUCS7i47gNaUZgX hacQ== X-Gm-Message-State: AOAM532LlHqcmDwDFXMWSXt8AKVUgJHtebkJsSOKj/po8XvGJ7Bma561 5P9rIuO+Y+hHYFaRePpLWIaYZD3bfI/TrA== X-Google-Smtp-Source: ABdhPJylX+kglg1sLUTP5U0Ma8PMMY6fiskjJTKEU/RL1ISin5C1VOcTh0vz1nt0khOn8FUsFdIKlQ== X-Received: by 2002:a17:902:d64c:b029:101:17cb:e63c with SMTP id y12-20020a170902d64cb029010117cbe63cmr15724352plh.3.1623028447420; Sun, 06 Jun 2021 18:14:07 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:6eb1:2d91:79ee:2043]) by smtp.gmail.com with ESMTPSA id h12sm7303655pgn.54.2021.06.06.18.14.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 18:14:06 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Jun 2021 10:13:57 +0900 Message-Id: <20210607011402.55331-1-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 1/6] libcamera: controls: Add sensor test pattern mode X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The control is used to report available sensor test pattern modes and also specify the mode to sensor. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/control_ids.yaml | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index f62ade48..d92f29f5 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -622,4 +622,62 @@ controls: detection, additional format conversions etc) count as an additional pipeline stage. + - TestPatternMode: + type: int32_t + draft: true + description: | + Control to select the test pattern mode. Currently identical to + ANDROID_SENSOR_TEST_PATTERN_MODE. + enum: + - name: TestPatternModeOff + value: 0 + description: | + No test pattern mode is used. The camera device returns frames from + the image sensor. + - name: TestPatternModeSolidColor + value: 1 + description: | + Each pixel in [R, G_even, G_odd, B] is replaced by its respective + color channel provided in test pattern data. + \todo Add control for test pattern data. + - name: TestPatternModeColorBars + value: 2 + description: | + All pixel data is replaced with an 8-bar color pattern. The vertical + bars (left-to-right) are as follows; white, yellow, cyan, green, + magenta, red, blue and black. Each bar should take up 1/8 of the + sensor pixel array width. When this is not possible, the bar size + should be rounded down to the nearest integer and the pattern can + repeat on the right side. Each bar's height must always take up the + full sensor pixel array height. + - name: TestPatternModeColorBarsFadeToGray + value: 3 + description: | + The test pattern is similar to TestPatternModeColorBars, + except that each bar should start at its specified color at the top + and fade to gray at the bottom. Furthermore each bar is further + subdevided into a left and right half. The left half should have a + smooth gradient, and the right half should have a quantized + gradient. In particular, the right half's should consist of blocks + of the same color for 1/16th active sensor pixel array width. The + least significant bits in the quantized gradient should be copied + from the most significant bits of the smooth gradient. The height of + each bar should always be a multiple of 128. When this is not the + case, the pattern should repeat at the bottom of the image. + - name: TestPatternModePn9 + value: 4 + description: | + All pixel data is replaced by a pseudo-random sequence generated + from a PN9 512-bit sequence (typically implemented in hardware with + a linear feedback shift register). The generator should be reset at + the beginning of each frame, and thus each subsequent raw frame with + this test pattern should be exactly the same as the last. + - name: TestPatternModeCustom1 + value: 256 + description: | + The first custom test pattern. All custom patterns that are + available only on this camera device are at least this numeric + value. All of the custom test patterns will be static (that is the + raw image must not vary from frame to frame). + ... From patchwork Mon Jun 7 01:13:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12495 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id AE378C320B for ; Mon, 7 Jun 2021 01:14:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A3F566892E; Mon, 7 Jun 2021 03:14:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jJHB4uWS"; dkim-atps=neutral Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B570268925 for ; Mon, 7 Jun 2021 03:14:10 +0200 (CEST) Received: by mail-pl1-x62f.google.com with SMTP id v12so7716562plo.10 for ; Sun, 06 Jun 2021 18:14:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nIXJzulVYV45F/GbsYfMi+KlzCrxZO8w1wziyYXO8mA=; b=jJHB4uWS9MQCiaqor9jjpoS70Ai39V1EFCfeyxjXj7MgpeiZmLdJlw+oGt7tISDCvA mdSQmEdaA64n+p8y7lgmJET+zhHJYM6xaau9OOrE4c7gwB0eJ8rzaxPUBcufpY5Pgeyq zv2jdQLRZOChZ5oxcSciSbsskMp1RXYv08x6I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nIXJzulVYV45F/GbsYfMi+KlzCrxZO8w1wziyYXO8mA=; b=MrCGysRS6IHC4zLC2q5DBZYhs+piGlzofPl5Lxz+R5kPp70jXjK/mncT6V22AfQ+o8 AS5nv6Q7NmmehZ9dhn7wX4xNHjqvdtwL4EBCSgIJ6OQTpR/Kmz1HNN5gmTWzTUYFI0Xl RiLJSV9WASm3Eu1PidjblaEGI6CtX87Bd9b475ISJt1+XkfdaLpgIVszSmaTDv2+DnNm RQhH9YtEVgvSsrVbl8qbESf5UGQz5XytQyqpXRy+ZOjyfUWIF3/DDFJA2w91v+HXaqUD /6uZTcz4GejtmQvnvGChwaSZv0ZV7pNxt1oxzueq0Htxb4aXSTm1FUr/hRss3dWcxkyv bZGg== X-Gm-Message-State: AOAM531GpSNHD1btyA3x8xNJf1uACWoQ/4/eYoHoRQEKAaDS709yKkel xUyiZ7TaRVsnrGMJa4v++AxZoUV/QL5byQ== X-Google-Smtp-Source: ABdhPJx9FL2pqdJ5LgAW9CdTtFNCMGfxqLpLQ7aFweyu5rwPLjLHsqeeCqZD0HnKaDe+kW3VbZ6M8g== X-Received: by 2002:a17:902:8602:b029:10b:df79:d7ca with SMTP id f2-20020a1709028602b029010bdf79d7camr15524384plo.56.1623028448928; Sun, 06 Jun 2021 18:14:08 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:6eb1:2d91:79ee:2043]) by smtp.gmail.com with ESMTPSA id h12sm7303655pgn.54.2021.06.06.18.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 18:14:08 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Jun 2021 10:13:58 +0900 Message-Id: <20210607011402.55331-2-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog In-Reply-To: <20210607011402.55331-1-hiroh@chromium.org> References: <20210607011402.55331-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 2/6] libcamera: V4L2Device: Support v4l2 menu control X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This adds a support of v4l2 menu. The control info for v4l2 menu contains indices without names and 64bit values of querymenu. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- include/libcamera/internal/v4l2_device.h | 2 + src/libcamera/v4l2_device.cpp | 53 ++++++++++++++++++++++-- 2 files changed, 51 insertions(+), 4 deletions(-) diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index b82e2a14..687be9b2 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -56,6 +56,8 @@ protected: int fd() const { return fd_; } private: + ControlInfo v4l2MenuControlInfo(const v4l2_query_ext_ctrl &ctrl); + void listControls(); void updateControls(ControlList *ctrls, Span v4l2Ctrls); diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index b39c6266..40e2c74c 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -524,6 +524,38 @@ int V4L2Device::ioctl(unsigned long request, void *argp) * \return The V4L2 device file descriptor, -1 if the device node is not open */ +/** + * \brief Create ControlInfo for a V4L2 menu ctrl + * \param[in] ctrl The v4l2_query_ext_ctrl that represents a menu + * + * The created ControlInfo contains indices acquired by VIDIOC_QUERYMENU. + * + * \return ControlInfo for a V4L2 menu ctrl. + */ +ControlInfo V4L2Device::v4l2MenuControlInfo( + const struct v4l2_query_ext_ctrl &ctrl) +{ + std::vector indices; + struct v4l2_querymenu menu = {}; + menu.id = ctrl.id; + + if (ctrl.minimum < 0) + return ControlInfo(); + + ControlValue def = {}; + for (int32_t index = ctrl.minimum; index <= ctrl.maximum; ++index) { + menu.index = index; + if (ioctl(VIDIOC_QUERYMENU, &menu) != 0) + continue; + + indices.push_back(index); + if (index == ctrl.default_value) + def = ControlValue(index); + } + + return ControlInfo(indices, def); +} + /* * \brief List and store information about all controls supported by the * V4L2 device @@ -533,7 +565,6 @@ void V4L2Device::listControls() ControlInfoMap::Map ctrls; struct v4l2_query_ext_ctrl ctrl = {}; - /* \todo Add support for menu controls. */ while (1) { ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL | V4L2_CTRL_FLAG_NEXT_COMPOUND; @@ -544,16 +575,23 @@ void V4L2Device::listControls() ctrl.flags & V4L2_CTRL_FLAG_DISABLED) continue; + ControlInfo ctrlInfo; + switch (ctrl.type) { case V4L2_CTRL_TYPE_INTEGER: case V4L2_CTRL_TYPE_BOOLEAN: - case V4L2_CTRL_TYPE_MENU: case V4L2_CTRL_TYPE_BUTTON: case V4L2_CTRL_TYPE_INTEGER64: case V4L2_CTRL_TYPE_BITMASK: - case V4L2_CTRL_TYPE_INTEGER_MENU: case V4L2_CTRL_TYPE_U8: + ctrlInfo = v4l2ControlInfo(ctrl); + break; + + case V4L2_CTRL_TYPE_INTEGER_MENU: + case V4L2_CTRL_TYPE_MENU: + ctrlInfo = v4l2MenuControlInfo(ctrl); break; + /* \todo Support other control types. */ default: LOG(V4L2, Debug) @@ -562,10 +600,13 @@ void V4L2Device::listControls() continue; } + LOG(V4L2, Debug) << "Control: " << ctrl.name + << " (" << utils::hex(ctrl.id) << ")"; + controlIds_.emplace_back(v4l2ControlId(ctrl)); controlInfo_.emplace(ctrl.id, ctrl); - ctrls.emplace(controlIds_.back().get(), v4l2ControlInfo(ctrl)); + ctrls.emplace(controlIds_.back().get(), std::move(ctrlInfo)); } controls_ = std::move(ctrls); @@ -630,6 +671,10 @@ void V4L2Device::updateControls(ControlList *ctrls, value.set(v4l2Ctrl.value64); break; + case ControlTypeInteger32: + value.set(v4l2Ctrl.value); + break; + case ControlTypeByte: /* * No action required, the VIDIOC_[GS]_EXT_CTRLS ioctl From patchwork Mon Jun 7 01:13:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12496 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 3AEFAC320B for ; Mon, 7 Jun 2021 01:14:14 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EE7EC68935; Mon, 7 Jun 2021 03:14:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="CY+1wYeS"; dkim-atps=neutral Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EE62A68932 for ; Mon, 7 Jun 2021 03:14:11 +0200 (CEST) Received: by mail-pg1-x52c.google.com with SMTP id q15so12561975pgg.12 for ; Sun, 06 Jun 2021 18:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g7msIY4ZSNeR107C0dMkHU0ne5zKkI1ZRoSc6ZNH+C8=; b=CY+1wYeSmdq5SoDmd32SBdRgJQ8CO70/4rGDswE1vTjBXXl2XiSagrhvylfpASWUj9 mkT9/YCNfX605zdMgKtXQQWMoS7z6JY4hgX0b+L8iUoWcnRsg/84QkekNYLVxW14jz3r 92JlJes8YoHjeOcY08onbvWK3i/P70ksuEc74= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=g7msIY4ZSNeR107C0dMkHU0ne5zKkI1ZRoSc6ZNH+C8=; b=Uu+qOBkRuNIhm5/aI1JJECV/O4tEssN0//RY92n203bdPpIyhAjyCUNhTus9tsngK+ YAE9AZBh+lI+m7Y295scR0EJa/3tg2XWj1U6qggWALkI+brQiXGEZ0suJ3oHIwzF4RK2 powus+FG+nOpJsLK8wGUkl8C7Dw4fokt6CDzOzbboHwbgpffuoR+MtqIsunHzwYCUeP+ d7Z/+GfMD5p8D+nDQYm1x8jvWvWkaKwxU49/zuUktKC+4tYVkNrwZB44U1F0AoBz4iW2 Lvnd6cj3HcHnnDQRMsJwWbdSGiEMUOAMadtcw15FKx3jxpZMFp00xUvSawW55j5EAtCN IGeQ== X-Gm-Message-State: AOAM532wdGPsdRQ7zRWD2C19hSWtkDNyjzZdFQx1Xqugf39BsQU/xd77 dWM7vEVHkb6gfanl/25YONRKJO1SCLa3NMBl X-Google-Smtp-Source: ABdhPJwSzwkIXJz1NvAtiORtO3G8lWAfseYM6gEEXK12munH3hEFqFBOmyzmNEKMAZO5U7KFlVKwyA== X-Received: by 2002:a63:dc03:: with SMTP id s3mr8993508pgg.354.1623028450403; Sun, 06 Jun 2021 18:14:10 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:6eb1:2d91:79ee:2043]) by smtp.gmail.com with ESMTPSA id h12sm7303655pgn.54.2021.06.06.18.14.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 18:14:10 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Jun 2021 10:13:59 +0900 Message-Id: <20210607011402.55331-3-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog In-Reply-To: <20210607011402.55331-1-hiroh@chromium.org> References: <20210607011402.55331-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 3/6] libcamera: CameraSensorProperties: Add table of v4l2 index and test pattern X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The V4L2 specification defines the sensor test pattern modes through a menu control, where a numerical index is associated to a string that describes the test pattern. The index-to-pattern mapping is driver specific and requires a corresponding representation in the library. Add to the static list of CameraSensorProperties a map of indexes to libcamera::controls::TestPatternModes values to be able to map the indexes returned by the driver to the corresponding test pattern mode. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- .../internal/camera_sensor_properties.h | 2 ++ src/libcamera/camera_sensor_properties.cpp | 31 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/include/libcamera/internal/camera_sensor_properties.h b/include/libcamera/internal/camera_sensor_properties.h index f5e242cb..67c77920 100644 --- a/include/libcamera/internal/camera_sensor_properties.h +++ b/include/libcamera/internal/camera_sensor_properties.h @@ -7,6 +7,7 @@ #ifndef __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__ #define __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__ +#include #include #include @@ -17,6 +18,7 @@ struct CameraSensorProperties { static const CameraSensorProperties *get(const std::string &sensor); Size unitCellSize; + std::map testPatternModes; }; } /* namespace libcamera */ diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp index a2c04009..14270ef9 100644 --- a/src/libcamera/camera_sensor_properties.cpp +++ b/src/libcamera/camera_sensor_properties.cpp @@ -9,6 +9,8 @@ #include +#include + #include "libcamera/internal/log.h" /** @@ -34,6 +36,11 @@ LOG_DEFINE_CATEGORY(CameraSensorProperties) * * \var CameraSensorProperties::unitCellSize * \brief The physical size of a pixel, including pixel edges, in nanometers. + * + * \var CameraSensorProperties::testPatternModes + * \brief Map that associates the indexes of the sensor test pattern modes as + * returned by V4L2_CID_TEST_PATTERN with the corresponding TestPattern + * control value */ /** @@ -47,18 +54,42 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen static const std::map sensorProps = { { "imx219", { .unitCellSize = { 1120, 1120 }, + .testPatternModes = { + { 0, controls::draft::TestPatternModeOff }, + { 1, controls::draft::TestPatternModeColorBars }, + { 2, controls::draft::TestPatternModeSolidColor }, + { 3, controls::draft::TestPatternModeColorBarsFadeToGray }, + { 4, controls::draft::TestPatternModePn9 }, + }, } }, { "imx258", { .unitCellSize = { 1120, 1120 }, } }, { "ov5670", { .unitCellSize = { 1120, 1120 }, + .testPatternModes = { + { 0, controls::draft::TestPatternModeOff }, + { 1, controls::draft::TestPatternModeColorBars }, + }, } }, { "ov13858", { .unitCellSize = { 1120, 1120 }, + .testPatternModes = { + { 0, controls::draft::TestPatternModeOff }, + { 1, controls::draft::TestPatternModeColorBars }, + }, } }, { "ov5693", { .unitCellSize = { 1400, 1400 }, + .testPatternModes = { + { 0, controls::draft::TestPatternModeOff }, + { 2, controls::draft::TestPatternModeColorBars }, + /* + * No corresponding test pattern mode for + * 1: "Random data" and 3: "Colour Bars with + * Rolling Bar". + */ + }, } }, }; From patchwork Mon Jun 7 01:14:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12497 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id CC742C320B for ; Mon, 7 Jun 2021 01:14:16 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 88F336892E; Mon, 7 Jun 2021 03:14:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="fa5fgOa7"; dkim-atps=neutral Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BE42268926 for ; Mon, 7 Jun 2021 03:14:13 +0200 (CEST) Received: by mail-pg1-x529.google.com with SMTP id 6so12570891pgk.5 for ; Sun, 06 Jun 2021 18:14:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9K5PveEwZBbwwCEIhfIir0TSqZrkTwudduhTEgwn/MQ=; b=fa5fgOa7KHxQ1wgyMgKnAKT9O8tLHBGVLI8rZkoZjx6j7wx3B3zXfxoOCSYTu1de2J xFtF8ZVTCH8+wSR4+xw86P0I4CcG/a0hsCHIw5E/MLB5xap0orNJoDv9MY4mXJJUuC6n xkzXYIcH/btC1y4RTWCayCvJB6s966GCAqr4U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9K5PveEwZBbwwCEIhfIir0TSqZrkTwudduhTEgwn/MQ=; b=QFsr2FyxmJqAJk0S8ZxBifaUPhXu4TIdw2QSiwDs0g7SRkzm0eYRCiMT5LOlP8K5Y8 3riKh7y4K4b3ZVyEW1ZPziqmOzNAsEXmFc8TDYke46zYq2lapz8zEVbAF6EbNuRTwTCw YKr9TRwCPb1GoSk1Bg7hHlI5GmFw+uC6T4ivKwg13Tgsg65AviZoWsM0mvKg1yQmMAxV g3AQAOb8wNk03BVjKsxflPNJhahmKX2F75IKxAER19Y4VooNibLfGa6VGJ7BJtPX+XQN YZ3fTPTWJxoCWfMoEL+cMYsa41xSX5Y2IDIFglXEc6lW7iDGKOTXSORpLdLJvfrJoKNF /FEQ== X-Gm-Message-State: AOAM531ywTzHZAGg9qBNmbtzEmjHFn7ChcBoY3IDY4lwuk7sPqIilDHn hTxM3754vTkndFwzL+OZX7QDr8zFoSmBJm4+ X-Google-Smtp-Source: ABdhPJxJqj+AaOP8r4T499LtOJnmYYcYcDzzScuZ30bt+wmif7kpX1ugP0gtOm6+CQOetA/dXSig4Q== X-Received: by 2002:aa7:8e5a:0:b029:2e9:10d3:376f with SMTP id d26-20020aa78e5a0000b02902e910d3376fmr15039237pfr.19.1623028452238; Sun, 06 Jun 2021 18:14:12 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:6eb1:2d91:79ee:2043]) by smtp.gmail.com with ESMTPSA id h12sm7303655pgn.54.2021.06.06.18.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 18:14:11 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Jun 2021 10:14:00 +0900 Message-Id: <20210607011402.55331-4-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog In-Reply-To: <20210607011402.55331-1-hiroh@chromium.org> References: <20210607011402.55331-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 4/6] libcamera: CameraSensor: Enable retrieving supported test pattern modes X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This enables retrieving supported test pattern modes through CameraSensorInfo. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- include/libcamera/internal/camera_sensor.h | 7 +++++ src/libcamera/camera_sensor.cpp | 34 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index cf6c1c1e..e133ebf4 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -39,6 +39,10 @@ public: const std::vector &mbusCodes() const { return mbusCodes_; } const std::vector &sizes() const { return sizes_; } Size resolution() const; + const std::vector &testPatternModes() const + { + return testPatternModes_; + } V4L2SubdeviceFormat getFormat(const std::vector &mbusCodes, const Size &size) const; @@ -65,6 +69,8 @@ private: int validateSensorDriver(); void initVimcDefaultProperties(); void initStaticProperties(); + void initTestPatternModes( + const std::map &testPatternModeMap); int initProperties(); const MediaEntity *entity_; @@ -77,6 +83,7 @@ private: V4L2Subdevice::Formats formats_; std::vector mbusCodes_; std::vector sizes_; + std::vector testPatternModes_; Size pixelArraySize_; Rectangle activeArea_; diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 0fb8a258..3e135353 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -305,6 +305,32 @@ void CameraSensor::initStaticProperties() /* Register the properties retrieved from the sensor database. */ properties_.set(properties::UnitCellSize, props->unitCellSize); + + initTestPatternModes(props->testPatternModes); +} + +void CameraSensor::initTestPatternModes( + const std::map &testPatternModes) +{ + const auto &v4l2TestPattern = controls().find(V4L2_CID_TEST_PATTERN); + if (v4l2TestPattern == controls().end()) { + LOG(CameraSensor, Debug) << "No static test pattern map for \'" + << model() << "\'"; + return; + } + + for (const ControlValue &value : v4l2TestPattern->second.values()) { + const int32_t index = value.get(); + + const auto it = testPatternModes.find(index); + if (it == testPatternModes.end()) { + LOG(CameraSensor, Debug) + << "Test pattern mode " << index << " ignored"; + continue; + } + + testPatternModes_.push_back(it->second); + } } int CameraSensor::initProperties() @@ -469,6 +495,14 @@ Size CameraSensor::resolution() const return std::min(sizes_.back(), activeArea_.size()); } +/** + * \fn CameraSensor::testPatternModes() + * \brief Retrieve all the supported test pattern modes of the camera sensor + * The test pattern mode values correspond to the controls::TestPattern control. + * + * \return The list of test pattern modes + */ + /** * \brief Retrieve the best sensor format for a desired output * \param[in] mbusCodes The list of acceptable media bus codes From patchwork Mon Jun 7 01:14:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12498 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 3B6B7C320B for ; Mon, 7 Jun 2021 01:14:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DD4F76892D; Mon, 7 Jun 2021 03:14:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="gjvxYjxH"; dkim-atps=neutral Received: from mail-pf1-x433.google.com (mail-pf1-x433.google.com [IPv6:2607:f8b0:4864:20::433]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A7EB6892D for ; Mon, 7 Jun 2021 03:14:15 +0200 (CEST) Received: by mail-pf1-x433.google.com with SMTP id s14so10983609pfd.9 for ; Sun, 06 Jun 2021 18:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=eGamX387RzZe2eIC3xUR0g3TZDatng8JNNtBxBmx/TQ=; b=gjvxYjxHo9S36U67+o4BV8d5SM8wuOWbORFEb1e944JyNKwilrqmY4819sl9/hNfZu KAzBfnT+RfYCJwlWbXJqvY7PbHA5eQdhGsV/K1xFfPDyAK8GgVPdDZKYRvdQG80Pttbo 7fMuh0Y0CP6SeEGuXjc8vQSpVKa3GgtbH/GZQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=eGamX387RzZe2eIC3xUR0g3TZDatng8JNNtBxBmx/TQ=; b=ndYNRLGdC0wm6aMlZCrTDJIT5VQH0YwiKFKwVezjFO0t7RgCi6SlA9gOF7CcJ+qn7o vPtYuu9rCh5JHsbfk2t8igToiN9AfHiLmAwNo37qtNOSpuwNXeJ3PPw/ZGRuwyTzovtV viGS+hBPb64Q7m+Evgi5DGtiucSth4E6y4KaFPGAyDu94WtIuSX+U2SrGGnWmhUrSAML A15FIC2ovBB+9fcah80OL4gtog8np6dYCWgCZ4xnvoor5hjYMFaWyHXr7ea2Fo5D295u 2dTKNP+jUO/tfUK6e72sl6c5q9yJ8PN2ncJGxUdtTban797qGQFMy+x9H3UQhhej/SWK MIug== X-Gm-Message-State: AOAM530SzZTeNl+BcxwG6YoKeT/BhVJt1r214ewd+vtmI78rgQWBkrR/ xWkVZmixhIKQOkp1CcISciZ/CKd4H0Q+nFYR X-Google-Smtp-Source: ABdhPJxU244AvlvpjGL6MvG2sV2CHTE2C0N1erObIPJMDIF8UqiU0vsvyz6qjJ7JbL+htHcNoAF7Jw== X-Received: by 2002:aa7:83c3:0:b029:2e8:f2ba:3979 with SMTP id j3-20020aa783c30000b02902e8f2ba3979mr15023894pfn.8.1623028454045; Sun, 06 Jun 2021 18:14:14 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:6eb1:2d91:79ee:2043]) by smtp.gmail.com with ESMTPSA id h12sm7303655pgn.54.2021.06.06.18.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 18:14:13 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Jun 2021 10:14:01 +0900 Message-Id: <20210607011402.55331-5-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog In-Reply-To: <20210607011402.55331-1-hiroh@chromium.org> References: <20210607011402.55331-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 5/6] libcamera: pipeline: ipu3: Report available sensor test pattern mode X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" PipelineHandlerIPU3 gets available test pattern modes of the sensor device and reports them to a client. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/ipu3.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index b986bb70..52b11687 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -935,6 +935,16 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data) ControlInfoMap::Map controls = IPU3Controls; const ControlInfoMap &sensorControls = sensor->controls(); + const std::vector &testPatternModes = sensor->testPatternModes(); + if (!testPatternModes.empty()) { + std::vector values; + values.reserve(testPatternModes.size()); + + for (int32_t pattern : testPatternModes) + values.emplace_back(pattern); + + controls[&controls::draft::TestPatternMode] = ControlInfo(values); + } /* * Compute exposure time limits. From patchwork Mon Jun 7 01:14:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12499 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 794C1C320B for ; Mon, 7 Jun 2021 01:14:19 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3EC706892D; Mon, 7 Jun 2021 03:14:19 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="a6WkK9dd"; dkim-atps=neutral Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6EB3268931 for ; Mon, 7 Jun 2021 03:14:17 +0200 (CEST) Received: by mail-pj1-x1031.google.com with SMTP id i22so8847624pju.0 for ; Sun, 06 Jun 2021 18:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=hqu8pksEUVvipvwGZ2F8p2REk5PKW/IuLTrKzsk2/go=; b=a6WkK9ddx0XgdFAnaL+lD4BfuoULMdt+8uy1dgq9bMGe5lfxjEOW/WHJy9bepcqJYD Kl0NPQ6soPOXG9yguwWXZUKHTvTDL3HOP/TwX2Wc1bZg2Ur9Gew8JYQSGv7s4B7SJNwW x4ZFdm5f+HL202AJN7aBC1XNPAAB2l57hcrNI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=hqu8pksEUVvipvwGZ2F8p2REk5PKW/IuLTrKzsk2/go=; b=WTSUGefdI0Sd0+vcCHYXlNhfsB5eB1nuern9dZqPNuX4rRgbUESo2DGwZRvC/3ou3z zrDr0m55InFAr1yi9O1aVcaTQoP57TLu6TYV4QLmbx5lg78HO/PPsY7A5ECh9ZBomvKL 9L1x2uv9jaTwbP41a6xywESfVmCQevbqIqaFcXQCg7FTN802GRccHxvYg/hWF08GHH6y GpFpFAiLQQbsogH2cHyyEVW8YiXHcAohqqWrD01Zfb0UJNPjd6UIvBMOL27fmqOuaEF6 Nf/13++IbI7Sh3C4XIg4yIe2hwK3iFqC+gA+/3FaMtCPLgEVu9YsrEwXw0MyjypvzPjD HZPw== X-Gm-Message-State: AOAM533PX0I7s3ilo3PnfH0cHHqprxsNvF4BwKkFK2G4ifVcRg7ovJOQ Yj6MK7PGEo6WjRowPnXJdMlnBWCXYVcu3lcb X-Google-Smtp-Source: ABdhPJw9243EclzvWVMwGIPT4VMQixng9SPb2Q95E8NEqAE3mNIVRP+ZEMDPbN5l745cnfHUVcAp7Q== X-Received: by 2002:a17:90b:e8a:: with SMTP id fv10mr26508620pjb.160.1623028455801; Sun, 06 Jun 2021 18:14:15 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:6eb1:2d91:79ee:2043]) by smtp.gmail.com with ESMTPSA id h12sm7303655pgn.54.2021.06.06.18.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 06 Jun 2021 18:14:15 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 7 Jun 2021 10:14:02 +0900 Message-Id: <20210607011402.55331-6-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.rc1.229.g3e70b5a671-goog In-Reply-To: <20210607011402.55331-1-hiroh@chromium.org> References: <20210607011402.55331-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v7 6/6] android: CameraDevice: Report queried test pattern modes X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Report to the Android camera stack the list of supported test pattern modes constructed by inspecting the values reported by libcamera through the controls::draft::TestPatternMode control. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/android/camera_device.cpp | 51 ++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index fe332ec3..5e961003 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1083,11 +1083,56 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() staticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, orientation_); - std::vector testPatterModes = { - ANDROID_SENSOR_TEST_PATTERN_MODE_OFF, + std::vector testPatternModes = { + ANDROID_SENSOR_TEST_PATTERN_MODE_OFF }; + const auto &testPatternsInfo = + controlsInfo.find(&controls::draft::TestPatternMode); + if (testPatternsInfo != controlsInfo.end()) { + const auto &values = testPatternsInfo->second.values(); + ASSERT(!values.empty()); + for (const auto &value : values) { + switch (value.get()) { + case controls::draft::TestPatternModeOff: + /* + * ANDROID_SENSOR_TEST_PATTERN_MODE_OFF is + * already in testPatternModes. + */ + break; + + case controls::draft::TestPatternModeSolidColor: + testPatternModes.push_back( + ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR); + break; + + case controls::draft::TestPatternModeColorBars: + testPatternModes.push_back( + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS); + break; + + case controls::draft::TestPatternModeColorBarsFadeToGray: + testPatternModes.push_back( + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY); + break; + + case controls::draft::TestPatternModePn9: + testPatternModes.push_back( + ANDROID_SENSOR_TEST_PATTERN_MODE_PN9); + break; + + case controls::draft::TestPatternModeCustom1: + /* We don't support this yet. */ + break; + + default: + LOG(HAL, Error) << "Unknown test pattern mode: " + << value.get(); + continue; + } + } + } staticMetadata_->addEntry(ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, - testPatterModes); + testPatternModes); uint8_t timestampSource = ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN; staticMetadata_->addEntry(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE,