From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65516C7EE26 for ; Mon, 8 May 2023 10:34:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234797AbjEHKev (ORCPT ); Mon, 8 May 2023 06:34:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234808AbjEHKeR (ORCPT ); Mon, 8 May 2023 06:34:17 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 780D1170E for ; Mon, 8 May 2023 03:33:28 -0700 (PDT) Received: from [192.168.88.20] (91-154-35-171.elisa-laajakaista.fi [91.154.35.171]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 23EE7755; Mon, 8 May 2023 12:33:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1683542001; bh=MA5yPih+wEsLs1ip+Z26MU79e/aP1sjwSUyDKNxDYtU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=gRx9wr/gbKP38qJxXTeGh2LvY8feZly2Hnr7q3NghBe7hSDObyLD3x1NIlVa9fvrn pZpyk8hOM+xXWqQbH3Yl4J2QFzFduStaVOZdW188Q1zP5TrMqdOA8BEjI+QqwUCPG1 hy/fbGaLfQxEvBGPcw92zNtiaq+URnQyBtfFkji4= Message-ID: <5b7038ce-d897-931f-2c6e-30bdd1a30342@ideasonboard.com> Date: Mon, 8 May 2023 13:33:24 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [RFC 3/7] media: uapi: v4l: Document source routes Content-Language: en-US To: Sakari Ailus , linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, bingbu.cao@intel.com, hongju.wang@intel.com References: <20230505215257.60704-1-sakari.ailus@linux.intel.com> <20230505215257.60704-4-sakari.ailus@linux.intel.com> From: Tomi Valkeinen In-Reply-To: <20230505215257.60704-4-sakari.ailus@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org On 06/05/2023 00:52, Sakari Ailus wrote: > Document how internal pads are used on source routes. > > Signed-off-by: Sakari Ailus > --- > .../userspace-api/media/v4l/dev-subdev.rst | 18 ++++++++++++++++++ > .../media/v4l/vidioc-subdev-g-routing.rst | 5 +++++ > include/uapi/linux/v4l2-subdev.h | 6 +++++- > 3 files changed, 28 insertions(+), 1 deletion(-) > > diff --git a/Documentation/userspace-api/media/v4l/dev-subdev.rst b/Documentation/userspace-api/media/v4l/dev-subdev.rst > index a4f1df7093e8..395e06d2f0f2 100644 > --- a/Documentation/userspace-api/media/v4l/dev-subdev.rst > +++ b/Documentation/userspace-api/media/v4l/dev-subdev.rst > @@ -551,6 +551,24 @@ A stream at a specific point in the media pipeline is identified by the > sub-device and a (pad, stream) pair. For sub-devices that do not support > multiplexed streams the 'stream' field is always 0. > > +.. _v4l2-subdev-source-routes: > + > +Source routes > +^^^^^^^^^^^^^ > + > +Cases where a single sub-device pad is a source of multiple streams are special > +as there is no sink pad for such a route. In those cases, an internal pad is > +used as the sink pad. Such pads have the :ref:`MEDIA_PAD_FL_INTERNAL_SOURCE > +` flag set. > + > +Internal pads have all the properties of a sink pad in such case, including > +formats and selections. The format in this case is the source format of the > +stream. An internal pad always has a single stream only (0). > + > +Generally source routes are not modifiable but they can be activated and > +inactivated using the :ref:`V4L2_SUBDEV_ROUTE_FL_ACTIVE > +` flag, depending on driver capabilities. > + I find the above chapter a bit difficult to read, but I think we need to conclude on the internal-pad vs internal-source-pad discussion first. However, one point/question: You write that there's only one stream in an internal pad. I wonder if that's a good or a necessary limitation... Do you see that allowing multiple streams brings extra complexity? It's still up to each driver to decide how many streams they support (most would just support a single one), so each driver can easily enforce that limit. I'm fine with starting with only single-stream support, but if we later need to loosen that restriction, I wonder if it'll be difficult if we have specified that there can be only one stream. I.e. will the drivers and the userspace depend on that limit. Tomi