[{"id":30331,"web_url":"https://patchwork.libcamera.org/comment/30331/","msgid":"<y7xecdhk4muncoprwhpf2ac3466ioppyncfcvrwmwjeiyghobf@ee6j4vj637sx>","date":"2024-07-04T13:38:00","subject":"Re: [PATCH v1 10/11] ipa: rkisp1: Add compand feature flag to ipa\n\tcontext","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Laurent\n\nOn Thu, Jul 04, 2024 at 01:52:29AM GMT, Laurent Pinchart wrote:\n> From: Paul Elder <paul.elder@ideasonboard.com>\n>\n> Add a compand feature flag to the hardware settings section of the IPA\n> context, so that we can act accordingly for black level subtraction, and\n> to pave the way to skipping companding appropriately when support for it\n> is added.\n>\n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  src/ipa/rkisp1/ipa_context.h |  1 +\n>  src/ipa/rkisp1/rkisp1.cpp    | 14 +++++++++++++-\n>  2 files changed, 14 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index 1d0e9030af1c..f5503ada7d8b 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -31,6 +31,7 @@ struct IPAHwSettings {\n>  \tunsigned int numHistogramBins;\n>  \tunsigned int numHistogramWeights;\n>  \tunsigned int numGammaOutSamples;\n> +\tbool compand;\n\nnot thrilled by a boolean. If other ISP blocks will have to be\nsupported per-platform this will need to be made a 'feature', like\nit's been done on the Linux side.\n\nIf you prefer, it could be done on top.\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\n>  };\n>\n>  struct IPASessionConfiguration {\n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 1a89eabf10b4..083d5b08caff 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -93,6 +93,15 @@ const IPAHwSettings ipaHwSettingsV10{\n>  \tRKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,\n>  \tRKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,\n>  \tRKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,\n> +\tfalse,\n> +};\n> +\n> +const IPAHwSettings ipaHwSettingsIMX8MP{\n> +\tRKISP1_CIF_ISP_AE_MEAN_MAX_V10,\n> +\tRKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,\n> +\tRKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,\n> +\tRKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,\n> +\ttrue,\n>  };\n>\n>  const IPAHwSettings ipaHwSettingsV12{\n> @@ -100,6 +109,7 @@ const IPAHwSettings ipaHwSettingsV12{\n>  \tRKISP1_CIF_ISP_HIST_BIN_N_MAX_V12,\n>  \tRKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12,\n>  \tRKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12,\n> +\tfalse,\n>  };\n>\n>  /* List of controls handled by the RkISP1 IPA */\n> @@ -130,9 +140,11 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,\n>  \t/* \\todo Add support for other revisions */\n>  \tswitch (hwRevision) {\n>  \tcase RKISP1_V10:\n> -\tcase RKISP1_V_IMX8MP:\n>  \t\tcontext_.hw = &ipaHwSettingsV10;\n>  \t\tbreak;\n> +\tcase RKISP1_V_IMX8MP:\n> +\t\tcontext_.hw = &ipaHwSettingsIMX8MP;\n> +\t\tbreak;\n>  \tcase RKISP1_V12:\n>  \t\tcontext_.hw = &ipaHwSettingsV12;\n>  \t\tbreak;\n> --\n> Regards,\n>\n> Laurent Pinchart\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 D9FD8BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Jul 2024 13:38:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B4AD062E23;\n\tThu,  4 Jul 2024 15:38:05 +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 A2BF0619C8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jul 2024 15:38:03 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7893D63D;\n\tThu,  4 Jul 2024 15:37:34 +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=\"LDb3znRG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1720100254;\n\tbh=Ne6lji0TbyyFgMYjBfgHweqtAv8nEpRS5Okuc1FREMs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=LDb3znRGAmMb6pMLx5YZbE5RUr26upQMfLmjOVeCzwRDIjNbQmGUbcr5eyOJYnEdo\n\tIU9unZJlVGU02pCqeWTOYXRrmL54w2UH1Zc6EZYXXlPzShUhKo0y6l1etkc7MuSV0y\n\tJYcgDzODMCJduOiEaMzd0OvqFQGtKCsjzGQ2isPw=","Date":"Thu, 4 Jul 2024 15:38:00 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v1 10/11] ipa: rkisp1: Add compand feature flag to ipa\n\tcontext","Message-ID":"<y7xecdhk4muncoprwhpf2ac3466ioppyncfcvrwmwjeiyghobf@ee6j4vj637sx>","References":"<20240703225230.3530-1-laurent.pinchart@ideasonboard.com>\n\t<20240703225230.3530-11-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240703225230.3530-11-laurent.pinchart@ideasonboard.com>","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":30334,"web_url":"https://patchwork.libcamera.org/comment/30334/","msgid":"<20240704135101.GA24184@pendragon.ideasonboard.com>","date":"2024-07-04T13:51:01","subject":"Re: [PATCH v1 10/11] ipa: rkisp1: Add compand feature flag to ipa\n\tcontext","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Jul 04, 2024 at 03:38:00PM +0200, Jacopo Mondi wrote:\n> On Thu, Jul 04, 2024 at 01:52:29AM GMT, Laurent Pinchart wrote:\n> > From: Paul Elder <paul.elder@ideasonboard.com>\n> >\n> > Add a compand feature flag to the hardware settings section of the IPA\n> > context, so that we can act accordingly for black level subtraction, and\n> > to pave the way to skipping companding appropriately when support for it\n> > is added.\n> >\n> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> > ---\n> >  src/ipa/rkisp1/ipa_context.h |  1 +\n> >  src/ipa/rkisp1/rkisp1.cpp    | 14 +++++++++++++-\n> >  2 files changed, 14 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> > index 1d0e9030af1c..f5503ada7d8b 100644\n> > --- a/src/ipa/rkisp1/ipa_context.h\n> > +++ b/src/ipa/rkisp1/ipa_context.h\n> > @@ -31,6 +31,7 @@ struct IPAHwSettings {\n> >  \tunsigned int numHistogramBins;\n> >  \tunsigned int numHistogramWeights;\n> >  \tunsigned int numGammaOutSamples;\n> > +\tbool compand;\n> \n> not thrilled by a boolean. If other ISP blocks will have to be\n> supported per-platform this will need to be made a 'feature', like\n> it's been done on the Linux side.\n> \n> If you prefer, it could be done on top.\n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nI'd prefer doing it on top indeed, when we'll have more visibility.\n\n> >  };\n> >\n> >  struct IPASessionConfiguration {\n> > diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> > index 1a89eabf10b4..083d5b08caff 100644\n> > --- a/src/ipa/rkisp1/rkisp1.cpp\n> > +++ b/src/ipa/rkisp1/rkisp1.cpp\n> > @@ -93,6 +93,15 @@ const IPAHwSettings ipaHwSettingsV10{\n> >  \tRKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,\n> >  \tRKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,\n> >  \tRKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,\n> > +\tfalse,\n> > +};\n> > +\n> > +const IPAHwSettings ipaHwSettingsIMX8MP{\n> > +\tRKISP1_CIF_ISP_AE_MEAN_MAX_V10,\n> > +\tRKISP1_CIF_ISP_HIST_BIN_N_MAX_V10,\n> > +\tRKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V10,\n> > +\tRKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V10,\n> > +\ttrue,\n> >  };\n> >\n> >  const IPAHwSettings ipaHwSettingsV12{\n> > @@ -100,6 +109,7 @@ const IPAHwSettings ipaHwSettingsV12{\n> >  \tRKISP1_CIF_ISP_HIST_BIN_N_MAX_V12,\n> >  \tRKISP1_CIF_ISP_HISTOGRAM_WEIGHT_GRIDS_SIZE_V12,\n> >  \tRKISP1_CIF_ISP_GAMMA_OUT_MAX_SAMPLES_V12,\n> > +\tfalse,\n> >  };\n> >\n> >  /* List of controls handled by the RkISP1 IPA */\n> > @@ -130,9 +140,11 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,\n> >  \t/* \\todo Add support for other revisions */\n> >  \tswitch (hwRevision) {\n> >  \tcase RKISP1_V10:\n> > -\tcase RKISP1_V_IMX8MP:\n> >  \t\tcontext_.hw = &ipaHwSettingsV10;\n> >  \t\tbreak;\n> > +\tcase RKISP1_V_IMX8MP:\n> > +\t\tcontext_.hw = &ipaHwSettingsIMX8MP;\n> > +\t\tbreak;\n> >  \tcase RKISP1_V12:\n> >  \t\tcontext_.hw = &ipaHwSettingsV12;\n> >  \t\tbreak;","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 02EF4BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Jul 2024 13:51:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E479962E17;\n\tThu,  4 Jul 2024 15:51:24 +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 CF5EE619C8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jul 2024 15:51:22 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C7AF4502;\n\tThu,  4 Jul 2024 15:50:53 +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=\"qUGaFC+6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1720101053;\n\tbh=UcE7LZ9Q3P81wPcrpcMPYM8f8cSyiBCFmC/gjjvUwc0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=qUGaFC+6BjGZTFAI5eWYkvQTtpgEDvxJ6msZFyUwF61RYtazPX3/dGeoA/SJ1p9ac\n\tozA/OWJmBIzXLjE7YiZch677RO8iUwONhilpO2ibzdJvYJlyfMAZSiqGmnA44Ms7pB\n\tNik4+9tLrV4YLsXN7dtOGmzoHnzolZeEzNAjI9Bk=","Date":"Thu, 4 Jul 2024 16:51:01 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tPaul Elder <paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v1 10/11] ipa: rkisp1: Add compand feature flag to ipa\n\tcontext","Message-ID":"<20240704135101.GA24184@pendragon.ideasonboard.com>","References":"<20240703225230.3530-1-laurent.pinchart@ideasonboard.com>\n\t<20240703225230.3530-11-laurent.pinchart@ideasonboard.com>\n\t<y7xecdhk4muncoprwhpf2ac3466ioppyncfcvrwmwjeiyghobf@ee6j4vj637sx>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<y7xecdhk4muncoprwhpf2ac3466ioppyncfcvrwmwjeiyghobf@ee6j4vj637sx>","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>"}}]