From patchwork Tue Jun 22 02:36:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12675 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 D2EA5C321B for ; Tue, 22 Jun 2021 02:37:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id ED4756893E; Tue, 22 Jun 2021 04:37:06 +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="TjTad1uy"; dkim-atps=neutral Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8DE7068932 for ; Tue, 22 Jun 2021 04:37:05 +0200 (CEST) Received: by mail-pf1-x42a.google.com with SMTP id c5so2601786pfv.8 for ; Mon, 21 Jun 2021 19:37:05 -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=gzOEmV+QUcgTBzBz3f7jfAL9lrYpj5bnbGr4JngLmwM=; b=TjTad1uylHJ0hBoFLSTxXuPiAIuxa/8PpnMXnd8ppaN6XR0JiDMnNScxg+vtYMAxTS Fbk+2ikVs98hOrPMEwWc0tP8ItG61zSXkX9pAX4Rgo4lkMR0Q2odx71YUoA71r5eyNdY 70gRoisBOIlEZDFo79y5Aj41Tov4Hx2V39Dbk= 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=gzOEmV+QUcgTBzBz3f7jfAL9lrYpj5bnbGr4JngLmwM=; b=q9NWr4eKwfVXislST1MgzOozsTknEBnoqr91PyudcEGpYT1USCwAeHVPmFRjU14beg pmAZ740eWEFfs/IlL6wraSTanvR6HoylfSTnK9Qrppz2Y8lcFFu9GX1xHl8y3/vHXIOc m0g2PTn5ldkNrr/vGz0Po/3sizyJ6n6+MMyfmhrzQwhjGARjfZxx6F4bOor7aDVKGm7d stDNVkNssk8L9KRzlqKwhzoS7I/7HU1HMk9Fpgh7COLu0M+yjKRwtjd1CiGfp/5n+dwY ktBSVUKLci631kPANc1UG8BvWa1AoVGYH+g061NhecIrM+lDmlccMoTNUhsBFvl/cSyZ UGkg== X-Gm-Message-State: AOAM531jHj5Og+LWb3Iw4sU8wXXrtKlc/qymEJfp008tbQ5nG5uPyegz toDZkpePPOWE0TGalrSVHGXhekvCNytGUQ== X-Google-Smtp-Source: ABdhPJw3tUWz7UQvh0mxaDuGuxn9Z9EAF93KPkSE5CbeKudpSEJcRAIYmbZjTnAr2khguYIZ1lQ78A== X-Received: by 2002:a63:5153:: with SMTP id r19mr1542025pgl.56.1624329423818; Mon, 21 Jun 2021 19:37:03 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:a025:f98b:b63b:e6b2]) by smtp.gmail.com with ESMTPSA id o7sm18947145pgs.45.2021.06.21.19.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jun 2021 19:37:03 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Tue, 22 Jun 2021 11:36:53 +0900 Message-Id: <20210622023654.969162-4-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.288.g62a8d224e6-goog In-Reply-To: <20210622023654.969162-1-hiroh@chromium.org> References: <20210622023654.969162-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v2 4/5] libcamera: ipu3: Apply a requested 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" Apply a camera sensor a requested test pattern mode. The test pattern mode can be specified per frame. Signed-off-by: Hirokazu Honda --- src/libcamera/pipeline/ipu3/cio2.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp index 8548f749..9d1ff07d 100644 --- a/src/libcamera/pipeline/ipu3/cio2.cpp +++ b/src/libcamera/pipeline/ipu3/cio2.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include "libcamera/internal/camera_sensor.h" @@ -289,6 +290,20 @@ FrameBuffer *CIO2Device::queueBuffer(Request *request, FrameBuffer *rawBuffer) buffer->setRequest(request); } + if (request->controls().contains(controls::draft::TestPatternMode)) { + const uint8_t testPatternMode = + static_cast(request->controls().get( + controls::draft::TestPatternMode)); + int ret = sensor_->setTestPatternMode(testPatternMode); + if (ret) { + LOG(IPU3, Error) + << "Failed to set test pattern mode: " << ret; + } else { + request->metadata().set(controls::draft::TestPatternMode, + testPatternMode); + } + } + int ret = output_->queueBuffer(buffer); if (ret) return nullptr;