[{"id":20562,"web_url":"https://patchwork.libcamera.org/comment/20562/","msgid":"<YXlFr2npuFpkNc5b@pendragon.ideasonboard.com>","date":"2021-10-27T12:27:27","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: provide\n\thasMediaController()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Wed, Oct 27, 2021 at 01:07:13PM +0100, Kieran Bingham wrote:\n> The V4L2Capability has helpers to interogate the capabilities\n> of a device.\n> \n> V4L2VideoDevice::enumPixelformats accesses the raw capabilites to check\n> if the device is supported by a MediaController device.\n> \n> Provide a helper, and update the usage.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> \n> ---\n> This might also be used in the upcoming RPi MediaController series, but\n> shouldn't block integration of that ...\n> ---\n>  include/libcamera/internal/v4l2_videodevice.h | 4 ++++\n>  src/libcamera/v4l2_videodevice.cpp            | 2 +-\n>  2 files changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> index efe34d47e72b..a1c458e45088 100644\n> --- a/include/libcamera/internal/v4l2_videodevice.h\n> +++ b/include/libcamera/internal/v4l2_videodevice.h\n> @@ -109,6 +109,10 @@ struct V4L2Capability final : v4l2_capability {\n>  \t{\n>  \t\treturn device_caps() & V4L2_CAP_STREAMING;\n>  \t}\n> +\tbool hasMediaController() const\n> +\t{\n> +\t\treturn device_caps() & V4L2_CAP_IO_MC;\n> +\t}\n>  };\n>  \n>  class V4L2BufferCache\n> diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> index 0cc622f91f2d..0fbf32bcfc00 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1019,7 +1019,7 @@ std::vector<V4L2PixelFormat> V4L2VideoDevice::enumPixelformats(uint32_t code)\n>  \tstd::vector<V4L2PixelFormat> formats;\n>  \tint ret;\n>  \n> -\tif (code && !(caps_.device_caps() & V4L2_CAP_IO_MC)) {\n> +\tif (code && !(caps_.hasMediaController())) {\n\n\tif (code && !caps_.hasMediaController()) {\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n>  \t\tLOG(V4L2, Error)\n>  \t\t\t<< \"Media bus code filtering not supported by the device\";\n>  \t\treturn {};","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 A7046BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 12:27:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 108156487F;\n\tWed, 27 Oct 2021 14:27:52 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DB8D460123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 14:27:50 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 5847F596;\n\tWed, 27 Oct 2021 14:27:50 +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=\"O3GUKkwt\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635337670;\n\tbh=b0kG5+0H7rNsJI/gbcw2DZduGtBw9Vtr/nYRLfSyIJ8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=O3GUKkwtLEC0ghxSIDQEEtvl10GtdeNnPX2GCI0F26e5USPSIyyo+y6F2msJPgQ6W\n\tryPrEahuliDEOS8fSd/fz0bIDwGvmtomTQGd993QI9fOz24ulOnzN1+6ylKiARu3JH\n\tp6wU/K3hYiiVCeYuPuizSCN1UTmO2uFXjagloGHg=","Date":"Wed, 27 Oct 2021 15:27:27 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YXlFr2npuFpkNc5b@pendragon.ideasonboard.com>","References":"<20211027120713.2240563-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20211027120713.2240563-1-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: provide\n\thasMediaController()","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20564,"web_url":"https://patchwork.libcamera.org/comment/20564/","msgid":"<CAEmqJPpR9_uVXxtNvdo-_aatE58FwRe6=_di-8s3T4ELbXxuGA@mail.gmail.com>","date":"2021-10-27T12:33:07","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: provide\n\thasMediaController()","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Kieran,\n\nThank you for your patch.\n\nOn Wed, 27 Oct 2021 at 13:07, Kieran Bingham <\nkieran.bingham@ideasonboard.com> wrote:\n\n> The V4L2Capability has helpers to interogate the capabilities\n> of a device.\n>\n> V4L2VideoDevice::enumPixelformats accesses the raw capabilites to check\n> if the device is supported by a MediaController device.\n>\n> Provide a helper, and update the usage.\n>\n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\nJust what I needed :-)\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n\n>\n> ---\n> This might also be used in the upcoming RPi MediaController series, but\n> shouldn't block integration of that ...\n> ---\n>  include/libcamera/internal/v4l2_videodevice.h | 4 ++++\n>  src/libcamera/v4l2_videodevice.cpp            | 2 +-\n>  2 files changed, 5 insertions(+), 1 deletion(-)\n>\n> diff --git a/include/libcamera/internal/v4l2_videodevice.h\n> b/include/libcamera/internal/v4l2_videodevice.h\n> index efe34d47e72b..a1c458e45088 100644\n> --- a/include/libcamera/internal/v4l2_videodevice.h\n> +++ b/include/libcamera/internal/v4l2_videodevice.h\n> @@ -109,6 +109,10 @@ struct V4L2Capability final : v4l2_capability {\n>         {\n>                 return device_caps() & V4L2_CAP_STREAMING;\n>         }\n> +       bool hasMediaController() const\n> +       {\n> +               return device_caps() & V4L2_CAP_IO_MC;\n> +       }\n>  };\n>\n>  class V4L2BufferCache\n> diff --git a/src/libcamera/v4l2_videodevice.cpp\n> b/src/libcamera/v4l2_videodevice.cpp\n> index 0cc622f91f2d..0fbf32bcfc00 100644\n> --- a/src/libcamera/v4l2_videodevice.cpp\n> +++ b/src/libcamera/v4l2_videodevice.cpp\n> @@ -1019,7 +1019,7 @@ std::vector<V4L2PixelFormat>\n> V4L2VideoDevice::enumPixelformats(uint32_t code)\n>         std::vector<V4L2PixelFormat> formats;\n>         int ret;\n>\n> -       if (code && !(caps_.device_caps() & V4L2_CAP_IO_MC)) {\n> +       if (code && !(caps_.hasMediaController())) {\n>                 LOG(V4L2, Error)\n>                         << \"Media bus code filtering not supported by the\n> device\";\n>                 return {};\n> --\n> 2.30.2\n>\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 AA655BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 12:33:25 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6B21A6487F;\n\tWed, 27 Oct 2021 14:33:25 +0200 (CEST)","from mail-lj1-x236.google.com (mail-lj1-x236.google.com\n\t[IPv6:2a00:1450:4864:20::236])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E0E7E60123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 14:33:23 +0200 (CEST)","by mail-lj1-x236.google.com with SMTP id h11so4475130ljk.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 05:33:23 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"MeEBmcgh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=4bZU7aYltn24aKGKr4CXG09BztfTEftjYMsLhXpQuKA=;\n\tb=MeEBmcghl3MGFxdATFZJ92jsWpncfgYicjIh/C1HdwnwGpK8K+Dq8W8F19yyhcTcix\n\t6LUpdpv46DeokR5p0RMbMLmkD7k+4iYupK7d9KdKrS39lCTZSdjPvIoTSwWfH75xxnjz\n\tM2ucWcZQ1hUJAENB4uaQvwnFS0ZM5log447ZqBrKoTc3GtNsxuSWQ2oAiqsPONHchH4g\n\t9KRrjc/+COlw8zpqN5Bck7PnY3EOMLvL8jUnYwts/dvJ2L2njSukNuQ/D/KSEhhf8EZK\n\t4XN8dVHb6ThUMZ2VirFBponxYCx5+7qJnSxP+J3ifgxalQInNUZdbBkvjNyroU2GRlKx\n\tCtRw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=4bZU7aYltn24aKGKr4CXG09BztfTEftjYMsLhXpQuKA=;\n\tb=Ud2sgVt61MlaznZChaodrHnvqbO7NQUvuqPhUIj4JZpMjEt9z8oERdYfNCYzRjX8LD\n\tRzUDohf3RN/gRD7f/STT0imbUqW5TGfG/Co73Q7erMvb7zvGRJSeciN2ZGi3OZd6Ov7P\n\tUVIRvBKg8QzYRpKpE7CrvcsroffKCLkg9fk8cJm+rcxFkSe1SJyj9UapazMpS+myo5+R\n\tuRXDgVS5A7AERNdYDOgGqpBn3r9/CEqNGmE4i5vq2K/2KPZEDcAUnokYtidNcsBgOkox\n\t8YTB3S730N/JztYkbdqkNdZuzuWOCAK3zczaYWQOm8hbFuDRT/sl4J4THFYvGrzCq5rh\n\tOg+A==","X-Gm-Message-State":"AOAM5329d8QQYWSmntD7gQrmFzcjQoHZPJdcFOo/FzFDWGNuZXR5sniG\n\tNCg2S2OC6ujxI2OFK6VwPgRzOPu2wHXag4wcCkd/DbZG4qXV5g==","X-Google-Smtp-Source":"ABdhPJyBLpKfQ/GJWOEVyM/joQcKLZVS7PcMJoSYvM20WmPkVfAoktz+67/0o3FU/6Kac20caAraGueh3AgLpCKcgSY=","X-Received":"by 2002:a05:651c:14f:: with SMTP id\n\tc15mr2762448ljd.444.1635338003337; \n\tWed, 27 Oct 2021 05:33:23 -0700 (PDT)","MIME-Version":"1.0","References":"<20211027120713.2240563-1-kieran.bingham@ideasonboard.com>","In-Reply-To":"<20211027120713.2240563-1-kieran.bingham@ideasonboard.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Wed, 27 Oct 2021 13:33:07 +0100","Message-ID":"<CAEmqJPpR9_uVXxtNvdo-_aatE58FwRe6=_di-8s3T4ELbXxuGA@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"000000000000c6e43e05cf54ccb7\"","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: provide\n\thasMediaController()","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20566,"web_url":"https://patchwork.libcamera.org/comment/20566/","msgid":"<YXlHTKVTlAupFBoK@pendragon.ideasonboard.com>","date":"2021-10-27T12:34:20","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: provide\n\thasMediaController()","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Oct 27, 2021 at 03:27:27PM +0300, Laurent Pinchart wrote:\n> Hi Kieran,\n> \n> Thank you for the patch.\n> \n> On Wed, Oct 27, 2021 at 01:07:13PM +0100, Kieran Bingham wrote:\n> > The V4L2Capability has helpers to interogate the capabilities\n> > of a device.\n> > \n> > V4L2VideoDevice::enumPixelformats accesses the raw capabilites to check\n> > if the device is supported by a MediaController device.\n> > \n> > Provide a helper, and update the usage.\n> > \n> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > \n> > ---\n> > This might also be used in the upcoming RPi MediaController series, but\n> > shouldn't block integration of that ...\n> > ---\n> >  include/libcamera/internal/v4l2_videodevice.h | 4 ++++\n> >  src/libcamera/v4l2_videodevice.cpp            | 2 +-\n> >  2 files changed, 5 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> > index efe34d47e72b..a1c458e45088 100644\n> > --- a/include/libcamera/internal/v4l2_videodevice.h\n> > +++ b/include/libcamera/internal/v4l2_videodevice.h\n> > @@ -109,6 +109,10 @@ struct V4L2Capability final : v4l2_capability {\n> >  \t{\n> >  \t\treturn device_caps() & V4L2_CAP_STREAMING;\n> >  \t}\n> > +\tbool hasMediaController() const\n> > +\t{\n> > +\t\treturn device_caps() & V4L2_CAP_IO_MC;\n> > +\t}\n> >  };\n> >  \n> >  class V4L2BufferCache\n> > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> > index 0cc622f91f2d..0fbf32bcfc00 100644\n> > --- a/src/libcamera/v4l2_videodevice.cpp\n> > +++ b/src/libcamera/v4l2_videodevice.cpp\n> > @@ -1019,7 +1019,7 @@ std::vector<V4L2PixelFormat> V4L2VideoDevice::enumPixelformats(uint32_t code)\n> >  \tstd::vector<V4L2PixelFormat> formats;\n> >  \tint ret;\n> >  \n> > -\tif (code && !(caps_.device_caps() & V4L2_CAP_IO_MC)) {\n> > +\tif (code && !(caps_.hasMediaController())) {\n> \n> \tif (code && !caps_.hasMediaController()) {\n> \n> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nOr rather, when hasMediaController() will be documented :-)\n\n> >  \t\tLOG(V4L2, Error)\n> >  \t\t\t<< \"Media bus code filtering not supported by the device\";\n> >  \t\treturn {};","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 B3CBFBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 12:34:45 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 68AC864881;\n\tWed, 27 Oct 2021 14:34:45 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1251260123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 14:34:44 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A370E596;\n\tWed, 27 Oct 2021 14:34:43 +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=\"o2kYvhto\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635338083;\n\tbh=eZcK+4wVC994l6hrRh/iGeamlFavspBbZc/KTht+IGg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=o2kYvhtom1lFahGiF+t1QAxXX4vPl5eh/lyt1A0A2kwcDw7vakVF7gs5Z0MP/CC22\n\t9FcOsEbvjvT5fSkr00QwACN4NX+RcPllzSQ2AEJ8oe2VeUXrWCrLqKZ4NgCAaLWWXW\n\tlld7g7QA1ykuioaqOHkCK1EujCHw9t0xodkaUQ4M=","Date":"Wed, 27 Oct 2021 15:34:20 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<YXlHTKVTlAupFBoK@pendragon.ideasonboard.com>","References":"<20211027120713.2240563-1-kieran.bingham@ideasonboard.com>\n\t<YXlFr2npuFpkNc5b@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YXlFr2npuFpkNc5b@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: provide\n\thasMediaController()","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":20571,"web_url":"https://patchwork.libcamera.org/comment/20571/","msgid":"<163533839706.1184428.12020887834044611723@Monstersaurus>","date":"2021-10-27T12:39:57","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: provide\n\thasMediaController()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2021-10-27 13:34:20)\n> On Wed, Oct 27, 2021 at 03:27:27PM +0300, Laurent Pinchart wrote:\n> > Hi Kieran,\n> > \n> > Thank you for the patch.\n> > \n> > On Wed, Oct 27, 2021 at 01:07:13PM +0100, Kieran Bingham wrote:\n> > > The V4L2Capability has helpers to interogate the capabilities\n> > > of a device.\n> > > \n> > > V4L2VideoDevice::enumPixelformats accesses the raw capabilites to check\n> > > if the device is supported by a MediaController device.\n> > > \n> > > Provide a helper, and update the usage.\n> > > \n> > > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> > > \n> > > ---\n> > > This might also be used in the upcoming RPi MediaController series, but\n> > > shouldn't block integration of that ...\n> > > ---\n> > >  include/libcamera/internal/v4l2_videodevice.h | 4 ++++\n> > >  src/libcamera/v4l2_videodevice.cpp            | 2 +-\n> > >  2 files changed, 5 insertions(+), 1 deletion(-)\n> > > \n> > > diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h\n> > > index efe34d47e72b..a1c458e45088 100644\n> > > --- a/include/libcamera/internal/v4l2_videodevice.h\n> > > +++ b/include/libcamera/internal/v4l2_videodevice.h\n> > > @@ -109,6 +109,10 @@ struct V4L2Capability final : v4l2_capability {\n> > >     {\n> > >             return device_caps() & V4L2_CAP_STREAMING;\n> > >     }\n> > > +   bool hasMediaController() const\n> > > +   {\n> > > +           return device_caps() & V4L2_CAP_IO_MC;\n> > > +   }\n> > >  };\n> > >  \n> > >  class V4L2BufferCache\n> > > diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\n> > > index 0cc622f91f2d..0fbf32bcfc00 100644\n> > > --- a/src/libcamera/v4l2_videodevice.cpp\n> > > +++ b/src/libcamera/v4l2_videodevice.cpp\n> > > @@ -1019,7 +1019,7 @@ std::vector<V4L2PixelFormat> V4L2VideoDevice::enumPixelformats(uint32_t code)\n> > >     std::vector<V4L2PixelFormat> formats;\n> > >     int ret;\n> > >  \n> > > -   if (code && !(caps_.device_caps() & V4L2_CAP_IO_MC)) {\n> > > +   if (code && !(caps_.hasMediaController())) {\n> > \n> >       if (code && !caps_.hasMediaController()) {\n> > \n> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> Or rather, when hasMediaController() will be documented :-)\n\nOh yeah ;-) That too ... I was too hasty sending this out while\nreviewing Naushs series ;-)\n\nv2 imminent.\n\n> \n> > >             LOG(V4L2, Error)\n> > >                     << \"Media bus code filtering not supported by the device\";\n> > >             return {};\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 E09F9BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 27 Oct 2021 12:40:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9AC996487F;\n\tWed, 27 Oct 2021 14:40:01 +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 D8E1260123\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 27 Oct 2021 14:39:59 +0200 (CEST)","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 8CAD6596;\n\tWed, 27 Oct 2021 14:39:59 +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=\"MpfeJTtx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1635338399;\n\tbh=Wk+so6DkXN2LeDt+nKZg7L+dY1kYIcaCY2mmYpUbHh8=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=MpfeJTtxZ6R8P7VnGPhlzNjBeM2dMKbWB0LY3UPfcyjCZhPe5OkMAor8imO55Zbdt\n\t2EmxHUqkanhlRSB5160CKBRw99D418PLM5pyO68DMv9cZ+hZeTbVQ7MX1NK9j46JLl\n\tl5hfpsCn6JWn8394RTNKYUMKuyimS21pB5odAiJk=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<YXlHTKVTlAupFBoK@pendragon.ideasonboard.com>","References":"<20211027120713.2240563-1-kieran.bingham@ideasonboard.com>\n\t<YXlFr2npuFpkNc5b@pendragon.ideasonboard.com>\n\t<YXlHTKVTlAupFBoK@pendragon.ideasonboard.com>","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Wed, 27 Oct 2021 13:39:57 +0100","Message-ID":"<163533839706.1184428.12020887834044611723@Monstersaurus>","User-Agent":"alot/0.9.1","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: provide\n\thasMediaController()","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]