[{"id":19192,"web_url":"https://patchwork.libcamera.org/comment/19192/","msgid":"<20210831015530.GC20879@jade.amanokami.net>","date":"2021-08-31T01:55:30","subject":"Re: [libcamera-devel] [PATCH 02/16] libcamera: ipu3: Split controls\n\tinit/update","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Fri, Aug 27, 2021 at 02:07:43PM +0200, Jacopo Mondi wrote:\n> In order to prepare to updating the Camera controls limits when anew\n\ns/prepare to/prepare for/\n\ns/anew/a new/\n\n> camera configuration is applied, split the initControls() function in 2:\n\ns/2/two/\n\n> - updateControls() to actually compute controls values\n> - initControls() to initialize the sensor configuration and call\n>   updateControls\n> \n> Update the functions documentation accordingly.\n> \n> No functional changes intended.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nMakes sense.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/ipu3/ipu3.cpp | 33 ++++++++++++++++++++++++----\n>  1 file changed, 29 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index b321c94e9cb0..885f5ddce139 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -154,6 +154,7 @@ private:\n>  \t}\n>  \n>  \tint initControls(IPU3CameraData *data);\n> +\tint updateControls(IPU3CameraData *data);\n>  \tint registerCameras();\n>  \n>  \tint allocateBuffers(Camera *camera);\n> @@ -927,9 +928,11 @@ bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)\n>   * \\brief Initialize the camera controls\n>   * \\param[in] data The camera data\n>   *\n> - * Initialize the camera controls as the union of the static pipeline handler\n> - * controls (IPU3Controls) and controls created dynamically from the sensor\n> - * capabilities.\n> + * Initialize the camera controls by calculating controls which the pipeline\n> + * is reponsible for and merge them with the controls computed by the IPA.\n> + *\n> + * This function needs data->ipaControls_ to be initialized by the IPA init()\n> + * function at camera creation time. Always call this function after IPA init().\n>   *\n>   * \\return 0 on success or a negative error code otherwise\n>   */\n> @@ -950,8 +953,30 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> +\treturn updateControls(data);\n> +}\n> +\n> +/**\n> + * \\brief Update the camera controls\n> + * \\param[in] data The camera data\n> + *\n> + * Compute the camera controls by calculating controls which the pipeline\n> + * is reponsible for and merge them with the controls computed by the IPA.\n> + *\n> + * This function needs data->ipaControls_ to be refreshed when a new\n> + * configuration is applied to the camera by the IPA configure() function.\n> + *\n> + * Always call this function after IPA configure() to make sure to have a\n> + * properly refreshed IPA controls list.\n> + *\n> + * \\return 0 on success or a negative error code otherwise\n> + */\n> +int PipelineHandlerIPU3::updateControls(IPU3CameraData *data)\n> +{\n> +\tCameraSensor *sensor = data->cio2_.sensor();\n>  \tIPACameraSensorInfo sensorInfo{};\n> -\tret = sensor->sensorInfo(&sensorInfo);\n> +\n> +\tint ret = sensor->sensorInfo(&sensorInfo);\n>  \tif (ret)\n>  \t\treturn ret;\n>  \n> -- \n> 2.32.0\n>","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 C713CBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 31 Aug 2021 01:55:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 279726916A;\n\tTue, 31 Aug 2021 03:55:43 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 02BF168891\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 31 Aug 2021 03:55:40 +0200 (CEST)","from jade.amanokami.net (KD027085206055.au-net.ne.jp\n\t[27.85.206.55])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5A5D024F;\n\tTue, 31 Aug 2021 03:55:37 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Xal6kJSZ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630374940;\n\tbh=CXWzNXJOPNGGbH6NkjV9S0JDtbkwPCSGzEmBo22zAvc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Xal6kJSZgumhEt/lzbo/gYpB1/Mk3OVzZg8rQcZctRc0r1BqgG6nMTBa6moa2sRq3\n\tOy1BpMm1v4SVp0WPkz2U+CxGH45hIJwTSXW9SrrsDOoqRUAfZS4/v62LxLT/Ymp+nX\n\tg2+7b2a25npAETQD2ulBsep0D2Pc0p6zS4nfMUlg=","Date":"Tue, 31 Aug 2021 10:55:30 +0900","From":"Paul Elder <paul.elder@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<20210831015530.GC20879@jade.amanokami.net>","References":"<20210827120757.110615-1-jacopo@jmondi.org>\n\t<20210827120757.110615-3-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20210827120757.110615-3-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 02/16] libcamera: ipu3: Split controls\n\tinit/update","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","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":19239,"web_url":"https://patchwork.libcamera.org/comment/19239/","msgid":"<25d34e98-16f9-1772-bb0d-848990c20fe9@ideasonboard.com>","date":"2021-09-01T06:25:50","subject":"Re: [libcamera-devel] [PATCH 02/16] libcamera: ipu3: Split controls\n\tinit/update","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Jacopo,\n\nThanks for the patch\n\nOn 8/27/21 5:37 PM, Jacopo Mondi wrote:\n> In order to prepare to updating the Camera controls limits when anew\n> camera configuration is applied, split the initControls() function in 2:\n> - updateControls() to actually compute controls values\n> - initControls() to initialize the sensor configuration and call\n>    updateControls\n>\n> Update the functions documentation accordingly.\n>\n> No functional changes intended.\n>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n\n> ---\n>   src/libcamera/pipeline/ipu3/ipu3.cpp | 33 ++++++++++++++++++++++++----\n>   1 file changed, 29 insertions(+), 4 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index b321c94e9cb0..885f5ddce139 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -154,6 +154,7 @@ private:\n>   \t}\n>   \n>   \tint initControls(IPU3CameraData *data);\n> +\tint updateControls(IPU3CameraData *data);\n>   \tint registerCameras();\n>   \n>   \tint allocateBuffers(Camera *camera);\n> @@ -927,9 +928,11 @@ bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)\n>    * \\brief Initialize the camera controls\n>    * \\param[in] data The camera data\n>    *\n> - * Initialize the camera controls as the union of the static pipeline handler\n> - * controls (IPU3Controls) and controls created dynamically from the sensor\n> - * capabilities.\n> + * Initialize the camera controls by calculating controls which the pipeline\n> + * is reponsible for and merge them with the controls computed by the IPA.\n> + *\n> + * This function needs data->ipaControls_ to be initialized by the IPA init()\n> + * function at camera creation time. Always call this function after IPA init().\n>    *\n>    * \\return 0 on success or a negative error code otherwise\n>    */\n> @@ -950,8 +953,30 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)\n>   \tif (ret)\n>   \t\treturn ret;\n>   \n> +\treturn updateControls(data);\n> +}\n> +\n> +/**\n> + * \\brief Update the camera controls\n> + * \\param[in] data The camera data\n> + *\n> + * Compute the camera controls by calculating controls which the pipeline\n> + * is reponsible for and merge them with the controls computed by the IPA.\n> + *\n> + * This function needs data->ipaControls_ to be refreshed when a new\n> + * configuration is applied to the camera by the IPA configure() function.\n> + *\n> + * Always call this function after IPA configure() to make sure to have a\n> + * properly refreshed IPA controls list.\n> + *\n> + * \\return 0 on success or a negative error code otherwise\n> + */\n> +int PipelineHandlerIPU3::updateControls(IPU3CameraData *data)\n> +{\n> +\tCameraSensor *sensor = data->cio2_.sensor();\n>   \tIPACameraSensorInfo sensorInfo{};\n> -\tret = sensor->sensorInfo(&sensorInfo);\n> +\n> +\tint ret = sensor->sensorInfo(&sensorInfo);\n>   \tif (ret)\n>   \t\treturn ret;\n>","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 941F0BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Sep 2021 06:25:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1B6846916A;\n\tWed,  1 Sep 2021 08:25:56 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4CB3C60252\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Sep 2021 08:25:55 +0200 (CEST)","from [192.168.1.104] (unknown [103.251.226.107])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4B7573D7;\n\tWed,  1 Sep 2021 08:25:54 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"I/BGWde9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1630477554;\n\tbh=59LZ3t1KK3WvsdzegWQjK8T6GZRQwnmtJF4f8rJHkRg=;\n\th=Subject:To:References:From:Date:In-Reply-To:From;\n\tb=I/BGWde9o2RLXXJKg2HsqN8QUbgprzzHP8awlCEIZhuE48m2GSLDxapZ9IW/X/aAS\n\tQjJurRRzKyntvHfphofUNa/SxrLg1Q7CSvKuoeRMZpFK/PkrGKGupjeYygglVF0GX3\n\tQe9ArWRal2ZoAyRzX2fSjbKnQ0cpuavfFa+RUo/A=","To":"Jacopo Mondi <jacopo@jmondi.org>, libcamera-devel@lists.libcamera.org","References":"<20210827120757.110615-1-jacopo@jmondi.org>\n\t<20210827120757.110615-3-jacopo@jmondi.org>","From":"Umang Jain <umang.jain@ideasonboard.com>","Message-ID":"<25d34e98-16f9-1772-bb0d-848990c20fe9@ideasonboard.com>","Date":"Wed, 1 Sep 2021 11:55:50 +0530","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.10.2","MIME-Version":"1.0","In-Reply-To":"<20210827120757.110615-3-jacopo@jmondi.org>","Content-Type":"text/plain; charset=utf-8; format=flowed","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 02/16] libcamera: ipu3: Split controls\n\tinit/update","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]