[{"id":28489,"web_url":"https://patchwork.libcamera.org/comment/28489/","msgid":"<170551018752.1011926.5001592531646802837@ping.linuxembedded.co.uk>","date":"2024-01-17T16:49:47","subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: v4l2_subdevice: Enable\n\tstreams API when supported","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Laurent Pinchart (2024-01-17 14:42:35)\n> The streams API needs to be enabled explictly by setting a subdev client\n> capability. Do so unconditionally for subdevs that expose streams\n> support. We don't need any kernel version check to use the\n> VIDIOC_SUBDEV_S_CLIENT_CAP ioctl, as it is guaranteed to be supported by\n> kernels that support streams.\n> \n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nAnd also no regression noted on the ISI with Simple pipeline handler on\nthe Debix-SOM with an IMX283.\n\nTested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> ---\n>  src/libcamera/v4l2_subdevice.cpp | 15 +++++++++++++++\n>  1 file changed, 15 insertions(+)\n> \n> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp\n> index 15e8206a915c..75ad11e55272 100644\n> --- a/src/libcamera/v4l2_subdevice.cpp\n> +++ b/src/libcamera/v4l2_subdevice.cpp\n> @@ -359,6 +359,21 @@ int V4L2Subdevice::open()\n>                 return ret;\n>         }\n>  \n> +       /* If the subdev supports streams, enable the streams API. */\n> +       if (caps_.hasStreams()) {\n> +               struct v4l2_subdev_client_capability clientCaps{};\n> +               clientCaps.capabilities = V4L2_SUBDEV_CLIENT_CAP_STREAMS;\n> +\n> +               ret = ioctl(VIDIOC_SUBDEV_S_CLIENT_CAP, &clientCaps);\n> +               if (ret < 0) {\n> +                       ret = -errno;\n> +                       LOG(V4L2, Error)\n> +                               << \"Unable to set client capabilities: \"\n> +                               << strerror(-ret);\n> +                       return ret;\n> +               }\n> +       }\n> +\n>         return 0;\n>  }\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 9318ABDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 17 Jan 2024 16:49:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 398F7628B8;\n\tWed, 17 Jan 2024 17:49:51 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C54B8628AD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 17 Jan 2024 17:49:50 +0100 (CET)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3AE397EC;\n\tWed, 17 Jan 2024 17:48:41 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1705510191;\n\tbh=DTHDxlPzw+QmOMj7FnhE91UY35BQG6/znfP0hwbII4c=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=jOUxSgaitef6VoPE5O4qMznq43l7dhRZIvLBnxhLP0GHBJAwkJppSgUfO1bMdm/9F\n\ttUkB8usfUSK2V8LpIUUkX0ITGtvR+lu1O4nvuWl1ETHUaEHsqII8vHr8aalxqbB1q1\n\t76Yhl6gKMtjMfTWCvYSnOxLW5aoe6YMvMTdxIG5X2HNL7ItHXZQbjQIiYkho+czKxh\n\tY5bsGJFTHwk7Rgh4IQafe6+tay3F5UU7QRC1NnFXRGu1EVwv/uJdXc0P96MTMfrvho\n\tDOhy8KKoTf9Nb+9AZb+keg2vVUN2rCLcnaSLzGudcYJfoHiQKvPB9ze7v4r8SNB4Ke\n\tstQvyyQz6Nthw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1705510121;\n\tbh=DTHDxlPzw+QmOMj7FnhE91UY35BQG6/znfP0hwbII4c=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=Rp2iK04alpmouwhwbWOeQH/rhQwea8Hoq5lmP2fms9DAZ37iRipdNHoFXV/kjwN8V\n\tdgX/GOlio5FIfyMg9nUm0s49bvwIS7g/RqRzawLrOqBbRufqhU+mhfqEaSDkXtGpfE\n\tOHCJoKtREZchj1Szbzp3u6mr2ur6HWnu3rIIFGuA="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Rp2iK04a\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240117144242.9903-3-laurent.pinchart@ideasonboard.com>","References":"<20240117144242.9903-1-laurent.pinchart@ideasonboard.com>\n\t<20240117144242.9903-3-laurent.pinchart@ideasonboard.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 17 Jan 2024 16:49:47 +0000","Message-ID":"<170551018752.1011926.5001592531646802837@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 2/2] libcamera: v4l2_subdevice: Enable\n\tstreams API when supported","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]