From patchwork Wed May 19 07:59:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12319 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 B5E08C31FF for ; Wed, 19 May 2021 08:00:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 73D636891E; Wed, 19 May 2021 10:00:00 +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="mjsQ0ELA"; dkim-atps=neutral Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F88E6891C for ; Wed, 19 May 2021 09:59:55 +0200 (CEST) Received: by mail-pf1-x429.google.com with SMTP id x188so9330498pfd.7 for ; Wed, 19 May 2021 00:59:55 -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=wgvL7+yR5w/TCnatKYLUR5ZoG1ezPhhfr6ubaG6Qn+0=; b=mjsQ0ELANVG+RfiVvVtLNTU3O7hFVBiO2PopLy95crymcofbkvDb9onU2cYrMfrY/R 8vX73jvxDYHzb2bXWLVn9gYvWrLvjtzMXSCboHSaQO30ogih9+6YNlicxB/Km6teM+By srIp68hxgUnBTxyyusF3ZDHsUFXeDJkAJb8as= 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=wgvL7+yR5w/TCnatKYLUR5ZoG1ezPhhfr6ubaG6Qn+0=; b=lAegFHgPOMz7zCuf6LuEBsk66dltJaRUf9fJIY2QcsF9Z9WsW5mNdU9J8q/YWeGUWZ i7tXY16mVnr39WYpbpRS7vs6MmhK6PAmIeqezayz5r71CrEUAz0+Lc6bOsj+1FMbp+Ba uBtid2PDAi7GFGs6nWiW5kz7HZmOBzl3QneQVkPFDvDUHEC1rg9exn0oo4iO3PTKNUf+ esG3OgHCwTm9rUihSw6NKuAb+J0iwMOeF2ZxpGr02/dAbBcjDvmdsEtQ36zL2xIAAfbV SpBoO4QVMoye5q2G78PO+ELmmGuFxyBHR2wgDmNDnMWiW3XrneRjEddOH6kxl3k6+6jT /+EQ== X-Gm-Message-State: AOAM532jRvO9xFMZtZLljnlugr8IJS3QemElouVZY1xo25m4rl9ts9S9 NrwWUi7shyCJLqF3K8qdygWHG1He6jgwRQ== X-Google-Smtp-Source: ABdhPJwYXUhtQGOdU1dX8V1NuwbyReVintzYe1qEumdbalBfs9GaEWbJCEDgby1qPAr8MKbcBq8X4g== X-Received: by 2002:a63:7204:: with SMTP id n4mr9832439pgc.78.1621411194109; Wed, 19 May 2021 00:59:54 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:3948:91a2:b8ec:1976]) by smtp.gmail.com with ESMTPSA id 80sm1160847pfw.200.2021.05.19.00.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:59:53 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 19 May 2021 16:59:40 +0900 Message-Id: <20210519075941.1337388-5-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog In-Reply-To: <20210519075941.1337388-1-hiroh@chromium.org> References: <20210519075941.1337388-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 --- src/libcamera/pipeline/ipu3/ipu3.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index ade8ffbd..c1d1d937 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -891,6 +891,18 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data) ControlInfoMap::Map controls = IPU3Controls; const ControlInfoMap &sensorControls = sensor->controls(); + if (const std::vector &testPatternModes = + sensor->testPatternModes(); + !testPatternModes.empty()) { + std::vector values; + values.reserve(testPatternModes.size()); + + for (uint8_t pattern : testPatternModes) + values.emplace_back(static_cast(pattern)); + + controls[&controls::draft::TestPatternMode] = ControlInfo(values); + } + /* * Compute exposure time limits. *