From patchwork Fri Apr 9 04:32:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11877 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 760B1BD16B for ; Fri, 9 Apr 2021 04:32:21 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3B5CE68804; Fri, 9 Apr 2021 06:32:21 +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="nlWlIpHT"; dkim-atps=neutral Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BA96F602CB for ; Fri, 9 Apr 2021 06:32:19 +0200 (CEST) Received: by mail-pg1-x52d.google.com with SMTP id y32so2928290pga.11 for ; Thu, 08 Apr 2021 21:32:19 -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=9UX/Pnfp6KSzqx9YQKtRbGf0cc/b41v8hSuDVpEZ5VE=; b=nlWlIpHTAsNy2kOGQ4xT6f6TLpH12Yc/6UxgYp9ET8O103P1fnI0yY67VaidObRCYs MwXtc4qRSTts1bN9tbQCym7lzzjo3r7kGEFHXRCoP0VLINrjWLCGG4fnCh6gwQ/V8EBM 3387wpqdarjG6RU6XDkLWFqxQEy7Gcx3SI6qc= 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=9UX/Pnfp6KSzqx9YQKtRbGf0cc/b41v8hSuDVpEZ5VE=; b=KIeEyIClj0zurnEidz11jirqTvgr9kG3VGpPkPH+SPsq3HkVMzwOumuhntnvVAnoh3 XwXlz8ODkFYq8xh43sKVXcDY5s0Wl/TbuHswZ34SpVgyNueHAAZVDFFCAkqzsie7lbJ9 bBWadF6pb66BIDBfxBSi2EpKiZpVSV90cvsda9IXxeUyH6J/YDetW5FI2DyfBgfFyV+g w9IZifw5X0MlkktbmAh53tEjUSFDz9WXlyWxYakZUoaWQLEiNVdqC06Pj3g+SXOFnEPG tB62emtSWz2quFhl2Gbvd76End9jYF6r9Qx6H+0ue5tKD09FwrCgerT+nCbxJbq7eT92 WN7A== X-Gm-Message-State: AOAM531vlSyet6dmvOMbIRXTUNePtfUkupx8WGLXKJc+4SLd+wujY2rk AgbKt+vovplIU7e8auNVzZY5gne3avrmPQ== X-Google-Smtp-Source: ABdhPJyRLX+MBF/QHhVEObnaJ+G799UAbkWEFvFskMo7c+kOtt51EaQ4yqWSbuBfKsHFqPCtHYxT2g== X-Received: by 2002:a63:4512:: with SMTP id s18mr11336232pga.275.1617942738282; Thu, 08 Apr 2021 21:32:18 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:7567:510e:1b47:ce92]) by smtp.gmail.com with ESMTPSA id il6sm737275pjb.56.2021.04.08.21.32.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 21:32:17 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 9 Apr 2021 13:32:06 +0900 Message-Id: <20210409043208.1823330-4-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.295.g9ea45b61b8-goog In-Reply-To: <20210409043208.1823330-1-hiroh@chromium.org> References: <20210409043208.1823330-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 3/5] libcamera: CameraSensor: Expose 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 adds a getter function for available test pattern modes. The available test pattern modes are initialized one time on CameraSensor::init(). Signed-off-by: Hirokazu Honda --- include/libcamera/internal/camera_sensor.h | 6 ++++++ src/libcamera/camera_sensor.cpp | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 3e98f71b..d924ae42 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -54,6 +54,11 @@ public: const std::vector &mbusCodes() const { return mbusCodes_; } const std::vector &sizes() const { return sizes_; } Size resolution() const; + const std::vector &availableTestPatternModes() const + { + return availableTestPatternModes_; + } + V4L2SubdeviceFormat getFormat(const std::vector &mbusCodes, const Size &size) const; @@ -89,6 +94,7 @@ private: V4L2Subdevice::Formats formats_; std::vector mbusCodes_; std::vector sizes_; + std::vector availableTestPatternModes_; Size pixelArraySize_; Rectangle activeArea_; diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index f7ed91d9..fba6cb06 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -262,6 +262,8 @@ int CameraSensor::init() } } + availableTestPatternModes_ = subdev_->getAvailableTestPatternModes(); + ret = validateSensorDriver(); if (ret) return ret; @@ -548,6 +550,12 @@ int CameraSensor::initProperties() * \return The supported frame sizes sorted in increasing order */ +/** + * \fn CameraSensor::availableTestPatternModes() + * \brief Retrieve the test pattern modes supported by the camera sensor + * \return The available test pattern modes. + */ + /** * \brief Retrieve the camera sensor resolution *