[{"id":30970,"web_url":"https://patchwork.libcamera.org/comment/30970/","msgid":"<20240829220808.GK15799@pendragon.ideasonboard.com>","date":"2024-08-29T22:08:08","subject":"Re: [PATCH v2 0/3] Fix uvcvideo pipelinehandler keeping /dev/video#\n\topen","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hans,\n\nI've reviewed the series and had minor comments only. I was considering\naddressing them myself and merging the patches, but I'd like to get your\nack on the proposed changes in 3/3. If you're fine with them and can\nsubmit a v3, I'll merge that.\n\nOn Tue, Aug 27, 2024 at 06:42:52PM +0200, Hans de Goede wrote:\n> Hi all,\n> \n> The uvcvideo pipeline handler always keeps the uvcvideo /dev/video# device\n> for a pipeline open after enumerating the camera.\n> \n> This is a problem for uvcvideo, as keeping the /dev/video# node open stops\n> the underlying USB device and the USB bus controller from being able to\n> enter runtime-suspend causing significant unnecessary power-usage.\n> \n> Here is v2 of my series making the uvcvideo pipeline handler open\n> /dev/video# on acquire and close it on release to fix this.\n> \n> Changes in v2:\n> - Drop the first 2 patches these have already been merged\n> - Add a note to both the doxygen documentation as well as to the commit\n>   messages that opening/closing /dev/video# from acquire()/release()\n>   as done by the uvcvideo pipeline handler is an exception and that this\n>   behavior should not be copied by other pipeline handlers\n> - Other doxygen doc fixes / improvements\n> - Only unlock media devices on acquireDevice() failure if useCount_ == 0\n> - Drop PipelineHandler::lock_, update \"\\context\" in doxygen docs\n> \n> I've pushed this to the software-isp gitlab repo for CI:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/pipeline-acquireDevice-v2\n> \n> and it has passed CI.\n> \n> Regards,\n> \n> Hans\n> \n> \n> Hans de Goede (3):\n>   pipeline_handler: Add acquireDevice() method to mirror existing\n>     releaseDevice()\n>   camera: Use invokeMethod() for pipe_->acquire() and pipe_->release()\n>   uvcvideo: Implement acquireDevice() + releaseDevice()\n> \n>  include/libcamera/internal/pipeline_handler.h |  8 +--\n>  src/libcamera/camera.cpp                      |  6 +-\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  | 45 ++++++++++++++\n>  src/libcamera/pipeline_handler.cpp            | 60 ++++++++++++++-----\n>  4 files changed, 98 insertions(+), 21 deletions(-)","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 3FCA6C323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 29 Aug 2024 22:08:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BEC4163466;\n\tFri, 30 Aug 2024 00:08:40 +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 897A561903\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Aug 2024 00:08:39 +0200 (CEST)","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 CDA5C524;\n\tFri, 30 Aug 2024 00:07:30 +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=\"rWlJyr4j\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1724969251;\n\tbh=7FmRW1mIcgePtPNZPIPha8DofAZCjsEEnMU5YK6u5eg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=rWlJyr4jkeZdkhd/EHsr8Fe/kDbno4esDIrLbSyRPcetHiYThMutfG8nqHo9YqdCX\n\tntP2jsGu3rbC0U+hKxApSbg3wDPrWQwgUhsA/S940TDo9iUPrPIjVDDa6NSOPvkjXl\n\tXwFZQCcRscvJZQshtkL99GgEbH0bhvsONFAfn8io=","Date":"Fri, 30 Aug 2024 01:08:08 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hans de Goede <hdegoede@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org, Milan Zamazal <mzamazal@redhat.com>,\n\tMaxime Ripard <mripard@redhat.com>","Subject":"Re: [PATCH v2 0/3] Fix uvcvideo pipelinehandler keeping /dev/video#\n\topen","Message-ID":"<20240829220808.GK15799@pendragon.ideasonboard.com>","References":"<20240827164255.314432-1-hdegoede@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240827164255.314432-1-hdegoede@redhat.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>"}}]