From patchwork Tue Mar 23 14:36:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 11673 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 3ECCAC32E5 for ; Tue, 23 Mar 2021 14:36:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EFFA468D79; Tue, 23 Mar 2021 15:36:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="d38wnSNI"; dkim-atps=neutral Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id A607B68D70 for ; Tue, 23 Mar 2021 15:36:23 +0100 (CET) Received: by mail-ed1-x52d.google.com with SMTP id j3so23673193edp.11 for ; Tue, 23 Mar 2021 07:36:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MjuUN3XXLe4QH8PuBMguhkBjRZOS/nt2VbKQfSafdxw=; b=d38wnSNIZItkiM8HZv2YsHDoKqHzGrKxUJFJ0VZAAYgLiaMA0lX+dFUhWh7ersvIDI E1UqFFBroKDnL1JSXA/e9f8qV/Aw8tQxiIjhkOU2VlVN/3IIeTBj5Ljy+vMoK5KtTOm/ hU1tnhPPqiIT9h0GbvUtqRx2Awd/0YxSRi+GyMOstYeKPnFanH3ISxkJ42C0F85UfCXq 6P9cx8iQVtfIixtmbsCAEWoMfa29Irnwuq2qF74CIaIw7ZEMKMP+kyhC+zNyutMkVXLM Uxm0uB+n3wT600XQDVn85iuGrzYU1505jdQK98fVmhb+V+tNqALXT4x1x55nJ8cCW/Kh io4Q== 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=MjuUN3XXLe4QH8PuBMguhkBjRZOS/nt2VbKQfSafdxw=; b=MlcQgblgNxqA/9faD3uBbmchLsh8lUODFEJxdDg4vNxxSu4ZH8xhF6r/ZYCpSBUiEO 90pBjmMHYc6vYK/yx2GHdv4+ue01MGUSJsWvC9JfxrltkeleW6Y23gH9ed7eH3lJd50g 1GmRt7vQkDdGUGYznVtOsEo+1uDSr+zKf+Y1x6WZu+f1yRIhMwxwL7daYQJoTKYpw/5N +rXgI8XuIve5Zp+se//kVFUejpQDjjeXSr5kfZPrnXi/B18fQsKb/dVeUWjFJ1lo9pae 4swXMtG3b4MpMd0b2EBhCPF6cdtavX0I3BtiigsM8sre/1CgengLtpzFpIq+qwFtQ9mO gbuQ== X-Gm-Message-State: AOAM5333qLC+SxQyzQDtiSLp10g6I0tqfBMpQ61tIVljyVstVOEdyf92 zh0H6do+pvf99OysZeTy27Wqeo026ZsLiw== X-Google-Smtp-Source: ABdhPJz97f1EnFFz5pzLkR8Gps0U6YMGwlb6LZOmbPhy8Nqfz4ohwrZ2cmY4MXY4Qzc5Csgfv79aqw== X-Received: by 2002:aa7:c398:: with SMTP id k24mr4911468edq.61.1616510183064; Tue, 23 Mar 2021 07:36:23 -0700 (PDT) Received: from naush-laptop.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id n6sm11282430eji.37.2021.03.23.07.36.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Mar 2021 07:36:22 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Tue, 23 Mar 2021 14:36:10 +0000 Message-Id: <20210323143610.787760-8-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210323143610.787760-1-naush@raspberrypi.com> References: <20210323143610.787760-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 7/7] ipa: raspberrypi: Rationalise parameters to ipa::configure() 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" Rename ConfigInput to IPAConfig to be more consistent with the naming, and remove ConfigInput::op, as it is never used. Replace ConfigOutput with a ControlList type, as that is the only return type from ipa::configure(). Signed-off-by: Naushir Patuck Tested-by: David Plowman Reviewed-by: Laurent Pinchart --- include/libcamera/ipa/raspberrypi.mojom | 15 +++++---------- src/ipa/raspberrypi/raspberrypi.cpp | 11 ++++++----- .../pipeline/raspberrypi/raspberrypi.cpp | 13 +++++-------- 3 files changed, 16 insertions(+), 23 deletions(-) diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom index 55824eebb700..f38c22611cc4 100644 --- a/include/libcamera/ipa/raspberrypi.mojom +++ b/include/libcamera/ipa/raspberrypi.mojom @@ -29,16 +29,11 @@ struct ISPConfig { ControlList controls; }; -struct ConfigInput { - uint32 op; +struct IPAConfig { uint32 transform; FileDescriptor lsTableHandle; }; -struct ConfigOutput { - ControlList controls; -}; - struct StartConfig { ControlList controls; int32 dropFrameCount; @@ -56,7 +51,7 @@ interface IPARPiInterface { * \param[in] streamConfig Configuration of all active streams * \param[in] entityControls Controls provided by the pipeline entities * \param[in] ipaConfig Pipeline-handler-specific configuration data - * \param[out] results Pipeline-handler-specific configuration result + * \param[out] controls Controls to apply by the pipeline entity * * This method shall be called when the camera is configured to inform * the IPA of the camera's streams and the sensor settings. @@ -64,14 +59,14 @@ interface IPARPiInterface { * The \a sensorInfo conveys information about the camera sensor settings that * the pipeline handler has selected for the configuration. * - * The \a ipaConfig and \a results parameters carry data passed by the + * The \a ipaConfig and \a controls parameters carry data passed by the * pipeline handler to the IPA and back. */ configure(CameraSensorInfo sensorInfo, map streamConfig, map entityControls, - ConfigInput ipaConfig) - => (int32 ret, ConfigOutput results); + IPAConfig ipaConfig) + => (int32 ret, ControlList controls); /** * \fn mapBuffers() diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index b717a83e14b5..1c928b72fbd0 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -85,8 +85,8 @@ public: int configure(const CameraSensorInfo &sensorInfo, const std::map &streamConfig, const std::map &entityControls, - const ipa::RPi::ConfigInput &data, - ipa::RPi::ConfigOutput *response) override; + const ipa::RPi::IPAConfig &data, + ControlList *controls) override; void mapBuffers(const std::vector &buffers) override; void unmapBuffers(const std::vector &ids) override; void signalStatReady(const uint32_t bufferId) override; @@ -313,8 +313,8 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo) int IPARPi::configure(const CameraSensorInfo &sensorInfo, [[maybe_unused]] const std::map &streamConfig, const std::map &entityControls, - const ipa::RPi::ConfigInput &ipaConfig, - ipa::RPi::ConfigOutput *result) + const ipa::RPi::IPAConfig &ipaConfig, + ControlList *controls) { if (entityControls.size() != 2) { LOG(IPARPI, Error) << "No ISP or sensor controls found."; @@ -377,7 +377,8 @@ int IPARPi::configure(const CameraSensorInfo &sensorInfo, agcStatus.analogue_gain = DefaultAnalogueGain; applyAGC(&agcStatus, ctrls); - result->controls = std::move(ctrls); + ASSERT(controls); + *controls = std::move(ctrls); } return 0; diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index a65d53898362..2cac802c72e5 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1236,7 +1236,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config) std::map streamConfig; std::map entityControls; - ipa::RPi::ConfigInput ipaConfig; + ipa::RPi::IPAConfig ipaConfig; /* Get the device format to pass to the IPA. */ V4L2DeviceFormat sensorFormat; @@ -1279,19 +1279,16 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config) } /* Ready the IPA - it must know about the sensor resolution. */ - ipa::RPi::ConfigOutput result; - + ControlList controls; ret = ipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig, - &result); + &controls); if (ret < 0) { LOG(RPI, Error) << "IPA configuration failed!"; return -EPIPE; } - if (!result.controls.empty()) { - ControlList &ctrls = result.controls; - unicam_[Unicam::Image].dev()->setControls(&ctrls); - } + if (!controls.empty()) + unicam_[Unicam::Image].dev()->setControls(&controls); /* * Configure the H/V flip controls based on the combination of