[{"id":39006,"web_url":"https://patchwork.libcamera.org/comment/39006/","msgid":"<178059850801.1119811.15832172632984956671@ping.linuxembedded.co.uk>","date":"2026-06-04T18:41:48","subject":"Re: [RFC PATCH v3 04/17] libcamera: software_isp: Separate\n\tallocation of the parameters buffer","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Milan Zamazal (2026-06-04 10:50:48)\n> There will be some additions to that code in followup patches and let's\n> not blow the code in SoftwareIsp constructor even more.\n> \n\nI'm not sure we would normally put code into a function if it performs\none thing and is only used once, but maybe it helps later, so I'll\nalready tentatively put this here as I don't think it harms anything but\nI'm not sure if it's essential yet:\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>  .../internal/software_isp/software_isp.h        |  1 +\n>  src/libcamera/software_isp/software_isp.cpp     | 17 ++++++++++++-----\n>  2 files changed, 13 insertions(+), 5 deletions(-)\n> \n> diff --git a/include/libcamera/internal/software_isp/software_isp.h b/include/libcamera/internal/software_isp/software_isp.h\n> index 85c9059e2..f97d25f0a 100644\n> --- a/include/libcamera/internal/software_isp/software_isp.h\n> +++ b/include/libcamera/internal/software_isp/software_isp.h\n> @@ -90,6 +90,7 @@ public:\n>  private:\n>         void saveIspParams(const uint32_t paramsBufferId);\n>         void paramsBufferReady(const uint32_t paramsBufferId);\n> +       bool allocateParamsBuffers();\n>         void setSensorCtrls(const ControlList &sensorControls);\n>         void statsReady(uint32_t frame, uint32_t bufferId);\n>         void inputReady(FrameBuffer *input);\n> diff --git a/src/libcamera/software_isp/software_isp.cpp b/src/libcamera/software_isp/software_isp.cpp\n> index 3d1dec21d..5dca10aee 100644\n> --- a/src/libcamera/software_isp/software_isp.cpp\n> +++ b/src/libcamera/software_isp/software_isp.cpp\n> @@ -90,12 +90,8 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,\n>                 LOG(SoftwareIsp, Error) << \"Failed to create DmaBufAllocator object\";\n>                 return;\n>         }\n> -\n> -       sharedParams_ = SharedMemObject<DebayerParams>(\"softIsp_params\");\n> -       if (!sharedParams_) {\n> -               LOG(SoftwareIsp, Error) << \"Failed to create shared memory for parameters\";\n> +       if (!allocateParamsBuffers())\n>                 return;\n> -       }\n>  \n>         const CameraManager &cm = *pipe->cameraManager();\n>  \n> @@ -181,6 +177,17 @@ SoftwareIsp::~SoftwareIsp()\n>         debayer_.reset();\n>  }\n>  \n> +bool SoftwareIsp::allocateParamsBuffers()\n> +{\n> +       sharedParams_ = SharedMemObject<DebayerParams>(\"softIsp_params\");\n> +       if (!sharedParams_) {\n> +               LOG(SoftwareIsp, Error) << \"Failed to create shared memory for parameters\";\n> +               return false;\n> +       }\n> +\n> +       return true;\n> +}\n> +\n>  /**\n>   * \\fn int SoftwareIsp::loadConfiguration([[maybe_unused]] const std::string &filename)\n>   * \\brief Load a configuration from a file\n> -- \n> 2.54.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 883BAC328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Jun 2026 18:41:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DF2356344D;\n\tThu,  4 Jun 2026 20:41:52 +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 EF0E462DC4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Jun 2026 20:41:50 +0200 (CEST)","from monstersaurus.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 F22C313D7;\n\tThu,  4 Jun 2026 20:41:25 +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=\"tnTkyHKO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1780598486;\n\tbh=lX0u3kis11q/Jcn2f647ZqgVgXZ8ZHquGkeqzgmfVF4=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=tnTkyHKOuQmL4a4SLLxj2N3kB0ZuzIAzabGyLnZwUY3HtS2bOJutmxkSwpevf7PHj\n\tC614s/rLXF4FK914BiaOha2E7l0WgoXw7s+taP2x/+OiwE7QHv7htBEocTSsq86R7m\n\tkRtW2KnYEcn+Oi2b0OyHPv3SQUgoJDI1KFhr/jrk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20260604095105.68798-7-mzamazal@redhat.com>","References":"<20260604095105.68798-1-mzamazal@redhat.com>\n\t<20260604095105.68798-7-mzamazal@redhat.com>","Subject":"Re: [RFC PATCH v3 04/17] libcamera: software_isp: Separate\n\tallocation of the parameters buffer","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>, =?utf-8?b?QmFybmFiw6FzIFDFkWN6?=\n\t=?utf-8?q?e?= <barnabas.pocze@ideasonboard.com>,\n\tjohannes.goede@oss.qualcomm.com","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Thu, 04 Jun 2026 19:41:48 +0100","Message-ID":"<178059850801.1119811.15832172632984956671@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>"}}]