Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp347241lqg; Thu, 11 Apr 2024 05:09:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXXQFoKMuFGO4W7APCLBSJlSu8oWmDm8L8+wimNbbXYPh6M5G3vWnC9oL/2pYYa4LNAKOHIhxsdzBkJeLUhYahXqTRYKicBCyPhuiPJ3g== X-Google-Smtp-Source: AGHT+IGHu5CYBMPnHi4OkrWI0iVVefDp/S1U4LCL5M0HdkkT9JwDXP9dgH07p+GwjUAGsfCdwtxJ X-Received: by 2002:a05:6e02:12e5:b0:36a:88f0:1e81 with SMTP id l5-20020a056e0212e500b0036a88f01e81mr3826480iln.6.1712837353861; Thu, 11 Apr 2024 05:09:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712837353; cv=pass; d=google.com; s=arc-20160816; b=W/Fl0/MNq6efXfcO5C48e2BILjVa+h+PqBlU+7jKdNuhAhwzt25cJclBg0Ed3mibOB u8tKmXl9WF0SLJvtUhSeHCxIk0AG3rbGsxlk9/Zsq0i5PgK3m6b6I6qo082jUklfMoAZ Z2jpMysoP8B7W6xC5xcmzUZ9JKkjQQ2gLwXQBT5mLOMkZQK9JdXN8o/hb3JFN0d2EdJa iYC95w/jH7mt2id/InJtHcUUhZyCm0N1cHlc2PlNJEpIQ+DCISy/3U/cJUZ5aahgxqc0 NxpNDhiTvOaui5nesXpZq6JzGrISLwlthu9RtwuM8OGDoK2i5jtRBswLHFzCaN7xm/as 0s0g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=RLRQhqBcmcsT8HEH6QPYXWH+3BIY2uZ0Smez2XBKwgU=; fh=zgRMIYdrAUWa6zQBMBN7zPZwx2MXbBAmoVyUIlQbEzc=; b=FnCWgr9jt6rjM8n0oO5QhP87g7ZOSrsFU3u8NlHo5CBMgamcrAk8ResugWPTJP1dRs pGYdXmm3KpMN0SUrMvi0kGRTIiBYmq7pupMh14AzKt+DVz3Rj3kp4IWSCc4ghI790P7u 8zs+mvdio2BIR+1QC6N/DuiBHBIoUiI+FzsAaIU7Blbwlch5eOlMsaqCJ05hvltDGFwy 3rgYHC6NRerTLfSiHitmGLRxTMTCadqnFxMCgksCT19WAfPicx5nXlXLAX9UjvsKIsRA 9W1JKSuAup1s4X/OYY72LPr+ajuGSMIVdVHyCQCZWqaxmrVzJDrHVhQhx5o+jeVvE3Fm x52Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=LHCNT2q6; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-140389-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140389-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id e19-20020a635013000000b005f401cc97c8si1168264pgb.529.2024.04.11.05.09.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 05:09:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140389-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=LHCNT2q6; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-140389-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140389-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 6A91EB23CE3 for ; Thu, 11 Apr 2024 11:57:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DDC0314B07A; Thu, 11 Apr 2024 11:57:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="LHCNT2q6" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8519314AD31; Thu, 11 Apr 2024 11:57:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712836630; cv=none; b=s5Qj7cuTWDouysMG3+1mdCjgaTevZ5c/+31V/KtV5IaegUF4JNQEzubawb8it7qZLcoE0wJyeazoKGWvED8r1wgyUZoj6pHJT/OY5oq/nv2U9oPT20E1d9bh702y/YjcmDIl8izn4sLoPykGsLaoe3Q3uBQpUCijYuDMn8gMuqU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712836630; c=relaxed/simple; bh=/EHMPJY0NFe5Dbv3rrgKk5uP5iHNJUMUYb7il9F09YA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=kGi+SD+o9gqrtPaduNwjLfNDJaDeQaTY/ZoWqela9i0SSO1Bdbry3p4MXC3zOvQtPtS0t0oZc9u3EhA7JApNR9OF1ZzuGXVenRRfYZiDzLxJGqaYO6G13+p592l9a5ilcvOtJayk9ODDgyy5sohs3G/zY7qV3pJ49TxayLIwEbE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=LHCNT2q6; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from [192.168.1.105] (unknown [103.251.226.65]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 3452B23F; Thu, 11 Apr 2024 13:56:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1712836584; bh=/EHMPJY0NFe5Dbv3rrgKk5uP5iHNJUMUYb7il9F09YA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=LHCNT2q6eGtXii1KQZgY0UgAGxIFTsB+UTyXzplj/eHAifzzXkVMkCTd967FBAuxw aQHCnfAe8flZLqkWxlIn2eFYmptR4py5Qey1VMS9HG9TX0EHrMboB5Jxj1eq7RFQYg 1LNnkcuQ7rEq6u183bvumM9J1quhP4sz9hAexUvA= Message-ID: Date: Thu, 11 Apr 2024 17:26:58 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 9/9] media: subdev: Support single-stream case in v4l2_subdev_enable/disable_streams() Content-Language: en-US To: Tomi Valkeinen Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Mauro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Sakari Ailus References: <20240410-enable-streams-impro-v3-0-e5e7a5da7420@ideasonboard.com> <20240410-enable-streams-impro-v3-9-e5e7a5da7420@ideasonboard.com> <72940e89-0384-4fd3-8a10-42d6db44fdf0@ideasonboard.com> <155bb2c2-21b9-48d5-9615-7a44d4b6a590@ideasonboard.com> From: Umang Jain In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Hi Tomi On 11/04/24 5:23 pm, Tomi Valkeinen wrote: > On 11/04/2024 14:48, Umang Jain wrote: >> Hi Tomi, >> >> On 11/04/24 4:37 pm, Tomi Valkeinen wrote: >>> On 11/04/2024 14:02, Umang Jain wrote: >>>> Hi Tomi, >>>> >>>> On 10/04/24 6:05 pm, Tomi Valkeinen wrote: >>>>> At the moment the v4l2_subdev_enable/disable_streams() functions call >>>>> fallback helpers to handle the case where the subdev only implements >>>>> .s_stream(), and the main function handles the case where the subdev >>>>> implements streams (V4L2_SUBDEV_FL_STREAMS, which implies >>>>> .enable/disable_streams()). >>>>> >>>>> What is missing is support for subdevs which do not implement streams >>>>> support, but do implement .enable/disable_streams(). Example cases of >>>>> these subdevices are single-stream cameras, where using >>>>> .enable/disable_streams() is not required but helps us remove the >>>>> users >>>>> of the legacy .s_stream(), and subdevices with multiple source >>>>> pads (but >>>>> single stream per pad), where .enable/disable_streams() allows the >>>>> subdevice to control the enable/disable state per pad. >>>>> >>>>> The two single-streams cases (.s_stream() and >>>>> .enable/disable_streams()) >>>>> are very similar, and with small changes we can change the >>>>> v4l2_subdev_enable/disable_streams() functions to support all three >>>>> cases, without needing separate fallback functions. >>>>> >>>>> A few potentially problematic details, though: >>>> >>>> Does this mean the patch needs to be worked upon more ? >>> >>> I don't see the two issues below as blockers. >>> >>>> I quickly tested the series by applying it locally with my use case >>>> of IMX283 .enable/disable streams and s_stream as the helper >>>> function and it seems I am still seeing the same behaviour as >>>> before (i.e. not being streamed) and have to carry the workaround >>>> as mentioned in [1] **NOTE** >>> >>> Ok... Then something bugs here, as it is supposed to fix the >>> problem. Can you trace the code a bit to see where it goes wrong? >>> >>> The execution should go to the "if (!(sd->flags & >>> V4L2_SUBDEV_FL_STREAMS))" blocks in v4l2_subdev_collect_streams() >>> and v4l2_subdev_set_streams_enabled(), >> >> The execution is not reaching in v4l2_subdev_collect streams() even, >> it returns at >> >>      if (!streams_mask) >>                  return 0; >> >> in v4l2_subdev_enable_streams() >> >> Refer to : https://paste.debian.net/1313760/ >> >> My tree is based on v6.8 currently, but the series applies cleanly, >> so I have not introduced any  rebase artifacts. If you think, v6.8 >> might be causing issues, I'll then try to test on RPi 5 with the >> latest media tree perhaps. > > So who is calling the v4l2_subdev_enable_streams? I presume it comes > from v4l2_subdev_s_stream_helper(), in other words the sink side in > your pipeline is using legacy s_stream? Yes it comes from the helper function static const struct v4l2_subdev_video_ops imx283_video_ops = {         .s_stream = v4l2_subdev_s_stream_helper, }; > > Indeed, that helper still needs work. It needs to detect if there's no > routing, and use the implicit stream 0. I missed that one. Yes, no routing in the driver. > >  Tomi >