[{"id":14999,"web_url":"https://patchwork.libcamera.org/comment/14999/","msgid":"<YBxu9KH8byPZxMeS@pendragon.ideasonboard.com>","date":"2021-02-04T22:02:28","subject":"Re: [libcamera-devel] [PATCH 1/2] pipeline: ipa: raspberrypi:\n\tRename RPi::ConfigParameters enum values","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Mon, Feb 01, 2021 at 12:56:32PM +0000, Naushir Patuck wrote:\n> Rename the enum values to indicate pipeline handler -> IPA actions\n> (IPA_CONFIG_*) and IPA -> pipeline handler return results (IPA_RESULT_*).\n> Additionally, provide more descriptive names for these values.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  include/libcamera/ipa/raspberrypi.h            | 10 +++++-----\n>  src/ipa/raspberrypi/raspberrypi.cpp            | 18 +++++++++---------\n>  .../pipeline/raspberrypi/raspberrypi.cpp       | 12 ++++++------\n>  3 files changed, 20 insertions(+), 20 deletions(-)\n> \n> diff --git a/include/libcamera/ipa/raspberrypi.h b/include/libcamera/ipa/raspberrypi.h\n> index 5a9433825d5a..970b9e931188 100644\n> --- a/include/libcamera/ipa/raspberrypi.h\n> +++ b/include/libcamera/ipa/raspberrypi.h\n> @@ -20,11 +20,11 @@ namespace RPi {\n>  \n>  enum ConfigParameters {\n>  \tIPA_CONFIG_LS_TABLE = (1 << 0),\n> -\tIPA_CONFIG_STAGGERED_WRITE = (1 << 1),\n> -\tIPA_CONFIG_SENSOR = (1 << 2),\n> -\tIPA_CONFIG_DROP_FRAMES = (1 << 3),\n> -\tIPA_CONFIG_FAILED = (1 << 4),\n> -\tIPA_CONFIG_STARTUP = (1 << 5),\n> +\tIPA_CONFIG_STARTUP_CTRLS = (1 << 1),\n> +\tIPA_RESULT_CONFIG_FAILED = (1 << 2),\n> +\tIPA_RESULT_SENSOR_PARAMS = (1 << 3),\n> +\tIPA_RESULT_SENSOR_CTRLS = (1 << 4),\n> +\tIPA_RESULT_DROP_FRAMES = (1 << 5),\n>  };\n>  \n>  enum Operations {\n> diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\n> index 681ab9211b7c..fea1ea3957bb 100644\n> --- a/src/ipa/raspberrypi/raspberrypi.cpp\n> +++ b/src/ipa/raspberrypi/raspberrypi.cpp\n> @@ -170,7 +170,7 @@ int IPARPi::start(const IPAOperationData &data, IPAOperationData *result)\n>  \n>  \tASSERT(result);\n>  \tresult->operation = 0;\n> -\tif (data.operation & RPi::IPA_CONFIG_STARTUP) {\n> +\tif (data.operation & RPi::IPA_CONFIG_STARTUP_CTRLS) {\n>  \t\t/* We have been given some controls to action before start. */\n>  \t\tqueueRequest(data.controls[0]);\n>  \t}\n> @@ -188,7 +188,7 @@ int IPARPi::start(const IPAOperationData &data, IPAOperationData *result)\n>  \t\tControlList ctrls(sensorCtrls_);\n>  \t\tapplyAGC(&agcStatus, ctrls);\n>  \t\tresult->controls.emplace_back(ctrls);\n> -\t\tresult->operation |= RPi::IPA_CONFIG_SENSOR;\n> +\t\tresult->operation |= RPi::IPA_RESULT_SENSOR_CTRLS;\n>  \t}\n>  \n>  \t/*\n> @@ -236,7 +236,7 @@ int IPARPi::start(const IPAOperationData &data, IPAOperationData *result)\n>  \t}\n>  \n>  \tresult->data.push_back(dropFrame);\n> -\tresult->operation |= RPi::IPA_CONFIG_DROP_FRAMES;\n> +\tresult->operation |= RPi::IPA_RESULT_DROP_FRAMES;\n>  \n>  \tfirstStart_ = false;\n>  \n> @@ -289,7 +289,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n>  {\n>  \tif (entityControls.size() != 2) {\n>  \t\tLOG(IPARPI, Error) << \"No ISP or sensor controls found.\";\n> -\t\tresult->operation = RPi::IPA_CONFIG_FAILED;\n> +\t\tresult->operation = RPi::IPA_RESULT_CONFIG_FAILED;\n>  \t\treturn;\n>  \t}\n>  \n> @@ -300,13 +300,13 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n>  \n>  \tif (!validateSensorControls()) {\n>  \t\tLOG(IPARPI, Error) << \"Sensor control validation failed.\";\n> -\t\tresult->operation = RPi::IPA_CONFIG_FAILED;\n> +\t\tresult->operation = RPi::IPA_RESULT_CONFIG_FAILED;\n>  \t\treturn;\n>  \t}\n>  \n>  \tif (!validateIspControls()) {\n>  \t\tLOG(IPARPI, Error) << \"ISP control validation failed.\";\n> -\t\tresult->operation = RPi::IPA_CONFIG_FAILED;\n> +\t\tresult->operation = RPi::IPA_RESULT_CONFIG_FAILED;\n>  \t\treturn;\n>  \t}\n>  \n> @@ -325,7 +325,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n>  \t\tif (!helper_) {\n>  \t\t\tLOG(IPARPI, Error) << \"Could not create camera helper for \"\n>  \t\t\t\t\t   << cameraName;\n> -\t\t\tresult->operation = RPi::IPA_CONFIG_FAILED;\n> +\t\t\tresult->operation = RPi::IPA_RESULT_CONFIG_FAILED;\n>  \t\t\treturn;\n>  \t\t}\n>  \n> @@ -342,7 +342,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n>  \t\tresult->data.push_back(exposureDelay); /* For VBLANK ctrl */\n>  \t\tresult->data.push_back(sensorMetadata);\n>  \n> -\t\tresult->operation |= RPi::IPA_CONFIG_STAGGERED_WRITE;\n> +\t\tresult->operation |= RPi::IPA_RESULT_SENSOR_PARAMS;\n>  \t}\n>  \n>  \t/* Re-assemble camera mode using the sensor info. */\n> @@ -395,7 +395,7 @@ void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n>  \t\tapplyAGC(&agcStatus, ctrls);\n>  \n>  \t\tresult->controls.emplace_back(ctrls);\n> -\t\tresult->operation |= RPi::IPA_CONFIG_SENSOR;\n> +\t\tresult->operation |= RPi::IPA_RESULT_SENSOR_CTRLS;\n>  \t}\n>  \n>  \tlastMode_ = mode_;\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index 5ad12d99638f..48e5943edc1a 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -753,7 +753,7 @@ int PipelineHandlerRPi::start(Camera *camera, [[maybe_unused]] ControlList *cont\n>  \tIPAOperationData ipaData = {};\n>  \tIPAOperationData result = {};\n>  \tif (controls) {\n> -\t\tipaData.operation = RPi::IPA_CONFIG_STARTUP;\n> +\t\tipaData.operation = RPi::IPA_CONFIG_STARTUP_CTRLS;\n>  \t\tipaData.controls.emplace_back(*controls);\n>  \t}\n>  \tret = data->ipa_->start(ipaData, &result);\n> @@ -765,12 +765,12 @@ int PipelineHandlerRPi::start(Camera *camera, [[maybe_unused]] ControlList *cont\n>  \t}\n>  \n>  \t/* Apply any gain/exposure settings that the IPA may have passed back. */\n> -\tif (result.operation & RPi::IPA_CONFIG_SENSOR) {\n> +\tif (result.operation & RPi::IPA_RESULT_SENSOR_CTRLS) {\n>  \t\tControlList &ctrls = result.controls[0];\n>  \t\tdata->unicam_[Unicam::Image].dev()->setControls(&ctrls);\n>  \t}\n>  \n> -\tif (result.operation & RPi::IPA_CONFIG_DROP_FRAMES) {\n> +\tif (result.operation & RPi::IPA_RESULT_DROP_FRAMES) {\n>  \t\t/* Configure the number of dropped frames required on startup. */\n>  \t\tdata->dropFrameCount_ = result.data[0];\n>  \t}\n> @@ -1213,13 +1213,13 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n>  \tipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig,\n>  \t\t\t&result);\n>  \n> -\tif (result.operation & RPi::IPA_CONFIG_FAILED) {\n> +\tif (result.operation & RPi::IPA_RESULT_CONFIG_FAILED) {\n>  \t\tLOG(RPI, Error) << \"IPA configuration failed!\";\n>  \t\treturn -EPIPE;\n>  \t}\n>  \n>  \tunsigned int resultIdx = 0;\n> -\tif (result.operation & RPi::IPA_CONFIG_STAGGERED_WRITE) {\n> +\tif (result.operation & RPi::IPA_RESULT_SENSOR_PARAMS) {\n>  \t\t/*\n>  \t\t * Setup our delayed control writer with the sensor default\n>  \t\t * gain and exposure delays.\n> @@ -1237,7 +1237,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n>  \t\t}\n>  \t}\n>  \n> -\tif (result.operation & RPi::IPA_CONFIG_SENSOR) {\n> +\tif (result.operation & RPi::IPA_RESULT_SENSOR_CTRLS) {\n>  \t\tControlList &ctrls = result.controls[0];\n>  \t\tunicam_[Unicam::Image].dev()->setControls(&ctrls);\n>  \t}","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 29236BD160\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Feb 2021 22:02:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 97A856147B;\n\tThu,  4 Feb 2021 23:02:53 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B94D661430\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Feb 2021 23:02:51 +0100 (CET)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3496945D;\n\tThu,  4 Feb 2021 23:02:51 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"TOnvNMUz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1612476171;\n\tbh=gzY/WBQIsNGk6Eyjqat8Spgq7oOdnNuFwOKXDEXZJ0Y=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=TOnvNMUzHZ3SVU3myWQL60f5GXNjotmQ//LmTZ5WM2slywHSgGL7jW47P2sPLI7oo\n\tH+NH4DvN7ImYmCyLIAociKVzu57mmoH8pyk5ekPXahJkb0WVXrP4jHQkuxSi29NHzj\n\tyzhHUoF1GKklzKzDWvfj2154iRnPIgkE/aTEj5Qg=","Date":"Fri, 5 Feb 2021 00:02:28 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<YBxu9KH8byPZxMeS@pendragon.ideasonboard.com>","References":"<20210201125633.26242-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210201125633.26242-1-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH 1/2] pipeline: ipa: raspberrypi:\n\tRename RPi::ConfigParameters enum values","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]