[{"id":36059,"web_url":"https://patchwork.libcamera.org/comment/36059/","msgid":"<9c878398-7983-4f96-9ea0-bd476b64b019@ideasonboard.com>","date":"2025-09-30T13:52:34","subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 09. 30. 14:26 keltezéssel, Stefan Klug írta:\n> The dw100 allows more features implemented in the dw100 vertex map.\n> Implement these features for the rkisp1 pipeline.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>   src/libcamera/control_ids_draft.yaml     | 39 ++++++++++++++++++-\n>   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 48 +++++++++++++++++++++++-\n>   2 files changed, 85 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> index 03309eeac34f..10ee68db6d8c 100644\n> --- a/src/libcamera/control_ids_draft.yaml\n> +++ b/src/libcamera/control_ids_draft.yaml\n> @@ -206,7 +206,44 @@ controls:\n>               available only on this camera device are at least this numeric\n>               value. All of the custom test patterns will be static (that is the\n>               raw image must not vary from frame to frame).\n> -\n> +  - Dw100ScaleMode:\n> +      type: int32_t\n> +      direction: inout\n> +      description: |\n> +        Scale mode of the dewarper.\n> +      enum:\n\nWrt. https://patchwork.libcamera.org/patch/24496/ could you prefix the\nnames of the enumerators with exactly the name of the control?\n\n\nRegards,\nBarnabás Pőcze\n\n\n> +        - name: Fill\n> +          value: 0\n> +          description: |\n> +            Fills the given output size with the largest rectangle possible.\n> +            Aspect ratio is not preserved. Dw100Scale and Dw100Offset are\n> +            ignored.\n> +        - name: Crop\n> +          value: 1\n> +          description: |\n> +            Crops to the given output size. The scale factor can be specified\n> +            using Dw100Scale. Aspect ratio is preserved.\n> +  - Dw100Scale:\n> +      type: float\n> +      direction: inout\n> +      description: |\n> +        Scale factor applied to the image when Dw100ScaleMode is set to Crop.\n> +        This value is clamped, so that all pixels have valid input data.\n> +        Therefore a value of 0 always provides the largest possible field of\n> +        view.\n> +  - Dw100Rotation:\n> +      type: float\n> +      direction: inout\n> +      description: |\n> +        Rotates the image by the given angle in degrees.\n> +  - Dw100Offset:\n> +      type: Point\n> +      direction: inout\n> +      description: |\n> +        Moves the image by the given values in x and y direction in output\n> +        coordinate space. This is clamped, so that all output pixels contain\n> +        valid data. The offset is therefore ignored when Dw100ScaleMode is set\n> +        to 'Fit' or the Dw100Scale value is too small.\n>     - FaceDetectMode:\n>         type: int32_t\n>         direction: inout\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 8b78c7f213f6..740791ac9c02 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -1364,6 +1364,17 @@ int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)\n>   \t\t\t\t\t\t\t      scalerMaxCrop_);\n>   \t\tdata->properties_.set(properties::ScalerCropMaximum, scalerMaxCrop_);\n>   \t\tactiveCrop_ = scalerMaxCrop_;\n> +\n> +\t\tif (dewarper_->supportsRequests()) {\n> +\t\t\tcontrols[&controls::draft::Dw100Scale] = ControlInfo(0.2f, 8.0f, 1.0f);\n> +\t\t\tcontrols[&controls::draft::Dw100Rotation] = ControlInfo(-180.0f, 180.0f, 0.0f);\n> +\t\t\tcontrols[&controls::draft::Dw100Offset] = ControlInfo(Point(-10000, -10000), Point(10000, 10000), Point(0, 0));\n> +\t\t\tcontrols[&controls::draft::Dw100ScaleMode] = ControlInfo(controls::draft::Dw100ScaleModeValues, controls::draft::Fill);\n> +\t\t} else {\n> +\t\t\tLOG(RkISP1, Warning)\n> +\t\t\t\t<< \"dw100 kernel driver has no requests support.\"\n> +\t\t\t\t   \" No dynamic configuration possible.\";\n> +\t\t}\n>   \t}\n> \n>   \t/* Add the IPA registered controls to list of camera controls. */\n> @@ -1637,6 +1648,37 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n>   \t\tavailableDewarpRequests_.pop();\n>   \t}\n> \n> +\tbool update = false;\n> +\tauto &vertexMap = dewarper_->vertexMap(&data->mainPathStream_);\n> +\n> +\tconst auto &scale = request->controls().get(controls::draft::Dw100Scale);\n> +\tif (scale) {\n> +\t\tvertexMap.setScale(*scale);\n> +\t\tupdate = true;\n> +\t}\n> +\n> +\tconst auto &rotation = request->controls().get(controls::draft::Dw100Rotation);\n> +\tif (rotation) {\n> +\t\tvertexMap.setRotation(*rotation);\n> +\t\tupdate = true;\n> +\t}\n> +\n> +\tconst auto &offset = request->controls().get(controls::draft::Dw100Offset);\n> +\tif (offset) {\n> +\t\tvertexMap.setOffset(*offset);\n> +\t\tupdate = true;\n> +\t}\n> +\n> +\tconst auto &scaleMode = request->controls().get(controls::draft::Dw100ScaleMode);\n> +\tif (scaleMode) {\n> +\t\tvertexMap.setMode(static_cast<Dw100VertexMap::ScaleMode>(*scaleMode));\n> +\t\tupdate = true;\n> +\t}\n> +\n> +\tif (update || info->frame == 0) {\n> +\t\tdewarper_->applyVertexMap(&data->mainPathStream_, dewarpRequest);\n> +\t}\n> +\n>   \t/* Handle scaler crop control. */\n>   \tconst auto &crop = request->controls().get(controls::ScalerCrop);\n>   \tif (crop) {\n> @@ -1700,7 +1742,11 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n>   \t\t}\n>   \t}\n> \n> -\trequest->metadata().set(controls::ScalerCrop, activeCrop_.value());\n> +\tauto &meta = request->metadata();\n> +\tmeta.set(controls::draft::Dw100Scale, vertexMap.effectiveScale());\n> +\tmeta.set(controls::draft::Dw100Rotation, vertexMap.rotation());\n> +\tmeta.set(controls::draft::Dw100Offset, vertexMap.effectiveOffset());\n> +\tmeta.set(controls::ScalerCrop, activeCrop_.value());\n>   }\n> \n>   void PipelineHandlerRkISP1::dewarpRequestReady(V4L2Request *request)\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 784DBC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 30 Sep 2025 13:52:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 524CC6B599;\n\tTue, 30 Sep 2025 15:52:40 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 291E462C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 30 Sep 2025 15:52:38 +0200 (CEST)","from [192.168.33.11] (185.221.142.146.nat.pool.zt.hu\n\t[185.221.142.146])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BDB9916A;\n\tTue, 30 Sep 2025 15:51:09 +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=\"LtUxpP80\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759240269;\n\tbh=RZ+CL1SALWLK2VxnMZ+CzXUvfFTiuQiXAGo36qiQFBY=;\n\th=Date:Subject:To:References:From:Cc:In-Reply-To:From;\n\tb=LtUxpP80xd0uDe3gTSinswEjbTgvbfAOHdS196nwfAZXsmuwOfehkwN5agJNFtiDp\n\tdWyKyyOcP5qDfO9nv5lEKZn7NJc7ELhF2cbmozMD3tu4Rrela04MLwQ8vzNhqWEdJx\n\t3gI9bqlzphDS5x+7xB/lOq8E2i3AojUibJxTz4+0=","Message-ID":"<9c878398-7983-4f96-9ea0-bd476b64b019@ideasonboard.com>","Date":"Tue, 30 Sep 2025 15:52:34 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","To":"Stefan Klug <stefan.klug@ideasonboard.com>","References":"<20250930122726.1837524-1-stefan.klug@ideasonboard.com>\n\t<w4B1Rvh24N5HQ_65u-_tEI7THn6ieV7z7TtOIqmKOp-9gh96ZuW8hMPlCohGul_fmwlrAOYuUYw0xnhR0O8QAw==@protonmail.internalid>\n\t<20250930122726.1837524-24-stefan.klug@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","Cc":"libcamera-devel@lists.libcamera.org","In-Reply-To":"<20250930122726.1837524-24-stefan.klug@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":36110,"web_url":"https://patchwork.libcamera.org/comment/36110/","msgid":"<175950088377.1246375.17444846667345841803@ping.linuxembedded.co.uk>","date":"2025-10-03T14:14:43","subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Barnabás Pőcze (2025-09-30 14:52:34)\n> Hi\n> \n> 2025. 09. 30. 14:26 keltezéssel, Stefan Klug írta:\n> > The dw100 allows more features implemented in the dw100 vertex map.\n> > Implement these features for the rkisp1 pipeline.\n> > \n> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > ---\n> >   src/libcamera/control_ids_draft.yaml     | 39 ++++++++++++++++++-\n> >   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 48 +++++++++++++++++++++++-\n> >   2 files changed, 85 insertions(+), 2 deletions(-)\n> > \n> > diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> > index 03309eeac34f..10ee68db6d8c 100644\n> > --- a/src/libcamera/control_ids_draft.yaml\n> > +++ b/src/libcamera/control_ids_draft.yaml\n> > @@ -206,7 +206,44 @@ controls:\n> >               available only on this camera device are at least this numeric\n> >               value. All of the custom test patterns will be static (that is the\n> >               raw image must not vary from frame to frame).\n> > -\n> > +  - Dw100ScaleMode:\n> > +      type: int32_t\n> > +      direction: inout\n> > +      description: |\n> > +        Scale mode of the dewarper.\n> > +      enum:\n> \n> Wrt. https://patchwork.libcamera.org/patch/24496/ could you prefix the\n> names of the enumerators with exactly the name of the control?\n\nAlso - I'm really trying to push against ::draft:: and I'd like to see\nthat namespace removed ... it was a conceptual idea that just leads to a\ndumping ground. It was also before we had vendor/namespaces for\ncontrols.\n\nIf you really think these should be distinguished from core controls -\ncan they go into a DW100 namespace ?\n\n> Regards,\n> Barnabás Pőcze\n> \n> \n> > +        - name: Fill\n> > +          value: 0\n> > +          description: |\n> > +            Fills the given output size with the largest rectangle possible.\n> > +            Aspect ratio is not preserved. Dw100Scale and Dw100Offset are\n> > +            ignored.\n> > +        - name: Crop\n> > +          value: 1\n> > +          description: |\n> > +            Crops to the given output size. The scale factor can be specified\n> > +            using Dw100Scale. Aspect ratio is preserved.\n> > +  - Dw100Scale:\n> > +      type: float\n> > +      direction: inout\n> > +      description: |\n> > +        Scale factor applied to the image when Dw100ScaleMode is set to Crop.\n> > +        This value is clamped, so that all pixels have valid input data.\n> > +        Therefore a value of 0 always provides the largest possible field of\n> > +        view.\n> > +  - Dw100Rotation:\n> > +      type: float\n> > +      direction: inout\n> > +      description: |\n> > +        Rotates the image by the given angle in degrees.\n> > +  - Dw100Offset:\n> > +      type: Point\n> > +      direction: inout\n> > +      description: |\n> > +        Moves the image by the given values in x and y direction in output\n> > +        coordinate space. This is clamped, so that all output pixels contain\n> > +        valid data. The offset is therefore ignored when Dw100ScaleMode is set\n> > +        to 'Fit' or the Dw100Scale value is too small.\n> >     - FaceDetectMode:\n> >         type: int32_t\n> >         direction: inout\n> > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > index 8b78c7f213f6..740791ac9c02 100644\n> > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > @@ -1364,6 +1364,17 @@ int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)\n> >                                                             scalerMaxCrop_);\n> >               data->properties_.set(properties::ScalerCropMaximum, scalerMaxCrop_);\n> >               activeCrop_ = scalerMaxCrop_;\n> > +\n> > +             if (dewarper_->supportsRequests()) {\n> > +                     controls[&controls::draft::Dw100Scale] = ControlInfo(0.2f, 8.0f, 1.0f);\n> > +                     controls[&controls::draft::Dw100Rotation] = ControlInfo(-180.0f, 180.0f, 0.0f);\n> > +                     controls[&controls::draft::Dw100Offset] = ControlInfo(Point(-10000, -10000), Point(10000, 10000), Point(0, 0));\n> > +                     controls[&controls::draft::Dw100ScaleMode] = ControlInfo(controls::draft::Dw100ScaleModeValues, controls::draft::Fill);\n> > +             } else {\n> > +                     LOG(RkISP1, Warning)\n> > +                             << \"dw100 kernel driver has no requests support.\"\n> > +                                \" No dynamic configuration possible.\";\n> > +             }\n> >       }\n> > \n> >       /* Add the IPA registered controls to list of camera controls. */\n> > @@ -1637,6 +1648,37 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n> >               availableDewarpRequests_.pop();\n> >       }\n> > \n> > +     bool update = false;\n> > +     auto &vertexMap = dewarper_->vertexMap(&data->mainPathStream_);\n> > +\n> > +     const auto &scale = request->controls().get(controls::draft::Dw100Scale);\n> > +     if (scale) {\n> > +             vertexMap.setScale(*scale);\n> > +             update = true;\n> > +     }\n> > +\n> > +     const auto &rotation = request->controls().get(controls::draft::Dw100Rotation);\n> > +     if (rotation) {\n> > +             vertexMap.setRotation(*rotation);\n> > +             update = true;\n> > +     }\n> > +\n> > +     const auto &offset = request->controls().get(controls::draft::Dw100Offset);\n> > +     if (offset) {\n> > +             vertexMap.setOffset(*offset);\n> > +             update = true;\n> > +     }\n> > +\n> > +     const auto &scaleMode = request->controls().get(controls::draft::Dw100ScaleMode);\n> > +     if (scaleMode) {\n> > +             vertexMap.setMode(static_cast<Dw100VertexMap::ScaleMode>(*scaleMode));\n> > +             update = true;\n> > +     }\n> > +\n> > +     if (update || info->frame == 0) {\n> > +             dewarper_->applyVertexMap(&data->mainPathStream_, dewarpRequest);\n> > +     }\n> > +\n> >       /* Handle scaler crop control. */\n> >       const auto &crop = request->controls().get(controls::ScalerCrop);\n> >       if (crop) {\n> > @@ -1700,7 +1742,11 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n> >               }\n> >       }\n> > \n> > -     request->metadata().set(controls::ScalerCrop, activeCrop_.value());\n> > +     auto &meta = request->metadata();\n> > +     meta.set(controls::draft::Dw100Scale, vertexMap.effectiveScale());\n> > +     meta.set(controls::draft::Dw100Rotation, vertexMap.rotation());\n> > +     meta.set(controls::draft::Dw100Offset, vertexMap.effectiveOffset());\n> > +     meta.set(controls::ScalerCrop, activeCrop_.value());\n> >   }\n> > \n> >   void PipelineHandlerRkISP1::dewarpRequestReady(V4L2Request *request)\n> > --\n> > 2.48.1\n> > \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 2F5A3BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Oct 2025 14:14:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3449E6B5AA;\n\tFri,  3 Oct 2025 16:14:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6262269318\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Oct 2025 16:14:47 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A1C1D192C;\n\tFri,  3 Oct 2025 16:13:16 +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=\"ozYaIsBC\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759500796;\n\tbh=5AKNbMbmaNFvQVa9xAJVRHD9kOt/qPupLIfqlJDY+JE=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=ozYaIsBCWyd5+AxWwHmhV/HaTcEwZM4hh5Q6gLR06BwnEeeoTE6T0Z/zTfOM0w+PR\n\tPDeY0kVh/q/Uhjvz17wi6FwFEMc5qUCGD9kQ/1v5cRbSJh15Z9JsDGOUcFlwnJ+761\n\tKyBQZR6uyBoNiamFFwgqJkCHKvX1IjrBPaI4lkrg=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<9c878398-7983-4f96-9ea0-bd476b64b019@ideasonboard.com>","References":"<20250930122726.1837524-1-stefan.klug@ideasonboard.com>\n\t<w4B1Rvh24N5HQ_65u-_tEI7THn6ieV7z7TtOIqmKOp-9gh96ZuW8hMPlCohGul_fmwlrAOYuUYw0xnhR0O8QAw==@protonmail.internalid>\n\t<20250930122726.1837524-24-stefan.klug@ideasonboard.com>\n\t<9c878398-7983-4f96-9ea0-bd476b64b019@ideasonboard.com>","Subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>","Date":"Fri, 03 Oct 2025 15:14:43 +0100","Message-ID":"<175950088377.1246375.17444846667345841803@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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":36113,"web_url":"https://patchwork.libcamera.org/comment/36113/","msgid":"<CAEmqJPpn-aarSwGqCJ=a40ar2YjDLY3in+6vxR8N2J90Dfs5sw@mail.gmail.com>","date":"2025-10-03T14:31:20","subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Stefan,\n\nSorry for jumping in here... :)\n\nOn Tue, 30 Sept 2025 at 14:22, Stefan Klug <stefan.klug@ideasonboard.com>\nwrote:\n\n> The dw100 allows more features implemented in the dw100 vertex map.\n> Implement these features for the rkisp1 pipeline.\n>\n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>  src/libcamera/control_ids_draft.yaml     | 39 ++++++++++++++++++-\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 48 +++++++++++++++++++++++-\n>  2 files changed, 85 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/libcamera/control_ids_draft.yaml\n> b/src/libcamera/control_ids_draft.yaml\n> index 03309eeac34f..10ee68db6d8c 100644\n> --- a/src/libcamera/control_ids_draft.yaml\n> +++ b/src/libcamera/control_ids_draft.yaml\n> @@ -206,7 +206,44 @@ controls:\n>              available only on this camera device are at least this numeric\n>              value. All of the custom test patterns will be static (that\n> is the\n>              raw image must not vary from frame to frame).\n> -\n> +  - Dw100ScaleMode:\n> +      type: int32_t\n> +      direction: inout\n> +      description: |\n> +        Scale mode of the dewarper.\n> +      enum:\n> +        - name: Fill\n> +          value: 0\n> +          description: |\n> +            Fills the given output size with the largest rectangle\n> possible.\n> +            Aspect ratio is not preserved. Dw100Scale and Dw100Offset are\n> +            ignored.\n> +        - name: Crop\n> +          value: 1\n> +          description: |\n> +            Crops to the given output size. The scale factor can be\n> specified\n> +            using Dw100Scale. Aspect ratio is preserved.\n> +  - Dw100Scale:\n> +      type: float\n> +      direction: inout\n> +      description: |\n> +        Scale factor applied to the image when Dw100ScaleMode is set to\n> Crop.\n> +        This value is clamped, so that all pixels have valid input data.\n> +        Therefore a value of 0 always provides the largest possible field\n> of\n> +        view.\n>\n\nCouldn't the above 3 be represented by the ScalerCrop control in\nconjunction with the stream output size?\n\nAlso, I would suggest that perhaps these controls belong in a new\nrksip vendor namespace.\n\nRegards,\nNaush\n\n\n\n> +  - Dw100Rotation:\n> +      type: float\n> +      direction: inout\n> +      description: |\n> +        Rotates the image by the given angle in degrees.\n> +  - Dw100Offset:\n> +      type: Point\n> +      direction: inout\n> +      description: |\n> +        Moves the image by the given values in x and y direction in\n> output\n> +        coordinate space. This is clamped, so that all output pixels\n> contain\n> +        valid data. The offset is therefore ignored when Dw100ScaleMode\n> is set\n> +        to 'Fit' or the Dw100Scale value is too small.\n>    - FaceDetectMode:\n>        type: int32_t\n>        direction: inout\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 8b78c7f213f6..740791ac9c02 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -1364,6 +1364,17 @@ int\n> PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)\n>\n> scalerMaxCrop_);\n>                 data->properties_.set(properties::ScalerCropMaximum,\n> scalerMaxCrop_);\n>                 activeCrop_ = scalerMaxCrop_;\n> +\n> +               if (dewarper_->supportsRequests()) {\n> +                       controls[&controls::draft::Dw100Scale] =\n> ControlInfo(0.2f, 8.0f, 1.0f);\n> +                       controls[&controls::draft::Dw100Rotation] =\n> ControlInfo(-180.0f, 180.0f, 0.0f);\n> +                       controls[&controls::draft::Dw100Offset] =\n> ControlInfo(Point(-10000, -10000), Point(10000, 10000), Point(0, 0));\n> +                       controls[&controls::draft::Dw100ScaleMode] =\n> ControlInfo(controls::draft::Dw100ScaleModeValues, controls::draft::Fill);\n> +               } else {\n> +                       LOG(RkISP1, Warning)\n> +                               << \"dw100 kernel driver has no requests\n> support.\"\n> +                                  \" No dynamic configuration possible.\";\n> +               }\n>         }\n>\n>         /* Add the IPA registered controls to list of camera controls. */\n> @@ -1637,6 +1648,37 @@ void\n> PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n>                 availableDewarpRequests_.pop();\n>         }\n>\n> +       bool update = false;\n> +       auto &vertexMap = dewarper_->vertexMap(&data->mainPathStream_);\n> +\n> +       const auto &scale =\n> request->controls().get(controls::draft::Dw100Scale);\n> +       if (scale) {\n> +               vertexMap.setScale(*scale);\n> +               update = true;\n> +       }\n> +\n> +       const auto &rotation =\n> request->controls().get(controls::draft::Dw100Rotation);\n> +       if (rotation) {\n> +               vertexMap.setRotation(*rotation);\n> +               update = true;\n> +       }\n> +\n> +       const auto &offset =\n> request->controls().get(controls::draft::Dw100Offset);\n> +       if (offset) {\n> +               vertexMap.setOffset(*offset);\n> +               update = true;\n> +       }\n> +\n> +       const auto &scaleMode =\n> request->controls().get(controls::draft::Dw100ScaleMode);\n> +       if (scaleMode) {\n> +\n>  vertexMap.setMode(static_cast<Dw100VertexMap::ScaleMode>(*scaleMode));\n> +               update = true;\n> +       }\n> +\n> +       if (update || info->frame == 0) {\n> +               dewarper_->applyVertexMap(&data->mainPathStream_,\n> dewarpRequest);\n> +       }\n> +\n>         /* Handle scaler crop control. */\n>         const auto &crop = request->controls().get(controls::ScalerCrop);\n>         if (crop) {\n> @@ -1700,7 +1742,11 @@ void\n> PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n>                 }\n>         }\n>\n> -       request->metadata().set(controls::ScalerCrop, activeCrop_.value());\n> +       auto &meta = request->metadata();\n> +       meta.set(controls::draft::Dw100Scale, vertexMap.effectiveScale());\n> +       meta.set(controls::draft::Dw100Rotation, vertexMap.rotation());\n> +       meta.set(controls::draft::Dw100Offset,\n> vertexMap.effectiveOffset());\n> +       meta.set(controls::ScalerCrop, activeCrop_.value());\n>  }\n>\n>  void PipelineHandlerRkISP1::dewarpRequestReady(V4L2Request *request)\n> --\n> 2.48.1\n>\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 B6DA4BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  3 Oct 2025 14:32:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 644586B5F3;\n\tFri,  3 Oct 2025 16:32:00 +0200 (CEST)","from mail-vs1-xe2b.google.com (mail-vs1-xe2b.google.com\n\t[IPv6:2607:f8b0:4864:20::e2b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 29D3D69318\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  3 Oct 2025 16:31:58 +0200 (CEST)","by mail-vs1-xe2b.google.com with SMTP id\n\tada2fe7eead31-5521a6c6af1so150251137.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 03 Oct 2025 07:31:58 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"sq5tspeP\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1759501917; x=1760106717;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=3R2j5yDCgzRkSiBaOUVl/O43/aErfKoGiyYDW6KrM8Y=;\n\tb=sq5tspePSSA+xWZXtN1L4DKBHcRKxJjVEFaKW6wmPwKiDPbpeb9wSL9SefFAuIFGtH\n\tC/RE/J4MXnVjmONZOBNu3Vaf44KDZD5I8pUIliAkUnr92oHJII6IVo2XKV5DPxfme6++\n\tf7Tej2fnGvQt4Im/Qx6kNFd1SamdPRUwphzf3ppUckkyvyuepbrrYpHm6p3KN/BrE/WC\n\tIU2SzQiwUcF44A3M/G5P2+X9+kA4GpN+BRVx0loqIDjJ4cl6WM1RQX/AiUXV0e9EMdEj\n\tJAhoMdSFwj6Yje1TS9kVRPgpiQXxeuy+48e5/TWP3iOQ7fXIAKRFeak7tLltQZLB6bM/\n\tsvyg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1759501917; x=1760106717;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=3R2j5yDCgzRkSiBaOUVl/O43/aErfKoGiyYDW6KrM8Y=;\n\tb=MBDfkYhjhBl3qHNBiBE9ybNopWJxRiTsLhelbvbBUGJyiGLU5q7vZVVeildq9t3cLg\n\tsDsS115F2qx1pKozSNHd2sYhCeSlYWtFCCYvP/bsiDF/tdbQbwKFP45Pg+bu43wJU00u\n\ty7NoVyaRv+WTeQbwLH1FYGEnAsYCKOWCeFKejSGHz9VoKa/nf0epM/6Gyg5dG28YS/yk\n\t6uBwTTsVbYCIcVpvmI3f8QdhKSylDQtG5EoM1fQoW7Pg1/vzlDg9kVNORa1THjuxkrly\n\tNQfaoeRqo3HRJKZzOTTzeBSsod7Dq6hCWQOZBJHTnbQZfFot7GPjj1N/RhZKyHz6Gf/w\n\t098g==","X-Gm-Message-State":"AOJu0Yx3j1e7Jd2XVyEw/PglkuemcfAY4ySgx4kVjJNnLu7QsIoq/Wq/\n\tSRHpgGnJ7mqZ6KuTip0fzftMT9pffplHCyU2xZTtLIjS0XPxEIcc1D8Bid+OXHp6CJeMMV6CNB7\n\t5A6in9OghfvOlM3fiFlXN9pPs8/+7XjXw53+1Q4Bb/w==","X-Gm-Gg":"ASbGnctKY2bbYEHW21f6CQ5HRp8K6UrbNm3GXylKRUCBsnlw5HeBIk5vJik4u33pFtt\n\tjjbY/Jl7cWbNJtTf3WoXy7VTTdE7uUtAksC7EERb8jvB5Fg1XvL1H0hdy5+F2s1MliRzVsNe3js\n\t2+cQ5M8s9AKVWYQlE3BV5QJqusDOECNtp7+LnqXWFHudPAH48k5Eoe43Z6EbATs31wfcGJ4Qexr\n\t8eSa88VRzkchPUUrMA4VU6nLdAzNhgI4gUTna9Q3VdZ3meaxdtLnBRzR7yN0eg=","X-Google-Smtp-Source":"AGHT+IHOUYguO0dNauyfeoOgberWwqD5Oi8LpXY/wEvS49lvtgmeN5hz5QL2HN2WGQ7lv0UUDGpxM1boMfEb9qLXLuY=","X-Received":"by 2002:a05:6122:511a:10b0:545:eb6c:c6b5 with SMTP id\n\t71dfb90a1353d-5524e844542mr367101e0c.1.1759501916762; Fri, 03 Oct 2025\n\t07:31:56 -0700 (PDT)","MIME-Version":"1.0","References":"<20250930122726.1837524-1-stefan.klug@ideasonboard.com>\n\t<20250930122726.1837524-24-stefan.klug@ideasonboard.com>","In-Reply-To":"<20250930122726.1837524-24-stefan.klug@ideasonboard.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Fri, 3 Oct 2025 15:31:20 +0100","X-Gm-Features":"AS18NWD39jBGMxeVnP1M-j6v2awUYpJrwz4WWRdMn-7Y1tlXu2TYTS9qwacAogY","Message-ID":"<CAEmqJPpn-aarSwGqCJ=a40ar2YjDLY3in+6vxR8N2J90Dfs5sw@mail.gmail.com>","Subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"multipart/alternative; boundary=\"000000000000bb03be064041f68e\"","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":36123,"web_url":"https://patchwork.libcamera.org/comment/36123/","msgid":"<175957294462.1246375.13795296507037306662@ping.linuxembedded.co.uk>","date":"2025-10-04T10:15:44","subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck (2025-10-03 15:31:20)\n> Hi Stefan,\n> \n> Sorry for jumping in here... :)\n\nI think jumping in is always desired ;-) Thanks for reviewing!\n\n> On Tue, 30 Sept 2025 at 14:22, Stefan Klug <stefan.klug@ideasonboard.com>\n> wrote:\n> \n> > The dw100 allows more features implemented in the dw100 vertex map.\n> > Implement these features for the rkisp1 pipeline.\n> >\n> > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > ---\n> >  src/libcamera/control_ids_draft.yaml     | 39 ++++++++++++++++++-\n> >  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 48 +++++++++++++++++++++++-\n> >  2 files changed, 85 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/src/libcamera/control_ids_draft.yaml\n> > b/src/libcamera/control_ids_draft.yaml\n> > index 03309eeac34f..10ee68db6d8c 100644\n> > --- a/src/libcamera/control_ids_draft.yaml\n> > +++ b/src/libcamera/control_ids_draft.yaml\n> > @@ -206,7 +206,44 @@ controls:\n> >              available only on this camera device are at least this numeric\n> >              value. All of the custom test patterns will be static (that\n> > is the\n> >              raw image must not vary from frame to frame).\n> > -\n> > +  - Dw100ScaleMode:\n> > +      type: int32_t\n> > +      direction: inout\n> > +      description: |\n> > +        Scale mode of the dewarper.\n> > +      enum:\n> > +        - name: Fill\n> > +          value: 0\n> > +          description: |\n> > +            Fills the given output size with the largest rectangle\n> > possible.\n> > +            Aspect ratio is not preserved. Dw100Scale and Dw100Offset are\n> > +            ignored.\n> > +        - name: Crop\n> > +          value: 1\n> > +          description: |\n> > +            Crops to the given output size. The scale factor can be\n> > specified\n> > +            using Dw100Scale. Aspect ratio is preserved.\n> > +  - Dw100Scale:\n> > +      type: float\n> > +      direction: inout\n> > +      description: |\n> > +        Scale factor applied to the image when Dw100ScaleMode is set to\n> > Crop.\n> > +        This value is clamped, so that all pixels have valid input data.\n> > +        Therefore a value of 0 always provides the largest possible field\n> > of\n> > +        view.\n> >\n> \n> Couldn't the above 3 be represented by the ScalerCrop control in\n> conjunction with the stream output size?\n> \n> Also, I would suggest that perhaps these controls belong in a new\n> rksip vendor namespace.\n\nWith a dw100 prefix a namespace indeed definitely makes sense.\n\nBut if we can model this already on a ScalerCrop (or akin to that if we\nneed something extra) ...  is there a way we can model these controls\ngenerically so that it could be used by multiple platforms (or even a\nGPU based dewarper that could run on any platform which I bet would be\nfairly easy to construct once we have the GPU objects in from the\nGPUISP?).\n\nI don't think anything the DW100 is 'specific only to that exact\ninstance of hardware' ?\n\n--\nKieran","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 DCC8FC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat,  4 Oct 2025 10:15:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9C6F86B5F3;\n\tSat,  4 Oct 2025 12:15:50 +0200 (CEST)","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 23C45613AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  4 Oct 2025 12:15:48 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E8522134C;\n\tSat,  4 Oct 2025 12:14:16 +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=\"QdrBLEEB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759572857;\n\tbh=y8XPGHVpgyXrXMEhr6QmYQ5hQRYf1jURNKPqDaIdELw=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=QdrBLEEBn4qaVjaiKRKitq4bJHocr0C2ZvSey6lqjAX10ndK9i9SO5sOC/XS2bRPK\n\t1BuGrVxONVCRL9l0fYBIF4UU4hSenowaHJ041XKKgsAN9QfOek7c9fKKh11b3rZWwU\n\tfiju/lQlhufIIFIaJxkCzeBCjtth8cqAzZA1vfFc=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<CAEmqJPpn-aarSwGqCJ=a40ar2YjDLY3in+6vxR8N2J90Dfs5sw@mail.gmail.com>","References":"<20250930122726.1837524-1-stefan.klug@ideasonboard.com>\n\t<20250930122726.1837524-24-stefan.klug@ideasonboard.com>\n\t<CAEmqJPpn-aarSwGqCJ=a40ar2YjDLY3in+6vxR8N2J90Dfs5sw@mail.gmail.com>","Subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>","Date":"Sat, 04 Oct 2025 11:15:44 +0100","Message-ID":"<175957294462.1246375.13795296507037306662@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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":36129,"web_url":"https://patchwork.libcamera.org/comment/36129/","msgid":"<175973837183.3214037.14146704924382013512@localhost>","date":"2025-10-06T08:12:51","subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Kieran,\n\nQuoting Kieran Bingham (2025-10-03 16:14:43)\n> Quoting Barnabás Pőcze (2025-09-30 14:52:34)\n> > Hi\n> > \n> > 2025. 09. 30. 14:26 keltezéssel, Stefan Klug írta:\n> > > The dw100 allows more features implemented in the dw100 vertex map.\n> > > Implement these features for the rkisp1 pipeline.\n> > > \n> > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > > ---\n> > >   src/libcamera/control_ids_draft.yaml     | 39 ++++++++++++++++++-\n> > >   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 48 +++++++++++++++++++++++-\n> > >   2 files changed, 85 insertions(+), 2 deletions(-)\n> > > \n> > > diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> > > index 03309eeac34f..10ee68db6d8c 100644\n> > > --- a/src/libcamera/control_ids_draft.yaml\n> > > +++ b/src/libcamera/control_ids_draft.yaml\n> > > @@ -206,7 +206,44 @@ controls:\n> > >               available only on this camera device are at least this numeric\n> > >               value. All of the custom test patterns will be static (that is the\n> > >               raw image must not vary from frame to frame).\n> > > -\n> > > +  - Dw100ScaleMode:\n> > > +      type: int32_t\n> > > +      direction: inout\n> > > +      description: |\n> > > +        Scale mode of the dewarper.\n> > > +      enum:\n> > \n> > Wrt. https://patchwork.libcamera.org/patch/24496/ could you prefix the\n> > names of the enumerators with exactly the name of the control?\n> \n> Also - I'm really trying to push against ::draft:: and I'd like to see\n> that namespace removed ... it was a conceptual idea that just leads to a\n> dumping ground. It was also before we had vendor/namespaces for\n> controls.\n\nYes, I know. I was thinking about moving them to core before posting v1\nbut then decided against it because I expected some discussions around\nthe controls. I totally agree with you that draft doesn't help much.\n\n> \n> If you really think these should be distinguished from core controls -\n> can they go into a DW100 namespace ?\n\nThat feels a bit small for an own namespace. I'd be fine with core as\nsoon as we decided on the exact names.\n\nBest regards,\nStefan\n\n> \n> > Regards,\n> > Barnabás Pőcze\n> > \n> > \n> > > +        - name: Fill\n> > > +          value: 0\n> > > +          description: |\n> > > +            Fills the given output size with the largest rectangle possible.\n> > > +            Aspect ratio is not preserved. Dw100Scale and Dw100Offset are\n> > > +            ignored.\n> > > +        - name: Crop\n> > > +          value: 1\n> > > +          description: |\n> > > +            Crops to the given output size. The scale factor can be specified\n> > > +            using Dw100Scale. Aspect ratio is preserved.\n> > > +  - Dw100Scale:\n> > > +      type: float\n> > > +      direction: inout\n> > > +      description: |\n> > > +        Scale factor applied to the image when Dw100ScaleMode is set to Crop.\n> > > +        This value is clamped, so that all pixels have valid input data.\n> > > +        Therefore a value of 0 always provides the largest possible field of\n> > > +        view.\n> > > +  - Dw100Rotation:\n> > > +      type: float\n> > > +      direction: inout\n> > > +      description: |\n> > > +        Rotates the image by the given angle in degrees.\n> > > +  - Dw100Offset:\n> > > +      type: Point\n> > > +      direction: inout\n> > > +      description: |\n> > > +        Moves the image by the given values in x and y direction in output\n> > > +        coordinate space. This is clamped, so that all output pixels contain\n> > > +        valid data. The offset is therefore ignored when Dw100ScaleMode is set\n> > > +        to 'Fit' or the Dw100Scale value is too small.\n> > >     - FaceDetectMode:\n> > >         type: int32_t\n> > >         direction: inout\n> > > diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > index 8b78c7f213f6..740791ac9c02 100644\n> > > --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> > > @@ -1364,6 +1364,17 @@ int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)\n> > >                                                             scalerMaxCrop_);\n> > >               data->properties_.set(properties::ScalerCropMaximum, scalerMaxCrop_);\n> > >               activeCrop_ = scalerMaxCrop_;\n> > > +\n> > > +             if (dewarper_->supportsRequests()) {\n> > > +                     controls[&controls::draft::Dw100Scale] = ControlInfo(0.2f, 8.0f, 1.0f);\n> > > +                     controls[&controls::draft::Dw100Rotation] = ControlInfo(-180.0f, 180.0f, 0.0f);\n> > > +                     controls[&controls::draft::Dw100Offset] = ControlInfo(Point(-10000, -10000), Point(10000, 10000), Point(0, 0));\n> > > +                     controls[&controls::draft::Dw100ScaleMode] = ControlInfo(controls::draft::Dw100ScaleModeValues, controls::draft::Fill);\n> > > +             } else {\n> > > +                     LOG(RkISP1, Warning)\n> > > +                             << \"dw100 kernel driver has no requests support.\"\n> > > +                                \" No dynamic configuration possible.\";\n> > > +             }\n> > >       }\n> > > \n> > >       /* Add the IPA registered controls to list of camera controls. */\n> > > @@ -1637,6 +1648,37 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n> > >               availableDewarpRequests_.pop();\n> > >       }\n> > > \n> > > +     bool update = false;\n> > > +     auto &vertexMap = dewarper_->vertexMap(&data->mainPathStream_);\n> > > +\n> > > +     const auto &scale = request->controls().get(controls::draft::Dw100Scale);\n> > > +     if (scale) {\n> > > +             vertexMap.setScale(*scale);\n> > > +             update = true;\n> > > +     }\n> > > +\n> > > +     const auto &rotation = request->controls().get(controls::draft::Dw100Rotation);\n> > > +     if (rotation) {\n> > > +             vertexMap.setRotation(*rotation);\n> > > +             update = true;\n> > > +     }\n> > > +\n> > > +     const auto &offset = request->controls().get(controls::draft::Dw100Offset);\n> > > +     if (offset) {\n> > > +             vertexMap.setOffset(*offset);\n> > > +             update = true;\n> > > +     }\n> > > +\n> > > +     const auto &scaleMode = request->controls().get(controls::draft::Dw100ScaleMode);\n> > > +     if (scaleMode) {\n> > > +             vertexMap.setMode(static_cast<Dw100VertexMap::ScaleMode>(*scaleMode));\n> > > +             update = true;\n> > > +     }\n> > > +\n> > > +     if (update || info->frame == 0) {\n> > > +             dewarper_->applyVertexMap(&data->mainPathStream_, dewarpRequest);\n> > > +     }\n> > > +\n> > >       /* Handle scaler crop control. */\n> > >       const auto &crop = request->controls().get(controls::ScalerCrop);\n> > >       if (crop) {\n> > > @@ -1700,7 +1742,11 @@ void PipelineHandlerRkISP1::imageBufferReady(FrameBuffer *buffer)\n> > >               }\n> > >       }\n> > > \n> > > -     request->metadata().set(controls::ScalerCrop, activeCrop_.value());\n> > > +     auto &meta = request->metadata();\n> > > +     meta.set(controls::draft::Dw100Scale, vertexMap.effectiveScale());\n> > > +     meta.set(controls::draft::Dw100Rotation, vertexMap.rotation());\n> > > +     meta.set(controls::draft::Dw100Offset, vertexMap.effectiveOffset());\n> > > +     meta.set(controls::ScalerCrop, activeCrop_.value());\n> > >   }\n> > > \n> > >   void PipelineHandlerRkISP1::dewarpRequestReady(V4L2Request *request)\n> > > --\n> > > 2.48.1\n> > > \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 2DEAFC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Oct 2025 08:12:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BE8D76B5F3;\n\tMon,  6 Oct 2025 10:12:56 +0200 (CEST)","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 2ED4262C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Oct 2025 10:12:55 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:2e2:f331:f320:caae])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 7A34CBCA;\n\tMon,  6 Oct 2025 10:11:22 +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=\"rjMLADCT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759738282;\n\tbh=Rm31fDUoxYWGYsEAPH+bbZwETqdPmTMHRAmgEQ5pk+U=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=rjMLADCT3VnsEADQGWE2GSYaSwbLd4LI1zobulb1eFon0PSM1WO5oOfQYf5ZFvEmT\n\tpXr19VelYveTNawFN0tC6cSMLdmeOZUhdXHngwREvbtK6R3PSfRHS0DamrvAtNfSx5\n\tyJZrDUqO4A1zcUIm8Op980mb2ZFbwF6YCFsHUOkM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<175950088377.1246375.17444846667345841803@ping.linuxembedded.co.uk>","References":"<20250930122726.1837524-1-stefan.klug@ideasonboard.com>\n\t<w4B1Rvh24N5HQ_65u-_tEI7THn6ieV7z7TtOIqmKOp-9gh96ZuW8hMPlCohGul_fmwlrAOYuUYw0xnhR0O8QAw==@protonmail.internalid>\n\t<20250930122726.1837524-24-stefan.klug@ideasonboard.com>\n\t<9c878398-7983-4f96-9ea0-bd476b64b019@ideasonboard.com>\n\t<175950088377.1246375.17444846667345841803@ping.linuxembedded.co.uk>","Subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Date":"Mon, 06 Oct 2025 10:12:51 +0200","Message-ID":"<175973837183.3214037.14146704924382013512@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","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":36132,"web_url":"https://patchwork.libcamera.org/comment/36132/","msgid":"<175974142516.3214037.6904833900428401464@localhost>","date":"2025-10-06T09:03:45","subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"content":"Hi Naush, hi Kieran,\n\nQuoting Kieran Bingham (2025-10-04 12:15:44)\n> Quoting Naushir Patuck (2025-10-03 15:31:20)\n> > Hi Stefan,\n> > \n> > Sorry for jumping in here... :)\n> \n> I think jumping in is always desired ;-) Thanks for reviewing!\n\nI can only consent here. Feedback on this is very valuable.\n\n> \n> > On Tue, 30 Sept 2025 at 14:22, Stefan Klug <stefan.klug@ideasonboard.com>\n> > wrote:\n> > \n> > > The dw100 allows more features implemented in the dw100 vertex map.\n> > > Implement these features for the rkisp1 pipeline.\n> > >\n> > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > > ---\n> > >  src/libcamera/control_ids_draft.yaml     | 39 ++++++++++++++++++-\n> > >  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 48 +++++++++++++++++++++++-\n> > >  2 files changed, 85 insertions(+), 2 deletions(-)\n> > >\n> > > diff --git a/src/libcamera/control_ids_draft.yaml\n> > > b/src/libcamera/control_ids_draft.yaml\n> > > index 03309eeac34f..10ee68db6d8c 100644\n> > > --- a/src/libcamera/control_ids_draft.yaml\n> > > +++ b/src/libcamera/control_ids_draft.yaml\n> > > @@ -206,7 +206,44 @@ controls:\n> > >              available only on this camera device are at least this numeric\n> > >              value. All of the custom test patterns will be static (that\n> > > is the\n> > >              raw image must not vary from frame to frame).\n> > > -\n> > > +  - Dw100ScaleMode:\n> > > +      type: int32_t\n> > > +      direction: inout\n> > > +      description: |\n> > > +        Scale mode of the dewarper.\n> > > +      enum:\n> > > +        - name: Fill\n> > > +          value: 0\n> > > +          description: |\n> > > +            Fills the given output size with the largest rectangle\n> > > possible.\n> > > +            Aspect ratio is not preserved. Dw100Scale and Dw100Offset are\n> > > +            ignored.\n> > > +        - name: Crop\n> > > +          value: 1\n> > > +          description: |\n> > > +            Crops to the given output size. The scale factor can be\n> > > specified\n> > > +            using Dw100Scale. Aspect ratio is preserved.\n> > > +  - Dw100Scale:\n> > > +      type: float\n> > > +      direction: inout\n> > > +      description: |\n> > > +        Scale factor applied to the image when Dw100ScaleMode is set to\n> > > Crop.\n> > > +        This value is clamped, so that all pixels have valid input data.\n> > > +        Therefore a value of 0 always provides the largest possible field\n> > > of\n> > > +        view.\n> > >\n> > \n> > Couldn't the above 3 be represented by the ScalerCrop control in\n> > conjunction with the stream output size?\n\nThe problem here is that ScalerCrop is in integer values. We gave it a\ntry to use it for digital zoom and you see the rounding artifacts while\nzooming. The center of the image jumps around visibly.\n\nThat could be improved by making ScalerCrop use float rectangles which we\ndon't have and which would have a larger impact on libcamera.\n\nThe other issue is that ScalerCrop doesn't carry any rotation\ninformation. So from a theoretical point I'd like to model a mostly\ncomplete 2D transformation matrix. That is (translate(x,y), rotate,\nscale(x,y) and shear(x,y)) For the sake of usability I dropped shear and\nmade scale a single value.\n\nBy applying that transformation matrix after the ScalerCrop, ScalerCrop\nis still fully functional but we can have more control \"on top\".\n\n> > \n> > Also, I would suggest that perhaps these controls belong in a new\n> > rksip vendor namespace.\n> \n> With a dw100 prefix a namespace indeed definitely makes sense.\n> \n> But if we can model this already on a ScalerCrop (or akin to that if we\n> need something extra) ...  is there a way we can model these controls\n> generically so that it could be used by multiple platforms (or even a\n> GPU based dewarper that could run on any platform which I bet would be\n> fairly easy to construct once we have the GPU objects in from the\n> GPUISP?).\n\nAs noted above, the most generic would be a 2x3 matrix (the upper rows\nof the 2D transform\nhttps://graphicmaths.com/pure/matrices/matrix-2d-transformations/ ).\nBut using a matrix from a user point of view is a nightmare. So I\nthought rotation + scale + translate all around the center of the image\nmakes it pretty easy to use. So I think the controls are already\ngeneric. For upcoming usecases we can easily add shear (x,y) which\ndefaults to 0 so that it is backwards compatible. To add the second\nscale in a backwards compatible way, I'd define a Dw100ScalingRatio.\n\nSo that:\nscale_x = Dw100Scale\nscale_y = Dw100ScalingRatio * Dw100Scale\n\nThis way we can keep the simple \"one scale value\" interface while\nallowing more complex usecases with the additional ratio.\n\nAll this is quite generic and could already be implemented using a GPU.\n\nWhat about naming the controls in a generic way?\nMy proposal:\nTransformFillMode (fits the function better than ScaleMode)\nTransformScale\nTransformRotation\nTranformOffset (maybe this should be named TransformTranslation)\nlater:\nTransformShear\nTransformScaleRatio\n\nBest regards,\nStefan\n\n> \n> I don't think anything the DW100 is 'specific only to that exact\n> instance of hardware' ?\n> \n> --\n> Kieran","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 22124C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Oct 2025 09:03:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 391F26B5F3;\n\tMon,  6 Oct 2025 11:03:50 +0200 (CEST)","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 5513862C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Oct 2025 11:03:48 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:2e2:f331:f320:caae])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 86D7F1741; \n\tMon,  6 Oct 2025 11:02:15 +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=\"mf9e1mVY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1759741335;\n\tbh=r7eJ+G2A0OPNT+PIUiZ6/wXJU0r+cDkbAfuLAqRMfU4=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=mf9e1mVYGglz9NhvSlJUUaivWnMIpHTkexiMk4bKZLDV4MPGJuhhzm/P8hzs3no3t\n\taSxh85pJZDe4KMa4RHhsCyWu5dKparNaqjqKUPNBfyjTiG/uPgUBRehj+mn4Pvudey\n\tlSIyjtxA9sITUEfKMveFmvpZn3XdIZOPMtBYG5uI=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<175957294462.1246375.13795296507037306662@ping.linuxembedded.co.uk>","References":"<20250930122726.1837524-1-stefan.klug@ideasonboard.com>\n\t<20250930122726.1837524-24-stefan.klug@ideasonboard.com>\n\t<CAEmqJPpn-aarSwGqCJ=a40ar2YjDLY3in+6vxR8N2J90Dfs5sw@mail.gmail.com>\n\t<175957294462.1246375.13795296507037306662@ping.linuxembedded.co.uk>","Subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","From":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","Date":"Mon, 06 Oct 2025 11:03:45 +0200","Message-ID":"<175974142516.3214037.6904833900428401464@localhost>","User-Agent":"alot/0.12.dev8+g2c003385c862.d20250602","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":36139,"web_url":"https://patchwork.libcamera.org/comment/36139/","msgid":"<CAEmqJPoSQXqK9aBURuGiSnS83MjRMA-BF6XEb121CjD1RUC=YA@mail.gmail.com>","date":"2025-10-06T09:54:08","subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Stefan,\n\nOn Mon, 6 Oct 2025 at 10:03, Stefan Klug <stefan.klug@ideasonboard.com> wrote:\n>\n> Hi Naush, hi Kieran,\n>\n> Quoting Kieran Bingham (2025-10-04 12:15:44)\n> > Quoting Naushir Patuck (2025-10-03 15:31:20)\n> > > Hi Stefan,\n> > >\n> > > Sorry for jumping in here... :)\n> >\n> > I think jumping in is always desired ;-) Thanks for reviewing!\n>\n> I can only consent here. Feedback on this is very valuable.\n>\n> >\n> > > On Tue, 30 Sept 2025 at 14:22, Stefan Klug <stefan.klug@ideasonboard.com>\n> > > wrote:\n> > >\n> > > > The dw100 allows more features implemented in the dw100 vertex map.\n> > > > Implement these features for the rkisp1 pipeline.\n> > > >\n> > > > Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> > > > ---\n> > > >  src/libcamera/control_ids_draft.yaml     | 39 ++++++++++++++++++-\n> > > >  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 48 +++++++++++++++++++++++-\n> > > >  2 files changed, 85 insertions(+), 2 deletions(-)\n> > > >\n> > > > diff --git a/src/libcamera/control_ids_draft.yaml\n> > > > b/src/libcamera/control_ids_draft.yaml\n> > > > index 03309eeac34f..10ee68db6d8c 100644\n> > > > --- a/src/libcamera/control_ids_draft.yaml\n> > > > +++ b/src/libcamera/control_ids_draft.yaml\n> > > > @@ -206,7 +206,44 @@ controls:\n> > > >              available only on this camera device are at least this numeric\n> > > >              value. All of the custom test patterns will be static (that\n> > > > is the\n> > > >              raw image must not vary from frame to frame).\n> > > > -\n> > > > +  - Dw100ScaleMode:\n> > > > +      type: int32_t\n> > > > +      direction: inout\n> > > > +      description: |\n> > > > +        Scale mode of the dewarper.\n> > > > +      enum:\n> > > > +        - name: Fill\n> > > > +          value: 0\n> > > > +          description: |\n> > > > +            Fills the given output size with the largest rectangle\n> > > > possible.\n> > > > +            Aspect ratio is not preserved. Dw100Scale and Dw100Offset are\n> > > > +            ignored.\n> > > > +        - name: Crop\n> > > > +          value: 1\n> > > > +          description: |\n> > > > +            Crops to the given output size. The scale factor can be\n> > > > specified\n> > > > +            using Dw100Scale. Aspect ratio is preserved.\n> > > > +  - Dw100Scale:\n> > > > +      type: float\n> > > > +      direction: inout\n> > > > +      description: |\n> > > > +        Scale factor applied to the image when Dw100ScaleMode is set to\n> > > > Crop.\n> > > > +        This value is clamped, so that all pixels have valid input data.\n> > > > +        Therefore a value of 0 always provides the largest possible field\n> > > > of\n> > > > +        view.\n> > > >\n> > >\n> > > Couldn't the above 3 be represented by the ScalerCrop control in\n> > > conjunction with the stream output size?\n>\n> The problem here is that ScalerCrop is in integer values. We gave it a\n> try to use it for digital zoom and you see the rounding artifacts while\n> zooming. The center of the image jumps around visibly.\n\n\nThis surprises me a bit.  We perform smooth(ish) zoom with integer\nprecision in single pixel steps without issue.  Could it be some other\ncalculation rounding artefact?\n\n>\n>\n> That could be improved by making ScalerCrop use float rectangles which we\n> don't have and which would have a larger impact on libcamera.\n\n\nI'm fine with changing this if folks agree it's the right thing.\n\n>\n>\n> The other issue is that ScalerCrop doesn't carry any rotation\n> information. So from a theoretical point I'd like to model a mostly\n> complete 2D transformation matrix. That is (translate(x,y), rotate,\n> scale(x,y) and shear(x,y)) For the sake of usability I dropped shear and\n> made scale a single value.\n>\n> By applying that transformation matrix after the ScalerCrop, ScalerCrop\n> is still fully functional but we can have more control \"on top\".\n\nYes, ScalerCrop will have to be complemented with an additional\ncontrol for rotation to be specified.  However, I think that's a\nbetter approach (if workable of course) than adding more controls with\nsimilar behavior to existing ones.\n\nRegards,\nNaush\n\n>\n>\n> > >\n> > > Also, I would suggest that perhaps these controls belong in a new\n> > > rksip vendor namespace.\n> >\n> > With a dw100 prefix a namespace indeed definitely makes sense.\n> >\n> > But if we can model this already on a ScalerCrop (or akin to that if we\n> > need something extra) ...  is there a way we can model these controls\n> > generically so that it could be used by multiple platforms (or even a\n> > GPU based dewarper that could run on any platform which I bet would be\n> > fairly easy to construct once we have the GPU objects in from the\n> > GPUISP?).\n>\n> As noted above, the most generic would be a 2x3 matrix (the upper rows\n> of the 2D transform\n> https://graphicmaths.com/pure/matrices/matrix-2d-transformations/ ).\n> But using a matrix from a user point of view is a nightmare. So I\n> thought rotation + scale + translate all around the center of the image\n> makes it pretty easy to use. So I think the controls are already\n> generic. For upcoming usecases we can easily add shear (x,y) which\n> defaults to 0 so that it is backwards compatible. To add the second\n> scale in a backwards compatible way, I'd define a Dw100ScalingRatio.\n>\n> So that:\n> scale_x = Dw100Scale\n> scale_y = Dw100ScalingRatio * Dw100Scale\n>\n> This way we can keep the simple \"one scale value\" interface while\n> allowing more complex usecases with the additional ratio.\n>\n> All this is quite generic and could already be implemented using a GPU.\n>\n> What about naming the controls in a generic way?\n> My proposal:\n> TransformFillMode (fits the function better than ScaleMode)\n> TransformScale\n> TransformRotation\n> TranformOffset (maybe this should be named TransformTranslation)\n> later:\n> TransformShear\n> TransformScaleRatio\n>\n> Best regards,\n> Stefan\n>\n> >\n> > I don't think anything the DW100 is 'specific only to that exact\n> > instance of hardware' ?\n> >\n> > --\n> > Kieran","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 8C2C1BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  6 Oct 2025 09:54:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1E89B6B5F9;\n\tMon,  6 Oct 2025 11:54:45 +0200 (CEST)","from mail-vk1-xa36.google.com (mail-vk1-xa36.google.com\n\t[IPv6:2607:f8b0:4864:20::a36])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4BD1A62C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  6 Oct 2025 11:54:42 +0200 (CEST)","by mail-vk1-xa36.google.com with SMTP id\n\t71dfb90a1353d-54a9852eb65so219445e0c.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 06 Oct 2025 02:54:42 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"h6fbrnuw\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1759744481; x=1760349281;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=rukzbv05ymHxAuyFm9O/vSzvr9YAogP30KEh10N70gI=;\n\tb=h6fbrnuwLZlMwLf9+hEczEwSrmiiJfFJuZn8EyvcOYSdqIqlA1b6O+OlHxxmd3D+K+\n\tFanR0ggeKw//Cw+8OrilFAcqkHMyWgXqtenVnF8vm5OxoRUQbgfWACg+BkB+nE7igPTa\n\t/wtJnXUvZD9dAhBUUjNooYO862AN/GzlGQmxw22KtlAsDKj0dUyiX9ftvXX5i0iwYRL6\n\tDkB06tFh/C0YkZ3pwgoJeHMhKpnH77nth0BZQdKWygnxhmEk8PP02S04yZ8Jlv5xnoDI\n\tgO9qlu8ojlJBQmYUkW2tmCSVLBX3W2QyE8zHFhTCBgtxTG2kt6VZwsEipixfsb3KMjS5\n\tYC2Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1759744481; x=1760349281;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=rukzbv05ymHxAuyFm9O/vSzvr9YAogP30KEh10N70gI=;\n\tb=SEd36elZUWZW0fkkqNsqz1tmbWDE1ut29XPmGD+Uj1aBFXSO/JKlM4+7QPln9FWbl8\n\tbo0bmDHwSFxZG7Dz4XWU2GK1OHq4qfEB5ZKMpZrxIXlyNi9ziOEQD8c9kQKYFt982vCF\n\tu8dvn8uGIBSnu4EfyKLrTxy/PQDxcqr5XkWh2o7WMHlL0JrNOcwx3xMfKPkpP0t8reBl\n\tbTegSRE+hhYZYHFQhxahDMwjg+UG376i0elSGuqhb0rqJfTTCtLuwz5IexXGnqQPkUHR\n\tj9vrx53h9s4b/x9I9gr8g4QnrcaIhb9u6qNS2l55uvX9FV4fXRSL/Mv8z1fWblZUuqKx\n\tGZ9A==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCWoAZIZou6TTtwQ5Lqo5N4zd8bnzBnFKmsw7ge21fUlWvHBOlvMsEet6hAMF++VWAZxFyB6ljK7PtmwlGfp28c=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YxBmFJh3ZrEJ3V7rpHoWGQl0s4W5GAO9Nda6c+bvbwkA0WFSmhY\n\t27/QhP/TB0c27IkKy/rHTYkKeWjPVxa2sITqs5ftmCcDJUo3hTDuIU/8vKM+VL/Ju8Bw3pSZHhF\n\tpTNbH4y7nxFaXW6gIhaf/H8A7LOtZxoHxGcwwNC5T/tWJWus4Ge26","X-Gm-Gg":"ASbGncvHWMv+9auCqJ0yT0h3qOO8e2A75nRj1c8D9OM9p2Sz4BknEF2QjYXNHk4nlxa\n\tuCUvP+uQbzSNAhSQHxUYi5y0i0MwDkQHBdM4SgoGZ3JcjMC15AsfAirZ3DcwfRsymD2e4Wrn2Rm\n\tkIQwEjwz2BPwWBV58AVAbHnS4EQrvyOY/s0qfQZv/LS7Wbj69QMqI94GqOPCsaa9GPW3ZGJlxTP\n\tor6MxMdXIflBoui86mnjVGUO7danDbeaIcPK5vWtTXOU+cv06NoLsg/96aSKOv0C0Vj629VkQ==","X-Google-Smtp-Source":"AGHT+IHXQDZGXnL/kcecz6JVhJnOUp5rT/p2wACJ885MGrNX+DBKXJax24ex3YA8aP6x9JUdxcS7A8qQqSKcvTtWEiw=","X-Received":"by 2002:a05:6122:2ac2:b0:53b:34d9:6af1 with SMTP id\n\t71dfb90a1353d-5524e84a43amr1122090e0c.1.1759744480966;\n\tMon, 06 Oct 2025 02:54:40 -0700 (PDT)","MIME-Version":"1.0","References":"<20250930122726.1837524-1-stefan.klug@ideasonboard.com>\n\t<20250930122726.1837524-24-stefan.klug@ideasonboard.com>\n\t<CAEmqJPpn-aarSwGqCJ=a40ar2YjDLY3in+6vxR8N2J90Dfs5sw@mail.gmail.com>\n\t<175957294462.1246375.13795296507037306662@ping.linuxembedded.co.uk>\n\t<175974142516.3214037.6904833900428401464@localhost>","In-Reply-To":"<175974142516.3214037.6904833900428401464@localhost>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Mon, 6 Oct 2025 10:54:08 +0100","X-Gm-Features":"AS18NWD2txI3bkN95PmWcmXOBX4wi1bpuWE_TxVxtc7aHg2Hn1M6v7iJFy2RBBM","Message-ID":"<CAEmqJPoSQXqK9aBURuGiSnS83MjRMA-BF6XEb121CjD1RUC=YA@mail.gmail.com>","Subject":"Re: [PATCH v1 23/33] libcamera: rkisp1: Implement dw100 specific\n\tfeatures","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","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>"}}]