[{"id":26366,"web_url":"https://patchwork.libcamera.org/comment/26366/","msgid":"<167507414760.42371.2109424748210226938@Monstersaurus>","date":"2023-01-30T10:22:27","subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: rkisp1: Add support\n\tfor Transform","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Jacopo,\n\nQuoting Jacopo Mondi via libcamera-devel (2023-01-14 19:47:11)\n> Add support for Transform to the RkISP1 pipeline handler.\n> \n> The pipeline rotates using the sensor's V/H flips, hence use the\n> CameraSensor helpers to handle transformation requests from\n> applications.\n> \n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 16 +++++++++++-----\n>  1 file changed, 11 insertions(+), 5 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index c27b3ef9bd8e..b81ad647be79 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -23,6 +23,10 @@\n>  #include <libcamera/control_ids.h>\n>  #include <libcamera/formats.h>\n>  #include <libcamera/framebuffer.h>\n> +#include <libcamera/request.h>\n> +#include <libcamera/stream.h>\n> +#include <libcamera/transform.h>\n> +\n>  #include <libcamera/ipa/core_ipa_interface.h>\n>  #include <libcamera/ipa/rkisp1_ipa_interface.h>\n>  #include <libcamera/ipa/rkisp1_ipa_proxy.h>\n> @@ -469,17 +473,17 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n>  \n>         status = validateColorSpaces(ColorSpaceFlag::StreamsShareColorSpace);\n>  \n> -       if (transform != Transform::Identity) {\n> -               transform = Transform::Identity;\n> -               status = Adjusted;\n> -       }\n> -\n>         /* Cap the number of entries to the available streams. */\n>         if (config_.size() > pathCount) {\n>                 config_.resize(pathCount);\n>                 status = Adjusted;\n>         }\n>  \n> +       Transform requestedTransform = transform;\n> +       Transform combined = sensor->validateTransform(&transform);\n> +       if (transform != requestedTransform)\n> +               status = Adjusted;\n> +\n\nI'm so tempted to look into how we could mock up devices so we can\n'fake' devices to libcamera pipeline handlers. Things like this almost\nwarrant having tests set up to validate every orientation of a sensor,\nagainst every orientation asked for by an application...\n\nMaybe one to add to the GSoC list. But Laurent isn't convinced.\n\nAnyway, in the absence of being able to test this otherwise:\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>         /*\n>          * Simultaneous capture of raw and processed streams isn't possible. If\n>          * there is any raw stream, cap the number of streams to one.\n> @@ -589,6 +593,8 @@ CameraConfiguration::Status RkISP1CameraConfiguration::validate()\n>         if (sensorFormat_.size.isNull())\n>                 sensorFormat_.size = sensor->resolution();\n>  \n> +       sensorFormat_.transform = combined;\n> +\n>         return status;\n>  }\n>  \n> -- \n> 2.39.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 8C525BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 30 Jan 2023 10:22:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D2F78625E4;\n\tMon, 30 Jan 2023 11:22:32 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2376861506\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 30 Jan 2023 11:22:31 +0100 (CET)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 92785D6;\n\tMon, 30 Jan 2023 11:22:30 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1675074152;\n\tbh=1VTTUh1lEPbkHfvQfpZlIWTsmg2tWyj3t1v+vidUsZk=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=dWpe5psLRfTApEwtUFqGJAf7FgH9Wmj9+Pjtdx4ZPM16x/PpTZldP2+Cl6tnAa5Pu\n\t2jBdTjhTRs8jhnprk4MeaqAyTy8hn5/E2LvPPnlMHIPqbsrKJgXzzU7TXeXT25leuA\n\t+8Nr7hsubCvhcC9SPeSSL4GNoaWGLxMtE2HPAABiC5Et+st06dEK1H1xXwpr1i3zx1\n\tZtqjTQC4gZVDNeIcGfNbtwG7XjZ6kA3fedIc+Y4KG83U6umO4spaYww8EDHvisaRnl\n\tOglhBkVi4uquaeZSp90Zx8u+6DHMvYk2W7aD8cBjgoeDNbK9kkAcmoQnLDwFJGBMpQ\n\tEKQoqM6JrdKxw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1675074150;\n\tbh=1VTTUh1lEPbkHfvQfpZlIWTsmg2tWyj3t1v+vidUsZk=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=XXrk3yUn7m93SXiBuyeOq2NBgOM2HknT4u7ilvkbmBoubDlAUwy9JtfrR/FG4/aXo\n\tZPLlvNSw5FgJqP7TcM0pu/Ry/tJtwmCB5ZTHO2PlTC2fj42DzeChHc0LTAbWD/Bn/+\n\tC1NkLzefaR6WM/v7wzLthIK1oFuXMzA0E2+CMCuY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"XXrk3yUn\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230114194712.23272-5-jacopo.mondi@ideasonboard.com>","References":"<20230114194712.23272-1-jacopo.mondi@ideasonboard.com>\n\t<20230114194712.23272-5-jacopo.mondi@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 30 Jan 2023 10:22:27 +0000","Message-ID":"<167507414760.42371.2109424748210226938@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v2 4/5] libcamera: rkisp1: Add support\n\tfor Transform","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]