[{"id":36463,"web_url":"https://patchwork.libcamera.org/comment/36463/","msgid":"<inclyuwzbf4ozlj4wflcvfbhyfmrbdeigcr6wq3pru5tx25axv@es4er5ipcu4v>","date":"2025-10-25T12:33:51","subject":"Re: [PATCH v2 27/35] libcamera: internal: camera_sensor: Add\n\taccessor for mountingOrientation_","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"On Thu, Oct 23, 2025 at 04:48:28PM +0200, Stefan Klug wrote:\n> To properly handle the orientation in the dewarper, the mounting\n> orientation of the sensor needs to be queryable. Add that.\n\nRotation property not sufficient ? Or is it set late in the pipeline\nto not be able to access that property?\n\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> ---\n> \n> Changes in v2:\n> - Collected tag\n> - Add documentation\n> ---\n>  include/libcamera/internal/camera_sensor.h    | 1 +\n>  src/libcamera/sensor/camera_sensor.cpp        | 7 +++++++\n>  src/libcamera/sensor/camera_sensor_legacy.cpp | 1 +\n>  src/libcamera/sensor/camera_sensor_raw.cpp    | 1 +\n>  4 files changed, 10 insertions(+)\n> \n> diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\n> index f6ef4df170d4..e6b72d22ac21 100644\n> --- a/include/libcamera/internal/camera_sensor.h\n> +++ b/include/libcamera/internal/camera_sensor.h\n> @@ -73,6 +73,7 @@ public:\n>  \tvirtual int sensorInfo(IPACameraSensorInfo *info) const = 0;\n>  \tvirtual Transform computeTransform(Orientation *orientation) const = 0;\n>  \tvirtual BayerFormat::Order bayerOrder(Transform t) const = 0;\n> +\tvirtual Orientation mountingOrientation() const = 0;\n>  \n>  \tvirtual const ControlInfoMap &controls() const = 0;\n>  \tvirtual ControlList getControls(Span<const uint32_t> ids) = 0;\n> diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp\n> index 4f2fd2690eb5..05390d1e1b60 100644\n> --- a/src/libcamera/sensor/camera_sensor.cpp\n> +++ b/src/libcamera/sensor/camera_sensor.cpp\n> @@ -331,6 +331,13 @@ int CameraSensor::setEmbeddedDataEnabled(bool enable)\n>   * \\return The Bayer order produced by the sensor when the Transform is applied\n>   */\n>  \n> +/**\n> + * \\fn CameraSensor::mountingOrientation()\n> + * \\brief Fetch the mounting orientation of the sensor\n> + *\n> + * \\return The mounting orientation of the sensor\n> + */\n> +\n>  /**\n>   * \\fn CameraSensor::controls()\n>   * \\brief Retrieve the supported V4L2 controls and their information\n> diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp\n> index f9e685a9acc4..39c34200b0ff 100644\n> --- a/src/libcamera/sensor/camera_sensor_legacy.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp\n> @@ -88,6 +88,7 @@ public:\n>  \tint sensorInfo(IPACameraSensorInfo *info) const override;\n>  \tTransform computeTransform(Orientation *orientation) const override;\n>  \tBayerFormat::Order bayerOrder(Transform t) const override;\n> +\tOrientation mountingOrientation() const override { return mountingOrientation_; }\n>  \n>  \tconst ControlInfoMap &controls() const override;\n>  \tControlList getControls(Span<const uint32_t> ids) override;\n> diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp\n> index 8ea4423698cd..759cccafe4a9 100644\n> --- a/src/libcamera/sensor/camera_sensor_raw.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_raw.cpp\n> @@ -94,6 +94,7 @@ public:\n>  \tint sensorInfo(IPACameraSensorInfo *info) const override;\n>  \tTransform computeTransform(Orientation *orientation) const override;\n>  \tBayerFormat::Order bayerOrder(Transform t) const override;\n> +\tOrientation mountingOrientation() const override { return mountingOrientation_; }\n>  \n>  \tconst ControlInfoMap &controls() const override;\n>  \tControlList getControls(Span<const uint32_t> ids) override;\n> -- \n> 2.48.1\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 136C7BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 25 Oct 2025 12:33:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4845E606A8;\n\tSat, 25 Oct 2025 14:33:24 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8E8CC60697\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 25 Oct 2025 14:33:22 +0200 (CEST)","from amazon1-vf-gw.lnd.cw.net ([195.89.103.118] helo=uajain)\n\tby fanzine2.igalia.com with esmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1vCdST-00F6TN-R1; Sat, 25 Oct 2025 14:33:21 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"WTL2GTx1\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:\n\tSubject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=KjRphLQMUX5fm3SFNSlT6ObKob6pYf5GU0uB+D3PK8w=;\n\tb=WTL2GTx1IUdaiIrHYS0VQPXvMe\n\tX7mUdc+cMpH1vNsnfH+aJp7K23/bzZijpeTRbouO7l4TAHXknZqBLL+tOtUrNqqPwR8tA3/ZVkfxX\n\tNV0HxRf8g+L5qeHEk9Sk3WQuFcQSaHBLptxvKZF7/gVSN3uBRIXNulONIMYYX7r5FDHFdLmiAWqxl\n\tj9IlvETDuz/tFq5gD7mhKcy2TxbJUJ2rVMyoAulH0j4+YI52PA+dsXfLhMTQi0vCZ1q+lend57TZ/\n\t6Khd/t9IVJif6GjJlcqMp9kT1HguzhS1AHhlQ4KPT7lCzFrnwJvi3maSlCCkO6MR7or5OtHjIvgoc\n\tY3eamegA==;","Date":"Sat, 25 Oct 2025 13:33:51 +0100","From":"Umang Jain <uajain@igalia.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Subject":"Re: [PATCH v2 27/35] libcamera: internal: camera_sensor: Add\n\taccessor for mountingOrientation_","Message-ID":"<inclyuwzbf4ozlj4wflcvfbhyfmrbdeigcr6wq3pru5tx25axv@es4er5ipcu4v>","References":"<20251023144841.403689-1-stefan.klug@ideasonboard.com>\n\t<20251023144841.403689-28-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20251023144841.403689-28-stefan.klug@ideasonboard.com>","User-Agent":"NeoMutt/20250905-dirty","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>"}},{"id":36729,"web_url":"https://patchwork.libcamera.org/comment/36729/","msgid":"<176243040761.2116251.1319308254595957276@neptunite.rasen.tech>","date":"2025-11-06T12:00:07","subject":"Re: [PATCH v2 27/35] libcamera: internal: camera_sensor: Add\n\taccessor for mountingOrientation_","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Stefan Klug (2025-10-23 23:48:28)\n> To properly handle the orientation in the dewarper, the mounting\n> orientation of the sensor needs to be queryable. Add that.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nLooks good to me.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> \n> ---\n> \n> Changes in v2:\n> - Collected tag\n> - Add documentation\n> ---\n>  include/libcamera/internal/camera_sensor.h    | 1 +\n>  src/libcamera/sensor/camera_sensor.cpp        | 7 +++++++\n>  src/libcamera/sensor/camera_sensor_legacy.cpp | 1 +\n>  src/libcamera/sensor/camera_sensor_raw.cpp    | 1 +\n>  4 files changed, 10 insertions(+)\n> \n> diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h\n> index f6ef4df170d4..e6b72d22ac21 100644\n> --- a/include/libcamera/internal/camera_sensor.h\n> +++ b/include/libcamera/internal/camera_sensor.h\n> @@ -73,6 +73,7 @@ public:\n>         virtual int sensorInfo(IPACameraSensorInfo *info) const = 0;\n>         virtual Transform computeTransform(Orientation *orientation) const = 0;\n>         virtual BayerFormat::Order bayerOrder(Transform t) const = 0;\n> +       virtual Orientation mountingOrientation() const = 0;\n>  \n>         virtual const ControlInfoMap &controls() const = 0;\n>         virtual ControlList getControls(Span<const uint32_t> ids) = 0;\n> diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp\n> index 4f2fd2690eb5..05390d1e1b60 100644\n> --- a/src/libcamera/sensor/camera_sensor.cpp\n> +++ b/src/libcamera/sensor/camera_sensor.cpp\n> @@ -331,6 +331,13 @@ int CameraSensor::setEmbeddedDataEnabled(bool enable)\n>   * \\return The Bayer order produced by the sensor when the Transform is applied\n>   */\n>  \n> +/**\n> + * \\fn CameraSensor::mountingOrientation()\n> + * \\brief Fetch the mounting orientation of the sensor\n> + *\n> + * \\return The mounting orientation of the sensor\n> + */\n> +\n>  /**\n>   * \\fn CameraSensor::controls()\n>   * \\brief Retrieve the supported V4L2 controls and their information\n> diff --git a/src/libcamera/sensor/camera_sensor_legacy.cpp b/src/libcamera/sensor/camera_sensor_legacy.cpp\n> index f9e685a9acc4..39c34200b0ff 100644\n> --- a/src/libcamera/sensor/camera_sensor_legacy.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_legacy.cpp\n> @@ -88,6 +88,7 @@ public:\n>         int sensorInfo(IPACameraSensorInfo *info) const override;\n>         Transform computeTransform(Orientation *orientation) const override;\n>         BayerFormat::Order bayerOrder(Transform t) const override;\n> +       Orientation mountingOrientation() const override { return mountingOrientation_; }\n>  \n>         const ControlInfoMap &controls() const override;\n>         ControlList getControls(Span<const uint32_t> ids) override;\n> diff --git a/src/libcamera/sensor/camera_sensor_raw.cpp b/src/libcamera/sensor/camera_sensor_raw.cpp\n> index 8ea4423698cd..759cccafe4a9 100644\n> --- a/src/libcamera/sensor/camera_sensor_raw.cpp\n> +++ b/src/libcamera/sensor/camera_sensor_raw.cpp\n> @@ -94,6 +94,7 @@ public:\n>         int sensorInfo(IPACameraSensorInfo *info) const override;\n>         Transform computeTransform(Orientation *orientation) const override;\n>         BayerFormat::Order bayerOrder(Transform t) const override;\n> +       Orientation mountingOrientation() const override { return mountingOrientation_; }\n>  \n>         const ControlInfoMap &controls() const override;\n>         ControlList getControls(Span<const uint32_t> ids) override;\n> -- \n> 2.48.1\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 BE774BDE4C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Nov 2025 12:00:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D4334609D8;\n\tThu,  6 Nov 2025 13:00:15 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 95107606E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Nov 2025 13:00:14 +0100 (CET)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:8ce5:1b8c:5343:a04e])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id A8B8C6AF;\n\tThu,  6 Nov 2025 12:58:18 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Ex0C+ISw\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1762430299;\n\tbh=tBunVHlt5QyX68ojmZZrKexP9ifsHV8Ux5mLuk4HubQ=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=Ex0C+ISwhr1d28uXcDZeg8+y2DOwAm8ORJBtIiuyLKIG266vevopzTdUKlIXtdwgG\n\tKF9j5GG6y9jtDJn7VMMxM1BX/YxUV9tmKkdFHtjeNk6PkN3McISC+ZKGzTjgP63ib0\n\tX8d7MWrTN4+rPEfJ/KeUmLNNYdpfpQsFpay0NyEo=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251023144841.403689-28-stefan.klug@ideasonboard.com>","References":"<20251023144841.403689-1-stefan.klug@ideasonboard.com>\n\t<20251023144841.403689-28-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2 27/35] libcamera: internal: camera_sensor: Add\n\taccessor for mountingOrientation_","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 06 Nov 2025 21:00:07 +0900","Message-ID":"<176243040761.2116251.1319308254595957276@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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>"}}]