[{"id":33940,"web_url":"https://patchwork.libcamera.org/comment/33940/","msgid":"<174456675557.3333606.10559004072268281898@ping.linuxembedded.co.uk>","date":"2025-04-13T17:52:35","subject":"Re: [PATCH v2 6/9] pipeline: rkisp1: Add more info when parameter\n\tqueue fails","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stefan Klug (2025-04-11 13:36:34)\n> When the rkisp1 driver of the running kernel supports less parameter\n> types than the libcamera build and such a parameter is used, queuing of\n> the parameter buffer fails with -EINVAL. For the time being we have no\n> way to query the kernel for supported parameter types at runtime. So at\n> least print a error message that points the user in that direction.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> \n> ---\n> \n> Changes in v2:\n> - Also print the error code in case of failure\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 +++++++++-\n>  1 file changed, 9 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 52633fe3cb85..9d7a3bd57ada 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -409,7 +409,15 @@ void RkISP1CameraData::paramsComputed(unsigned int frame, unsigned int bytesused\n>                 return;\n>  \n>         info->paramBuffer->_d()->metadata().planes()[0].bytesused = bytesused;\n> -       pipe->param_->queueBuffer(info->paramBuffer);\n> +\n> +       int ret = pipe->param_->queueBuffer(info->paramBuffer);\n> +       if (ret < 0) {\n> +               LOG(RkISP1, Error) << \"Failed to queue parameter buffer: \" << ret\n\nstrerror(-ret)? although not required.\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> +                                  << \" Maybe the kernel doesn't support the\"\n> +                                     \" required parameter types.\";\n> +               return;\n> +       }\n> +\n>         pipe->stat_->queueBuffer(info->statBuffer);\n>  \n>         if (info->mainPathBuffer)\n> -- \n> 2.43.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 549FFC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 13 Apr 2025 17:52:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CB8D768AB9;\n\tSun, 13 Apr 2025 19:52:39 +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 B4C6368A99\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Apr 2025 19:52:38 +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 A3041520;\n\tSun, 13 Apr 2025 19:50:37 +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=\"MNrFUBwV\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1744566637;\n\tbh=wtvsOkJVGvemPLGD8qL9JN3JyAddQfMq7ckMfZYXQNo=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=MNrFUBwV6Un0/MoSqtS48tb84mTP61O7SoJM4YDrEmCYUX0Jj1lPYFXFFSETRmNMw\n\tZTNoGPqQMDQVFGPH1YafrxJQqbKYqqMiJEu1lMcmauGwyCYRiQNEyW/G7R/nxW41Zx\n\tzpiSOn1obE7KO1LdEhSiwItHZkorzRx8gCdsWRfA=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250411123641.2144530-7-stefan.klug@ideasonboard.com>","References":"<20250411123641.2144530-1-stefan.klug@ideasonboard.com>\n\t<20250411123641.2144530-7-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2 6/9] pipeline: rkisp1: Add more info when parameter\n\tqueue fails","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Sun, 13 Apr 2025 18:52:35 +0100","Message-ID":"<174456675557.3333606.10559004072268281898@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":34189,"web_url":"https://patchwork.libcamera.org/comment/34189/","msgid":"<174700082405.116187.3375550494628307895@pyrite.rasen.tech>","date":"2025-05-11T22:00:24","subject":"Re: [PATCH v2 6/9] pipeline: rkisp1: Add more info when parameter\n\tqueue fails","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Stefan Klug (2025-04-11 14:36:34)\n> When the rkisp1 driver of the running kernel supports less parameter\n> types than the libcamera build and such a parameter is used, queuing of\n> the parameter buffer fails with -EINVAL. For the time being we have no\n> way to query the kernel for supported parameter types at runtime. So at\n> least print a error message that points the user in that direction.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> \n> ---\n> \n> Changes in v2:\n> - Also print the error code in case of failure\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 +++++++++-\n>  1 file changed, 9 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 52633fe3cb85..9d7a3bd57ada 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -409,7 +409,15 @@ void RkISP1CameraData::paramsComputed(unsigned int frame, unsigned int bytesused\n>                 return;\n>  \n>         info->paramBuffer->_d()->metadata().planes()[0].bytesused = bytesused;\n> -       pipe->param_->queueBuffer(info->paramBuffer);\n> +\n> +       int ret = pipe->param_->queueBuffer(info->paramBuffer);\n> +       if (ret < 0) {\n> +               LOG(RkISP1, Error) << \"Failed to queue parameter buffer: \" << ret\n> +                                  << \" Maybe the kernel doesn't support the\"\n> +                                     \" required parameter types.\";\n> +               return;\n> +       }\n> +\n>         pipe->stat_->queueBuffer(info->statBuffer);\n>  \n>         if (info->mainPathBuffer)\n> -- \n> 2.43.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 CCC5AC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 11 May 2025 22:00:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0336268B6E;\n\tMon, 12 May 2025 00:00:30 +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 8F83E68B60\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 May 2025 00:00:28 +0200 (CEST)","from pyrite.rasen.tech (unknown\n\t[IPv6:2001:861:3a80:3300:4f2f:8c2c:b3ef:17d4])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BBD92D80;\n\tMon, 12 May 2025 00:00:13 +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=\"kXZf5Pml\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747000813;\n\tbh=Wi4rMSIF6lGh40E12lt8vgaN0mWUvnjH6FW668LRUko=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=kXZf5PmliD7YpwA2kOrw1mTdXXG+bTSJ1M2TxzW+b/gVP/sxLhWaG/Unbqd7pmWIY\n\tL+H/jcvE26eOo/IQ4ozDOMgZLjyZWi7daz5yoKrVsLQ8ex98Uv71a2h8hIOVjjVRan\n\t+sSbvQ7DPJWgU7hlV+Sv7r/O+T//MDe9ogqCmANs=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250411123641.2144530-7-stefan.klug@ideasonboard.com>","References":"<20250411123641.2144530-1-stefan.klug@ideasonboard.com>\n\t<20250411123641.2144530-7-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v2 6/9] pipeline: rkisp1: Add more info when parameter\n\tqueue fails","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 12 May 2025 00:00:24 +0200","Message-ID":"<174700082405.116187.3375550494628307895@pyrite.rasen.tech>","User-Agent":"alot/0.0.0","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":34193,"web_url":"https://patchwork.libcamera.org/comment/34193/","msgid":"<20250511224821.GQ19001@pendragon.ideasonboard.com>","date":"2025-05-11T22:48:21","subject":"Re: [PATCH v2 6/9] pipeline: rkisp1: Add more info when parameter\n\tqueue fails","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Apr 11, 2025 at 02:36:34PM +0200, Stefan Klug wrote:\n> When the rkisp1 driver of the running kernel supports less parameter\n> types than the libcamera build and such a parameter is used, queuing of\n> the parameter buffer fails with -EINVAL. For the time being we have no\n> way to query the kernel for supported parameter types at runtime. So at\n> least print a error message that points the user in that direction.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nNot blocking this patch, but would you have time to extend the rkisp1\ndriver with a V4L2_CTRL_TYPE_BITMASK read-only control that returns the\nlist of supported blocks ?\n\nActually, I'm thinking we should have that control before we merge WDR\nsupport in rkisp1, in which case this patch wouldn't be needed.\n\n> ---\n> \n> Changes in v2:\n> - Also print the error code in case of failure\n> ---\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 10 +++++++++-\n>  1 file changed, 9 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 52633fe3cb85..9d7a3bd57ada 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -409,7 +409,15 @@ void RkISP1CameraData::paramsComputed(unsigned int frame, unsigned int bytesused\n>  \t\treturn;\n>  \n>  \tinfo->paramBuffer->_d()->metadata().planes()[0].bytesused = bytesused;\n> -\tpipe->param_->queueBuffer(info->paramBuffer);\n> +\n> +\tint ret = pipe->param_->queueBuffer(info->paramBuffer);\n> +\tif (ret < 0) {\n> +\t\tLOG(RkISP1, Error) << \"Failed to queue parameter buffer: \" << ret\n> +\t\t\t\t   << \" Maybe the kernel doesn't support the\"\n> +\t\t\t\t      \" required parameter types.\";\n> +\t\treturn;\n> +\t}\n> +\n>  \tpipe->stat_->queueBuffer(info->statBuffer);\n>  \n>  \tif (info->mainPathBuffer)","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 DDD6FC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 11 May 2025 22:48:31 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AC21368C90;\n\tMon, 12 May 2025 00:48:30 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 45F6268B60\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 May 2025 00:48:29 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(static-176-133-119-130.ftth.abo.bbox.fr [176.133.119.130])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 90EA88FA;\n\tMon, 12 May 2025 00:48:14 +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=\"DNZMmS26\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747003694;\n\tbh=QnI2D3PZoL0rbdZtvKdBB9Ayz+carTaJu97T8huLKOQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=DNZMmS26GM+GtDB33Rs/AIUJ3IEJ8kHUAYLNhAkU1s7yCMnaCsoirgkO1IA1YuQNu\n\tDCKrVnNQSULS1Ih4gK/G/rA3EqJ3fKU8jtVDIZSF+6oOsPtRqIjwbd3FyuK1gIrIIW\n\t7wq19S+UapKIMT+obiGBq3Ke3sUyYSkXmU+rVHMI=","Date":"Mon, 12 May 2025 00:48:21 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v2 6/9] pipeline: rkisp1: Add more info when parameter\n\tqueue fails","Message-ID":"<20250511224821.GQ19001@pendragon.ideasonboard.com>","References":"<20250411123641.2144530-1-stefan.klug@ideasonboard.com>\n\t<20250411123641.2144530-7-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20250411123641.2144530-7-stefan.klug@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>"}}]