[{"id":32736,"web_url":"https://patchwork.libcamera.org/comment/32736/","msgid":"<20241215195227.GO9975@pendragon.ideasonboard.com>","date":"2024-12-15T19:52:27","subject":"Re: [RFC PATCH v1] meson: Convert `v4l2` into a feature option","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Barnabás,\n\nThank you for the patch.\n\nOn Sun, Dec 15, 2024 at 07:23:57PM +0000, Barnabás Pőcze wrote:\n> The v4l2 compatibility layer does not have external dependencies,\n> the usual benefits of a feature option do not apply. The main\n> motivation behind this change is making use of the `auto_features`\n> meson option that can change all feature options set to \"auto\"\n> by default to the desired value.\n> \n> This can be useful for two reasons: (1) using auto_features=disabled\n> and then building up the list of features that are desired in the\n> particular build; (2) using auto_features=enabled to achieve\n> (usually) more testing and compilation coverage.\n\nThe first use case doesn't seem very useful to me, as the v4l2 option is\nset to false by default, so we can already start with the option\ndisabled and enable it only when desired.\n\nThe second use case is a bit more interesting.\n\nYou will however need to update CI, and it will break all packaging\nscripts that set the option explicitly to false or true, so I wonder if\nit's really worth it. If there's a general consensus that we should\nchange the option type, I'm OK with this patch.\n\n> Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> ---\n>  meson_options.txt    | 4 ++--\n>  src/v4l2/meson.build | 2 +-\n>  2 files changed, 3 insertions(+), 3 deletions(-)\n> \n> diff --git a/meson_options.txt b/meson_options.txt\n> index c91cd241a..08e224561 100644\n> --- a/meson_options.txt\n> +++ b/meson_options.txt\n> @@ -84,6 +84,6 @@ option('udev',\n>         description : 'Enable udev support for hotplug')\n>  \n>  option('v4l2',\n> -        type : 'boolean',\n> -        value : false,\n> +        type : 'feature',\n> +        value : 'auto',\n>          description : 'Compile the V4L2 compatibility layer')\n> diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> index 58f53bf3d..e4daf8ae7 100644\n> --- a/src/v4l2/meson.build\n> +++ b/src/v4l2/meson.build\n> @@ -1,6 +1,6 @@\n>  # SPDX-License-Identifier: CC0-1.0\n>  \n> -if not get_option('v4l2')\n> +if not get_option('v4l2').allowed()\n>      v4l2_enabled = false\n>      subdir_done()\n>  endif","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 E7F8DC32F5\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 15 Dec 2024 19:52:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 15D4A67F17;\n\tSun, 15 Dec 2024 20:52:45 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E83E6618AC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 15 Dec 2024 20:52:43 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id BCC3E99F;\n\tSun, 15 Dec 2024 20:52:07 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"GPmWSzm+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734292327;\n\tbh=sdwTchG0K6HCjtI34WZJbuft5QY3QRI2Ibl8Qa3gZCk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=GPmWSzm+GsuDJ0/uCR4c/EaWiJXySn2Prfn1a1VJuN1Cvr9iD9jr/hwTBjGk2qc4M\n\tjLrPAl2VqKx00dLKr7PS2FMen4rxI7M0LqtMXHPpinU2otie9B+kB09GcbffWSBkGh\n\tw2ngkOJz89O5cootRgsxYb/m2pB8SdiU4fkseTNk=","Date":"Sun, 15 Dec 2024 21:52:27 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v1] meson: Convert `v4l2` into a feature option","Message-ID":"<20241215195227.GO9975@pendragon.ideasonboard.com>","References":"<20241215192354.824108-1-pobrn@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20241215192354.824108-1-pobrn@protonmail.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":32757,"web_url":"https://patchwork.libcamera.org/comment/32757/","msgid":"<Fu_P4TGDR_JmX1AJuKJDiiohBr091ZDFiN2vbN8irt7CHJej43ijRIn7g1C1wJrvARqrJDstZazxMQaQK1CHDuqTm0iIznPZBrUDdVruTCM=@protonmail.com>","date":"2024-12-16T10:59:34","subject":"Re: [RFC PATCH v1] meson: Convert `v4l2` into a feature option","submitter":{"id":133,"url":"https://patchwork.libcamera.org/api/people/133/","name":"Pőcze Barnabás","email":"pobrn@protonmail.com"},"content":"Hi\n\n\n2024. december 15., vasárnap 20:52 keltezéssel, Laurent Pinchart <laurent.pinchart@ideasonboard.com> írta:\n\n> Hi Barnabás,\n> \n> Thank you for the patch.\n> \n> On Sun, Dec 15, 2024 at 07:23:57PM +0000, Barnabás Pőcze wrote:\n> > The v4l2 compatibility layer does not have external dependencies,\n> > the usual benefits of a feature option do not apply. The main\n> > motivation behind this change is making use of the `auto_features`\n> > meson option that can change all feature options set to \"auto\"\n> > by default to the desired value.\n> >\n> > This can be useful for two reasons: (1) using auto_features=disabled\n> > and then building up the list of features that are desired in the\n> > particular build; (2) using auto_features=enabled to achieve\n> > (usually) more testing and compilation coverage.\n> \n> The first use case doesn't seem very useful to me, as the v4l2 option is\n> set to false by default, so we can already start with the option\n> disabled and enable it only when desired.\n> \n> The second use case is a bit more interesting.\n> \n> You will however need to update CI, and it will break all packaging\n> scripts that set the option explicitly to false or true, so I wonder if\n> it's really worth it. If there's a general consensus that we should\n> change the option type, I'm OK with this patch.\n\nI think it makes sense conceptually to turn this into a feature option.\nThe transition can be made relatively seamless if that is a concern:\n\ndiff --git a/meson_options.txt b/meson_options.txt\nindex c91cd241a..1f70da0f5 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -84,6 +84,7 @@ option('udev',\n        description : 'Enable udev support for hotplug')\n \n option('v4l2',\n-        type : 'boolean',\n-        value : false,\n-        description : 'Compile the V4L2 compatibility layer')\n+        type : 'feature',\n+        value : 'auto',\n+        description : 'Compile the V4L2 compatibility layer',\n+        deprecated : {'true': 'enabled', 'false': 'disabled'})\n\n\nRegards,\nBarnabás Pőcze\n\n\n> \n> > Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> > ---\n> >  meson_options.txt    | 4 ++--\n> >  src/v4l2/meson.build | 2 +-\n> >  2 files changed, 3 insertions(+), 3 deletions(-)\n> >\n> > diff --git a/meson_options.txt b/meson_options.txt\n> > index c91cd241a..08e224561 100644\n> > --- a/meson_options.txt\n> > +++ b/meson_options.txt\n> > @@ -84,6 +84,6 @@ option('udev',\n> >         description : 'Enable udev support for hotplug')\n> >\n> >  option('v4l2',\n> > -        type : 'boolean',\n> > -        value : false,\n> > +        type : 'feature',\n> > +        value : 'auto',\n> >          description : 'Compile the V4L2 compatibility layer')\n> > diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> > index 58f53bf3d..e4daf8ae7 100644\n> > --- a/src/v4l2/meson.build\n> > +++ b/src/v4l2/meson.build\n> > @@ -1,6 +1,6 @@\n> >  # SPDX-License-Identifier: CC0-1.0\n> >\n> > -if not get_option('v4l2')\n> > +if not get_option('v4l2').allowed()\n> >      v4l2_enabled = false\n> >      subdir_done()\n> >  endif\n> \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 78B75C32F9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Dec 2024 10:59:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8A0E967F51;\n\tMon, 16 Dec 2024 11:59:41 +0100 (CET)","from mail-40134.protonmail.ch (mail-40134.protonmail.ch\n\t[185.70.40.134])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 37B6760136\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Dec 2024 11:59:39 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=protonmail.com header.i=@protonmail.com\n\theader.b=\"Vro3Na6r\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;\n\ts=protonmail3; t=1734346778; x=1734605978;\n\tbh=8tWPjd7AonlXYxU1b7zX2o3KttAxoqsOeCXUJj1nnWk=;\n\th=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References:\n\tFeedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID:\n\tMessage-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post;\n\tb=Vro3Na6rDfWqdY6BJKDx/8bLdJizL+/qKTd4TDrywqoqmjEaTutj9H8HkoLzgb2y9\n\tvHSfYWxVRUVNd3Jgrs4pdBNwFeDN1lKBAypx5juzSb04UuEIj8173m0cdV2DcnKiQw\n\tQy7KWnwjYN6/KkIOhdjYIRQ3huoJvmHupm3/Dev6wB7WHg0kBQbg+mirgy7DOlEn5W\n\t2bB0licPGL7SD4r9U6TBIcnuZqw0h/oN7N8j6JRZPZL2YD+DK2LPhZPMbL1o5mMyj/\n\tN+hz3cFmmZiH+ipA9kz/IPyxPlvh1Sq0tSpqPSOOO5HL0fZ4F0WvYvBVRyLiT2y5Jw\n\tOad96jLUvXCCQ==","Date":"Mon, 16 Dec 2024 10:59:34 +0000","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v1] meson: Convert `v4l2` into a feature option","Message-ID":"<Fu_P4TGDR_JmX1AJuKJDiiohBr091ZDFiN2vbN8irt7CHJej43ijRIn7g1C1wJrvARqrJDstZazxMQaQK1CHDuqTm0iIznPZBrUDdVruTCM=@protonmail.com>","In-Reply-To":"<20241215195227.GO9975@pendragon.ideasonboard.com>","References":"<20241215192354.824108-1-pobrn@protonmail.com>\n\t<20241215195227.GO9975@pendragon.ideasonboard.com>","Feedback-ID":"20568564:user:proton","X-Pm-Message-ID":"0d851afd960e549d989d58e96ce960b4e8f5da51","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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":32758,"web_url":"https://patchwork.libcamera.org/comment/32758/","msgid":"<20241216110404.GF31128@pendragon.ideasonboard.com>","date":"2024-12-16T11:04:04","subject":"Re: [RFC PATCH v1] meson: Convert `v4l2` into a feature option","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Mon, Dec 16, 2024 at 10:59:34AM +0000, Barnabás Pőcze wrote:\n> 2024. december 15., vasárnap 20:52 keltezéssel, Laurent Pinchart írta:\n> > On Sun, Dec 15, 2024 at 07:23:57PM +0000, Barnabás Pőcze wrote:\n> > > The v4l2 compatibility layer does not have external dependencies,\n> > > the usual benefits of a feature option do not apply. The main\n> > > motivation behind this change is making use of the `auto_features`\n> > > meson option that can change all feature options set to \"auto\"\n> > > by default to the desired value.\n> > >\n> > > This can be useful for two reasons: (1) using auto_features=disabled\n> > > and then building up the list of features that are desired in the\n> > > particular build; (2) using auto_features=enabled to achieve\n> > > (usually) more testing and compilation coverage.\n> > \n> > The first use case doesn't seem very useful to me, as the v4l2 option is\n> > set to false by default, so we can already start with the option\n> > disabled and enable it only when desired.\n> > \n> > The second use case is a bit more interesting.\n> > \n> > You will however need to update CI, and it will break all packaging\n> > scripts that set the option explicitly to false or true, so I wonder if\n> > it's really worth it. If there's a general consensus that we should\n> > change the option type, I'm OK with this patch.\n> \n> I think it makes sense conceptually to turn this into a feature option.\n> The transition can be made relatively seamless if that is a concern:\n> \n> diff --git a/meson_options.txt b/meson_options.txt\n> index c91cd241a..1f70da0f5 100644\n> --- a/meson_options.txt\n> +++ b/meson_options.txt\n> @@ -84,6 +84,7 @@ option('udev',\n>         description : 'Enable udev support for hotplug')\n>  \n>  option('v4l2',\n> -        type : 'boolean',\n> -        value : false,\n> -        description : 'Compile the V4L2 compatibility layer')\n> +        type : 'feature',\n> +        value : 'auto',\n> +        description : 'Compile the V4L2 compatibility layer',\n> +        deprecated : {'true': 'enabled', 'false': 'disabled'})\n\nI didn't know about \"deprecated\", that's interesting. With that,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nand we can drop it after a few releases.\n\n> > > Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> > > ---\n> > >  meson_options.txt    | 4 ++--\n> > >  src/v4l2/meson.build | 2 +-\n> > >  2 files changed, 3 insertions(+), 3 deletions(-)\n> > >\n> > > diff --git a/meson_options.txt b/meson_options.txt\n> > > index c91cd241a..08e224561 100644\n> > > --- a/meson_options.txt\n> > > +++ b/meson_options.txt\n> > > @@ -84,6 +84,6 @@ option('udev',\n> > >         description : 'Enable udev support for hotplug')\n> > >\n> > >  option('v4l2',\n> > > -        type : 'boolean',\n> > > -        value : false,\n> > > +        type : 'feature',\n> > > +        value : 'auto',\n> > >          description : 'Compile the V4L2 compatibility layer')\n> > > diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> > > index 58f53bf3d..e4daf8ae7 100644\n> > > --- a/src/v4l2/meson.build\n> > > +++ b/src/v4l2/meson.build\n> > > @@ -1,6 +1,6 @@\n> > >  # SPDX-License-Identifier: CC0-1.0\n> > >\n> > > -if not get_option('v4l2')\n> > > +if not get_option('v4l2').allowed()\n> > >      v4l2_enabled = false\n> > >      subdir_done()\n> > >  endif","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 92CECC32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Dec 2024 11:04:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8603267F1A;\n\tMon, 16 Dec 2024 12:04:22 +0100 (CET)","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 EB43E62C8B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Dec 2024 12:04:20 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5765E13C;\n\tMon, 16 Dec 2024 12:03:44 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"mDdj58Py\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734347024;\n\tbh=ONWjbLimp8C+M3UJqRtQ/B7OIxLVHW6P9NdHv0U5/Dg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=mDdj58Py7rK7ok1qIy6fR77rtoMutLd0cMoCNDaP1AzNHs/mAGAS095L3DVAklcUx\n\tmxrHisAvGjQwc7O0nmtiwUkDCXFIU6nhSpkEo5MNW7RelTLecFUAbKlJs9tNR/PKmy\n\tnaiDTEQs9RmrDAA79ndDxt8D2nfn3x3mIQDEZXW8=","Date":"Mon, 16 Dec 2024 13:04:04 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH v1] meson: Convert `v4l2` into a feature option","Message-ID":"<20241216110404.GF31128@pendragon.ideasonboard.com>","References":"<20241215192354.824108-1-pobrn@protonmail.com>\n\t<20241215195227.GO9975@pendragon.ideasonboard.com>\n\t<Fu_P4TGDR_JmX1AJuKJDiiohBr091ZDFiN2vbN8irt7CHJej43ijRIn7g1C1wJrvARqrJDstZazxMQaQK1CHDuqTm0iIznPZBrUDdVruTCM=@protonmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<Fu_P4TGDR_JmX1AJuKJDiiohBr091ZDFiN2vbN8irt7CHJej43ijRIn7g1C1wJrvARqrJDstZazxMQaQK1CHDuqTm0iIznPZBrUDdVruTCM=@protonmail.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":32766,"web_url":"https://patchwork.libcamera.org/comment/32766/","msgid":"<173435148205.253066.1736137101178074005@ping.linuxembedded.co.uk>","date":"2024-12-16T12:18:02","subject":"Re: [RFC PATCH v1] meson: Convert `v4l2` into a feature option","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-12-16 11:04:04)\n> On Mon, Dec 16, 2024 at 10:59:34AM +0000, Barnabás Pőcze wrote:\n> > 2024. december 15., vasárnap 20:52 keltezéssel, Laurent Pinchart írta:\n> > > On Sun, Dec 15, 2024 at 07:23:57PM +0000, Barnabás Pőcze wrote:\n> > > > The v4l2 compatibility layer does not have external dependencies,\n> > > > the usual benefits of a feature option do not apply. The main\n> > > > motivation behind this change is making use of the `auto_features`\n> > > > meson option that can change all feature options set to \"auto\"\n> > > > by default to the desired value.\n> > > >\n> > > > This can be useful for two reasons: (1) using auto_features=disabled\n> > > > and then building up the list of features that are desired in the\n> > > > particular build; (2) using auto_features=enabled to achieve\n> > > > (usually) more testing and compilation coverage.\n> > > \n> > > The first use case doesn't seem very useful to me, as the v4l2 option is\n> > > set to false by default, so we can already start with the option\n> > > disabled and enable it only when desired.\n> > > \n> > > The second use case is a bit more interesting.\n> > > \n> > > You will however need to update CI, and it will break all packaging\n> > > scripts that set the option explicitly to false or true, so I wonder if\n> > > it's really worth it. If there's a general consensus that we should\n> > > change the option type, I'm OK with this patch.\n> > \n> > I think it makes sense conceptually to turn this into a feature option.\n> > The transition can be made relatively seamless if that is a concern:\n> > \n> > diff --git a/meson_options.txt b/meson_options.txt\n> > index c91cd241a..1f70da0f5 100644\n> > --- a/meson_options.txt\n> > +++ b/meson_options.txt\n> > @@ -84,6 +84,7 @@ option('udev',\n> >         description : 'Enable udev support for hotplug')\n> >  \n> >  option('v4l2',\n> > -        type : 'boolean',\n> > -        value : false,\n> > -        description : 'Compile the V4L2 compatibility layer')\n> > +        type : 'feature',\n> > +        value : 'auto',\n> > +        description : 'Compile the V4L2 compatibility layer',\n> > +        deprecated : {'true': 'enabled', 'false': 'disabled'})\n> \n> I didn't know about \"deprecated\", that's interesting. With that,\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> and we can drop it after a few releases.\n\nIndeed, I'm fine with that,\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> > > > Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>\n> > > > ---\n> > > >  meson_options.txt    | 4 ++--\n> > > >  src/v4l2/meson.build | 2 +-\n> > > >  2 files changed, 3 insertions(+), 3 deletions(-)\n> > > >\n> > > > diff --git a/meson_options.txt b/meson_options.txt\n> > > > index c91cd241a..08e224561 100644\n> > > > --- a/meson_options.txt\n> > > > +++ b/meson_options.txt\n> > > > @@ -84,6 +84,6 @@ option('udev',\n> > > >         description : 'Enable udev support for hotplug')\n> > > >\n> > > >  option('v4l2',\n> > > > -        type : 'boolean',\n> > > > -        value : false,\n> > > > +        type : 'feature',\n> > > > +        value : 'auto',\n> > > >          description : 'Compile the V4L2 compatibility layer')\n> > > > diff --git a/src/v4l2/meson.build b/src/v4l2/meson.build\n> > > > index 58f53bf3d..e4daf8ae7 100644\n> > > > --- a/src/v4l2/meson.build\n> > > > +++ b/src/v4l2/meson.build\n> > > > @@ -1,6 +1,6 @@\n> > > >  # SPDX-License-Identifier: CC0-1.0\n> > > >\n> > > > -if not get_option('v4l2')\n> > > > +if not get_option('v4l2').allowed()\n> > > >      v4l2_enabled = false\n> > > >      subdir_done()\n> > > >  endif\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 2B096C32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Dec 2024 12:18:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2398367F56;\n\tMon, 16 Dec 2024 13:18:06 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 17CDB62C8B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Dec 2024 13:18:05 +0100 (CET)","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 9408213C;\n\tMon, 16 Dec 2024 13:17:28 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"v/7yuZCM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734351448;\n\tbh=1yiUUzsfrI4dRwhOZMo6d6fdNGy6/Qy+RS7jAwf1qoA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=v/7yuZCMujgbrjRmkrrvMvFZpEwjJ0gMaJ4V2KCY+qvsB3wI8rvuy4KgTOXXlfTBk\n\t8ESMiT7MtfZdlCADVvXkeSIF7qBpZWS8sl8rRyj43w58yR3ymX5+tn4kuFavJxqNht\n\t7O1Jx3errPKzVD3rzPKVw+scUVN8L8Z8ZtaBsUU4=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20241216110404.GF31128@pendragon.ideasonboard.com>","References":"<20241215192354.824108-1-pobrn@protonmail.com>\n\t<20241215195227.GO9975@pendragon.ideasonboard.com>\n\t<Fu_P4TGDR_JmX1AJuKJDiiohBr091ZDFiN2vbN8irt7CHJej43ijRIn7g1C1wJrvARqrJDstZazxMQaQK1CHDuqTm0iIznPZBrUDdVruTCM=@protonmail.com>\n\t<20241216110404.GF31128@pendragon.ideasonboard.com>","Subject":"Re: [RFC PATCH v1] meson: Convert `v4l2` into a feature option","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <pobrn@protonmail.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Mon, 16 Dec 2024 12:18:02 +0000","Message-ID":"<173435148205.253066.1736137101178074005@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>"}}]