From patchwork Fri Jun 11 08:42:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12566 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 28F90C3214 for ; Fri, 11 Jun 2021 08:42:43 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 301996893B; Fri, 11 Jun 2021 10:42:42 +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="ND1qP+vS"; 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 551C96029E for ; Fri, 11 Jun 2021 10:42:40 +0200 (CEST) Received: by mail-pj1-x1031.google.com with SMTP id g6-20020a17090adac6b029015d1a9a6f1aso6913648pjx.1 for ; Fri, 11 Jun 2021 01:42:40 -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=oT1OFuDrbYyFFxu/+kTv9BHGwA3kSmtUGooGvF71484=; b=ND1qP+vSVFfjBDc4dYR58HMBcyyPLaTl4QP5CLK5zJIi7+lQXvNAhmm8iZrwBzkmDV vKyKMSBkQiYNW6sdjPlrtks4do7f4YX4bb6We5+SpbWSlo2LU186ioD62aLM1qwzELiU UFelZw2ezo6d/HWZuRmMIdmR6GiAc2Det6wHw= 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=oT1OFuDrbYyFFxu/+kTv9BHGwA3kSmtUGooGvF71484=; b=GBlBU6reWa6gvn9ttPsH+s9eRR8WGxjEiqyCIELW3Q0aFb6n1dCz4k03mZaI/y7ZTW B3A+oRzGzIXkQwM5My+zsS664/s6eSa/t6QHQGQY8do5osLX1dPH34SZveGDilLizkfp b8MCklEj2q8NEg3nvQQCOAV+pqtnVGy2yIQazHpUdPWMsTAj+Z1tzR4R5/ydJnBoanW2 2Ku9aSw+xqG2gdz6XTjYcOQFcnDeesFdQXBa/tTkfP9YaMPJ4Xj+4OLQyU2UengYU52u 49zFs5Z8D7/yxN3+gdpBXd2ak8L5LdQPFX9/5aNIPnicGdYyU6ei+hSvfBeLfLiosaQI +A4A== X-Gm-Message-State: AOAM531GYabEGcZ93sgQDel7s0v6I4S0CZmwB5kVCHhs/XURgOQ6ly2M v9+UvfzX5XHkOD5eE3jV/AR4GJpUep53uQ== X-Google-Smtp-Source: ABdhPJx7RfCImwru/H7n9gq4tC2tGjyowGj6+wU4PjK6eDexyy003/UwlVwK2gZYZ0nxIdEsilhjBA== X-Received: by 2002:a17:90b:1e46:: with SMTP id pi6mr8137079pjb.212.1623400958810; Fri, 11 Jun 2021 01:42:38 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:367e:c2e4:d691:eca1]) by smtp.gmail.com with ESMTPSA id 20sm4323542pfi.170.2021.06.11.01.42.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Jun 2021 01:42:38 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 11 Jun 2021 17:42:27 +0900 Message-Id: <20210611084228.1830629-4-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.272.g935e593368-goog In-Reply-To: <20210611084228.1830629-1-hiroh@chromium.org> References: <20210611084228.1830629-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 3/4] 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;