[{"id":21773,"web_url":"https://patchwork.libcamera.org/comment/21773/","msgid":"<202112141239.xdqTNOOD-lkp@intel.com>","date":"2021-12-14T04:06:44","subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","submitter":{"id":45,"url":"https://patchwork.libcamera.org/api/people/45/","name":"kernel test robot","email":"lkp@intel.com"},"content":"Hi Daniel,\n\nI love your patch! Perhaps something to improve:\n\n[auto build test WARNING on media-tree/master]\n[also build test WARNING on v5.16-rc5]\n[If your patch is applied to the wrong git tree, kindly drop us a note.\nAnd when submitting patch, we suggest to use '--base' as documented in\nhttps://git-scm.com/docs/git-format-patch]\n\nurl:    https://github.com/0day-ci/linux/commits/Daniel-Scally/Introduce-ancillary-links/20211214-073020\nbase:   git://linuxtv.org/media_tree.git master\nconfig: i386-buildonly-randconfig-r003-20211213 (https://download.01.org/0day-ci/archive/20211214/202112141239.xdqTNOOD-lkp@intel.com/config)\ncompiler: clang version 14.0.0 (https://github.com/llvm/llvm-project b6a2ddb6c8ac29412b1361810972e15221fa021c)\nreproduce (this is a W=1 build):\n        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross\n        chmod +x ~/bin/make.cross\n        # https://github.com/0day-ci/linux/commit/627c8446267d301ed36953f7e4fa616ab6cb771a\n        git remote add linux-review https://github.com/0day-ci/linux\n        git fetch --no-tags linux-review Daniel-Scally/Introduce-ancillary-links/20211214-073020\n        git checkout 627c8446267d301ed36953f7e4fa616ab6cb771a\n        # save the config file to linux build tree\n        mkdir build_dir\n        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=i386 SHELL=/bin/bash drivers/media/mc/\n\nIf you fix the issue, kindly add following tag as appropriate\nReported-by: kernel test robot <lkp@intel.com>\n\nAll warnings (new ones prefixed by >>):\n\n>> drivers/media/mc/mc-entity.c:1062:6: warning: no previous prototype for function 'media_remove_ancillary_link' [-Wmissing-prototypes]\n   void media_remove_ancillary_link(struct media_link *link)\n        ^\n   drivers/media/mc/mc-entity.c:1062:1: note: declare 'static' if the function is not intended to be used outside of this translation unit\n   void media_remove_ancillary_link(struct media_link *link)\n   ^\n   static \n   drivers/media/mc/mc-entity.c:17:27: warning: unused function 'intf_type' [-Wunused-function]\n   static inline const char *intf_type(struct media_interface *intf)\n                             ^\n   2 warnings generated.\n\n\nvim +/media_remove_ancillary_link +1062 drivers/media/mc/mc-entity.c\n\n  1061\t\n> 1062\tvoid media_remove_ancillary_link(struct media_link *link)\n\n---\n0-DAY CI Kernel Test Service, Intel Corporation\nhttps://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org","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 23FA4BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Dec 2021 04:32:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 084406087E;\n\tTue, 14 Dec 2021 05:32:29 +0100 (CET)","from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6B6B760113\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 05:07:13 +0100 (CET)","from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; \n\t13 Dec 2021 20:07:11 -0800","from lkp-server02.sh.intel.com (HELO 9e1e9f9b3bcb)\n\t([10.239.97.151])\n\tby fmsmga005.fm.intel.com with ESMTP; 13 Dec 2021 20:07:08 -0800","from kbuild by 9e1e9f9b3bcb with local (Exim 4.92)\n\t(envelope-from <lkp@intel.com>)\n\tid 1mwz5o-0007QA-1K; Tue, 14 Dec 2021 04:07:08 +0000"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=intel.com header.i=@intel.com\n\theader.b=\"EzbHLLb6\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=simple/simple;\n\td=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n\tt=1639454833; x=1670990833;\n\th=date:from:to:cc:subject:message-id:references:\n\tmime-version:in-reply-to;\n\tbh=idGga7JHsTTNGwOM4gkNNjAONgZTkfZEFF35dWQ/gXI=;\n\tb=EzbHLLb6tn+Tg/D/0X8XorwtlJ2e8rEZ1E4TGYxux64xRWPqJJ0EqN8A\n\t2Xi4pe/v3x39sUi4Ua1spHslByWNtE6nlaoXPZfi8z+sCH+nmlzVzr+Mf\n\tFHD/JQTLsfzI+Dm7H6p4fApVsXJfQJuqwR7sMbX2QpONJKg2jte3Q8dTu\n\tumnn5WAjozWmQmMmr+zcirdnr0TpLfbylpecfEBghzKzaI3q4CgDqQcMi\n\t8V8d41mVtdfdkBSFQ71SDsR1+2XpbQpd1Mu/L27w9BWWGItzJxZUXu/bP\n\taQRYpG/Ykwt1UaBlIMCITO7wsm6aQuy45KazUrso0eX4IADrreWc1NfrH g==;","X-IronPort-AV":["E=McAfee;i=\"6200,9189,10197\"; a=\"218908100\"","E=Sophos;i=\"5.88,204,1635231600\"; d=\"scan'208\";a=\"218908100\"","E=Sophos;i=\"5.88,204,1635231600\"; d=\"scan'208\";a=\"754693591\""],"X-ExtLoop1":"1","Date":"Tue, 14 Dec 2021 12:06:44 +0800","From":"kernel test robot <lkp@intel.com>","To":"Daniel Scally <djrscally@gmail.com>, linux-media@vger.kernel.org,\n\tlibcamera-devel@lists.libcamera.org","Message-ID":"<202112141239.xdqTNOOD-lkp@intel.com>","References":"<20211213232849.40071-5-djrscally@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20211213232849.40071-5-djrscally@gmail.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","X-Mailman-Approved-At":"Tue, 14 Dec 2021 05:32:27 +0100","Subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","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":"kbuild-all@lists.01.org, llvm@lists.linux.dev,\n\tsakari.ailus@linux.intel.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21781,"web_url":"https://patchwork.libcamera.org/comment/21781/","msgid":"<YbkL2V24TFdA5KHx@paasikivi.fi.intel.com>","date":"2021-12-14T21:25:45","subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","submitter":{"id":37,"url":"https://patchwork.libcamera.org/api/people/37/","name":"Sakari Ailus","email":"sakari.ailus@linux.intel.com"},"content":"Hi Daniel,\n\nOn Mon, Dec 13, 2021 at 11:28:48PM +0000, Daniel Scally wrote:\n> Add functions to create and destroy ancillary links, so that they\n> don't need to be manually created by users.\n> \n> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> ---\n> Changes since the rfc:\n> \n> \t- (Laurent) Set gobj0 and gobj1 directly instead of the other union\n> \tmembers\n> \t- (Laurent) Added MEDIA_LNK_FL_IMMUTABLE to the kerneldoc for the new\n> \tcreate function\n> \n>  drivers/media/mc/mc-entity.c | 30 ++++++++++++++++++++++++++++++\n>  include/media/media-entity.h | 29 +++++++++++++++++++++++++++++\n>  2 files changed, 59 insertions(+)\n> \n> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n> index aeddc3f6310e..4e39e100ea03 100644\n> --- a/drivers/media/mc/mc-entity.c\n> +++ b/drivers/media/mc/mc-entity.c\n> @@ -1052,3 +1052,33 @@ void media_remove_intf_links(struct media_interface *intf)\n>  \tmutex_unlock(&mdev->graph_mutex);\n>  }\n>  EXPORT_SYMBOL_GPL(media_remove_intf_links);\n> +\n> +struct media_link *media_create_ancillary_link(struct media_entity *primary,\n> +\t\t\t\t\t       struct media_entity *ancillary,\n> +\t\t\t\t\t       u32 flags)\n> +{\n> +\tstruct media_link *link;\n> +\n> +\tlink = media_add_link(&primary->links);\n> +\tif (!link)\n> +\t\treturn ERR_PTR(-ENOMEM);\n> +\n> +\tlink->gobj0 = &primary->graph_obj;\n> +\tlink->gobj1 = &ancillary->graph_obj;\n> +\tlink->flags = flags | MEDIA_LNK_FL_ANCILLARY_LINK;\n> +\n> +\t/* Initialize graph object embedded at the new link */\n> +\tmedia_gobj_create(primary->graph_obj.mdev, MEDIA_GRAPH_LINK,\n> +\t\t\t  &link->graph_obj);\n> +\n> +\treturn link;\n> +}\n> +EXPORT_SYMBOL_GPL(media_create_ancillary_link);\n> +\n> +void media_remove_ancillary_link(struct media_link *link)\n> +{\n> +\tlist_del(&link->list);\n> +\tmedia_gobj_destroy(&link->graph_obj);\n> +\tkfree(link);\n> +}\n> +EXPORT_SYMBOL_GPL(media_remove_ancillary_link);\n> diff --git a/include/media/media-entity.h b/include/media/media-entity.h\n> index fea489f03d57..f7b1738cef88 100644\n> --- a/include/media/media-entity.h\n> +++ b/include/media/media-entity.h\n> @@ -1104,6 +1104,35 @@ void media_remove_intf_links(struct media_interface *intf);\n>   * it will issue a call to @operation\\(@entity, @args\\).\n>   */\n>  \n> +/**\n> + * media_create_ancillary_link() - creates a link between two entities\n> + *\n> + * @primary:\tpointer to the primary &media_entity\n> + * @ancillary:\tpointer to the ancillary &media_entity\n> + * @flags:\tLink flags, as defined in\n> + *\t\t:ref:`include/uapi/linux/media.h <media_header>`\n> + *\t\t( seek for ``MEDIA_LNK_FL_*``)\n> + *\n> + *\n> + * Valid values for flags:\n> + *\n> + * %MEDIA_LNK_FL_ENABLED\n> + *   Indicates that the two entities are connected pieces of hardware that form\n> + *   a single logical unit.\n> + *\n> + *   A typical example is a camera lens being linked to the sensor that it is\n> + *   supporting.\n> + *\n> + * %MEDIA_LNK_FL_IMMUTABLE\n> + *   Indicates that the link enabled state can't be modified at runtime. If\n> + *   %MEDIA_LNK_FL_IMMUTABLE is set, then %MEDIA_LNK_FL_ENABLED must also be\n> + *   set, since an immutable link is always enabled.\n\nWhat's the use case for both of the flags?\n\nI know the flags are there but what will they mean in practice for\nancillary links?\n\n> + */\n> +struct media_link *\n> +media_create_ancillary_link(struct media_entity *primary,\n> +\t\t\t    struct media_entity *ancillary,\n> +\t\t\t    u32 flags);\n> +\n>  #define media_entity_call(entity, operation, args...)\t\t\t\\\n>  \t(((entity)->ops && (entity)->ops->operation) ?\t\t\t\\\n>  \t (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)","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 31E71BF415\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Dec 2021 21:26:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 76C6B608E5;\n\tTue, 14 Dec 2021 22:26:09 +0100 (CET)","from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C998A605A7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 22:26:06 +0100 (CET)","from orsmga005.jf.intel.com ([10.7.209.41])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; \n\t14 Dec 2021 13:25:50 -0800","from paasikivi.fi.intel.com ([10.237.72.42])\n\tby orsmga005-auth.jf.intel.com with\n\tESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Dec 2021 13:25:47 -0800","from paasikivi.fi.intel.com (localhost [127.0.0.1])\n\tby paasikivi.fi.intel.com (Postfix) with SMTP id 584A4200D3;\n\tTue, 14 Dec 2021 23:25:45 +0200 (EET)"],"X-IronPort-AV":["E=McAfee;i=\"6200,9189,10197\"; a=\"226366723\"","E=Sophos;i=\"5.88,206,1635231600\"; d=\"scan'208\";a=\"226366723\"","E=Sophos;i=\"5.88,206,1635231600\"; d=\"scan'208\";a=\"682225526\""],"Date":"Tue, 14 Dec 2021 23:25:45 +0200","From":"Sakari Ailus <sakari.ailus@linux.intel.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<YbkL2V24TFdA5KHx@paasikivi.fi.intel.com>","References":"<20211213232849.40071-1-djrscally@gmail.com>\n\t<20211213232849.40071-5-djrscally@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","In-Reply-To":"<20211213232849.40071-5-djrscally@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","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@lists.libcamera.org, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21786,"web_url":"https://patchwork.libcamera.org/comment/21786/","msgid":"<6929c5a8-67dc-77c6-459e-6ce26a08fb73@gmail.com>","date":"2021-12-14T21:54:32","subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","submitter":{"id":90,"url":"https://patchwork.libcamera.org/api/people/90/","name":"Daniel Scally","email":"djrscally@gmail.com"},"content":"Hi Sakari\n\nOn 14/12/2021 21:25, Sakari Ailus wrote:\n> Hi Daniel,\n>\n> On Mon, Dec 13, 2021 at 11:28:48PM +0000, Daniel Scally wrote:\n>> Add functions to create and destroy ancillary links, so that they\n>> don't need to be manually created by users.\n>>\n>> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n>> ---\n>> Changes since the rfc:\n>>\n>> \t- (Laurent) Set gobj0 and gobj1 directly instead of the other union\n>> \tmembers\n>> \t- (Laurent) Added MEDIA_LNK_FL_IMMUTABLE to the kerneldoc for the new\n>> \tcreate function\n>>\n>>  drivers/media/mc/mc-entity.c | 30 ++++++++++++++++++++++++++++++\n>>  include/media/media-entity.h | 29 +++++++++++++++++++++++++++++\n>>  2 files changed, 59 insertions(+)\n>>\n>> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n>> index aeddc3f6310e..4e39e100ea03 100644\n>> --- a/drivers/media/mc/mc-entity.c\n>> +++ b/drivers/media/mc/mc-entity.c\n>> @@ -1052,3 +1052,33 @@ void media_remove_intf_links(struct media_interface *intf)\n>>  \tmutex_unlock(&mdev->graph_mutex);\n>>  }\n>>  EXPORT_SYMBOL_GPL(media_remove_intf_links);\n>> +\n>> +struct media_link *media_create_ancillary_link(struct media_entity *primary,\n>> +\t\t\t\t\t       struct media_entity *ancillary,\n>> +\t\t\t\t\t       u32 flags)\n>> +{\n>> +\tstruct media_link *link;\n>> +\n>> +\tlink = media_add_link(&primary->links);\n>> +\tif (!link)\n>> +\t\treturn ERR_PTR(-ENOMEM);\n>> +\n>> +\tlink->gobj0 = &primary->graph_obj;\n>> +\tlink->gobj1 = &ancillary->graph_obj;\n>> +\tlink->flags = flags | MEDIA_LNK_FL_ANCILLARY_LINK;\n>> +\n>> +\t/* Initialize graph object embedded at the new link */\n>> +\tmedia_gobj_create(primary->graph_obj.mdev, MEDIA_GRAPH_LINK,\n>> +\t\t\t  &link->graph_obj);\n>> +\n>> +\treturn link;\n>> +}\n>> +EXPORT_SYMBOL_GPL(media_create_ancillary_link);\n>> +\n>> +void media_remove_ancillary_link(struct media_link *link)\n>> +{\n>> +\tlist_del(&link->list);\n>> +\tmedia_gobj_destroy(&link->graph_obj);\n>> +\tkfree(link);\n>> +}\n>> +EXPORT_SYMBOL_GPL(media_remove_ancillary_link);\n>> diff --git a/include/media/media-entity.h b/include/media/media-entity.h\n>> index fea489f03d57..f7b1738cef88 100644\n>> --- a/include/media/media-entity.h\n>> +++ b/include/media/media-entity.h\n>> @@ -1104,6 +1104,35 @@ void media_remove_intf_links(struct media_interface *intf);\n>>   * it will issue a call to @operation\\(@entity, @args\\).\n>>   */\n>>  \n>> +/**\n>> + * media_create_ancillary_link() - creates a link between two entities\n>> + *\n>> + * @primary:\tpointer to the primary &media_entity\n>> + * @ancillary:\tpointer to the ancillary &media_entity\n>> + * @flags:\tLink flags, as defined in\n>> + *\t\t:ref:`include/uapi/linux/media.h <media_header>`\n>> + *\t\t( seek for ``MEDIA_LNK_FL_*``)\n>> + *\n>> + *\n>> + * Valid values for flags:\n>> + *\n>> + * %MEDIA_LNK_FL_ENABLED\n>> + *   Indicates that the two entities are connected pieces of hardware that form\n>> + *   a single logical unit.\n>> + *\n>> + *   A typical example is a camera lens being linked to the sensor that it is\n>> + *   supporting.\n>> + *\n>> + * %MEDIA_LNK_FL_IMMUTABLE\n>> + *   Indicates that the link enabled state can't be modified at runtime. If\n>> + *   %MEDIA_LNK_FL_IMMUTABLE is set, then %MEDIA_LNK_FL_ENABLED must also be\n>> + *   set, since an immutable link is always enabled.\n> What's the use case for both of the flags?\n>\n> I know the flags are there but what will they mean in practice for\n> ancillary links?\n\n\nWithin the kernel, I don't think they have any effect now (without patch\n#3 of this series the graph iteration would have tried to walk them). I\nmostly intended that they would be set so that future userspace users\nwouldn't be able to flag them as disabled.\n\n>\n>> + */\n>> +struct media_link *\n>> +media_create_ancillary_link(struct media_entity *primary,\n>> +\t\t\t    struct media_entity *ancillary,\n>> +\t\t\t    u32 flags);\n>> +\n>>  #define media_entity_call(entity, operation, args...)\t\t\t\\\n>>  \t(((entity)->ops && (entity)->ops->operation) ?\t\t\t\\\n>>  \t (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)","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 0B150BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Dec 2021 21:54:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B6677608A4;\n\tTue, 14 Dec 2021 22:54:34 +0100 (CET)","from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n\t[IPv6:2a00:1450:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2AD7260117\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 22:54:34 +0100 (CET)","by mail-wr1-x436.google.com with SMTP id c4so34751690wrd.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 13:54:34 -0800 (PST)","from [192.168.0.14]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161])\n\tby smtp.gmail.com with ESMTPSA id\n\tu15sm60513wmq.13.2021.12.14.13.54.33\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tTue, 14 Dec 2021 13:54:33 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"L2UFJvQI\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-transfer-encoding:content-language; \n\tbh=OkzGY8qIcdE8QjlVTYFUUUX4yC1Sk5o0DS20lJVrn8Y=;\n\tb=L2UFJvQIWO+RuG9g0p1ssehh8PzZ0IMi8HyuvpjDVw7i6LfHHPJEvyCjOOH3Q2izGz\n\tir9jWpmAw+c3aFU36Q3t+84Uwqh7HjjSo2JjAcTfOvmp/kJ/c6bH7IcKcziB4Herg7hI\n\tkWxJ9HQyZu5PdsH8xB7DGSm5XdBZT6TtwsLgMosZHap7XPAB0rU+M7aiaYm/8iHkTmye\n\t+JEbZU2j1vVV9fweChPiGQrjWSmRdC+46MVh9/W32fjrYFnRwXnaLrPx3jW6/Kv07mf6\n\tnnBR9iChcBdnEtzLHcqhvW3cD8z5zLZwUM7/7jq0m7h6LQNynanyQYgqHAzFt8FPQ4ew\n\tGqKQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-transfer-encoding\n\t:content-language;\n\tbh=OkzGY8qIcdE8QjlVTYFUUUX4yC1Sk5o0DS20lJVrn8Y=;\n\tb=fnDnMoCDEV/PYnE1xuqyNfZov+mgtTCgR/7ufttGBYRQUFBBGMKaUoDaBbl/8oQwly\n\tjDu/iIedB4RY8JLuKu1s7hNJMEeeDXyg5dfY7p+CmRrzwrH8x+yjr4iVpPG2FWjG/Pkx\n\taRJZI38lAKOMM2PKFCmbmSLqXpfTMkQTipRcZOjD7+L8uHdVMX9Me/7zSaqQzo5k6aXO\n\te2Xl7fVyzZcaBohOXeAx+G1hSpFBwthl/yJ9xbtWAwiHdWzzI7wOlPYS6Am6aIHIRLnz\n\taAua1uCAiITq9oMX2zRbHzA+B59VaCeGLcctCFoZWZz5EWEtu90z3n1Tl/iDNlWRhmH2\n\tMRAg==","X-Gm-Message-State":"AOAM5337Wlkr0KKnMUWobIpA0Jhpjh3SS5dIJLDJRzVxap+R4vWo7Ob4\n\twfOqt4Wadz02H7pmq0YThnM=","X-Google-Smtp-Source":"ABdhPJx5ZrSoVAaqO63O8NM105t3zoIQMIqIKDoHW6GxRUmlv7J/TuWclmekA098csFWt9JZqur7HA==","X-Received":"by 2002:adf:f587:: with SMTP id f7mr1654733wro.671.1639518873950;\n\tTue, 14 Dec 2021 13:54:33 -0800 (PST)","To":"Sakari Ailus <sakari.ailus@linux.intel.com>","References":"<20211213232849.40071-1-djrscally@gmail.com>\n\t<20211213232849.40071-5-djrscally@gmail.com>\n\t<YbkL2V24TFdA5KHx@paasikivi.fi.intel.com>","From":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<6929c5a8-67dc-77c6-459e-6ce26a08fb73@gmail.com>","Date":"Tue, 14 Dec 2021 21:54:32 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.14.0","MIME-Version":"1.0","In-Reply-To":"<YbkL2V24TFdA5KHx@paasikivi.fi.intel.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","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@lists.libcamera.org, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":21789,"web_url":"https://patchwork.libcamera.org/comment/21789/","msgid":"<YbkXRs/RUnc/JmAZ@pendragon.ideasonboard.com>","date":"2021-12-14T22:14:30","subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Daniel,\n\nThank you for the patch.\n\nOn Tue, Dec 14, 2021 at 09:54:32PM +0000, Daniel Scally wrote:\n> On 14/12/2021 21:25, Sakari Ailus wrote:\n> > On Mon, Dec 13, 2021 at 11:28:48PM +0000, Daniel Scally wrote:\n> >> Add functions to create and destroy ancillary links, so that they\n> >> don't need to be manually created by users.\n> >>\n> >> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n> >> ---\n> >> Changes since the rfc:\n> >>\n> >> \t- (Laurent) Set gobj0 and gobj1 directly instead of the other union\n> >> \tmembers\n> >> \t- (Laurent) Added MEDIA_LNK_FL_IMMUTABLE to the kerneldoc for the new\n> >> \tcreate function\n> >>\n> >>  drivers/media/mc/mc-entity.c | 30 ++++++++++++++++++++++++++++++\n> >>  include/media/media-entity.h | 29 +++++++++++++++++++++++++++++\n> >>  2 files changed, 59 insertions(+)\n> >>\n> >> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n> >> index aeddc3f6310e..4e39e100ea03 100644\n> >> --- a/drivers/media/mc/mc-entity.c\n> >> +++ b/drivers/media/mc/mc-entity.c\n> >> @@ -1052,3 +1052,33 @@ void media_remove_intf_links(struct media_interface *intf)\n> >>  \tmutex_unlock(&mdev->graph_mutex);\n> >>  }\n> >>  EXPORT_SYMBOL_GPL(media_remove_intf_links);\n> >> +\n> >> +struct media_link *media_create_ancillary_link(struct media_entity *primary,\n> >> +\t\t\t\t\t       struct media_entity *ancillary,\n> >> +\t\t\t\t\t       u32 flags)\n> >> +{\n> >> +\tstruct media_link *link;\n> >> +\n> >> +\tlink = media_add_link(&primary->links);\n\nNot a candidate for this series, but returning an error pointer from\nmedia_add_link() could be nice.\n\n> >> +\tif (!link)\n> >> +\t\treturn ERR_PTR(-ENOMEM);\n> >> +\n> >> +\tlink->gobj0 = &primary->graph_obj;\n> >> +\tlink->gobj1 = &ancillary->graph_obj;\n> >> +\tlink->flags = flags | MEDIA_LNK_FL_ANCILLARY_LINK;\n> >> +\n> >> +\t/* Initialize graph object embedded at the new link */\n\ns/embedded at/embedded in/ ?\n\n> >> +\tmedia_gobj_create(primary->graph_obj.mdev, MEDIA_GRAPH_LINK,\n> >> +\t\t\t  &link->graph_obj);\n> >> +\n> >> +\treturn link;\n> >> +}\n> >> +EXPORT_SYMBOL_GPL(media_create_ancillary_link);\n> >> +\n> >> +void media_remove_ancillary_link(struct media_link *link)\n> >> +{\n> >> +\tlist_del(&link->list);\n> >> +\tmedia_gobj_destroy(&link->graph_obj);\n> >> +\tkfree(link);\n> >> +}\n> >> +EXPORT_SYMBOL_GPL(media_remove_ancillary_link);\n\nNon-static (and especially exported) functions must be declared in a\nheader file. You don't seem to use this function anywhere in this series\nthough, is it a leftover ?\n\n> >> diff --git a/include/media/media-entity.h b/include/media/media-entity.h\n> >> index fea489f03d57..f7b1738cef88 100644\n> >> --- a/include/media/media-entity.h\n> >> +++ b/include/media/media-entity.h\n> >> @@ -1104,6 +1104,35 @@ void media_remove_intf_links(struct media_interface *intf);\n> >>   * it will issue a call to @operation\\(@entity, @args\\).\n> >>   */\n> >>  \n> >> +/**\n> >> + * media_create_ancillary_link() - creates a link between two entities\n\ns/link/ancillary link/\n\n> >> + *\n> >> + * @primary:\tpointer to the primary &media_entity\n> >> + * @ancillary:\tpointer to the ancillary &media_entity\n> >> + * @flags:\tLink flags, as defined in\n> >> + *\t\t:ref:`include/uapi/linux/media.h <media_header>`\n> >> + *\t\t( seek for ``MEDIA_LNK_FL_*``)\n> >> + *\n> >> + *\n> >> + * Valid values for flags:\n> >> + *\n> >> + * %MEDIA_LNK_FL_ENABLED\n> >> + *   Indicates that the two entities are connected pieces of hardware that form\n> >> + *   a single logical unit.\n> >> + *\n> >> + *   A typical example is a camera lens being linked to the sensor that it is\n> >> + *   supporting.\n> >> + *\n> >> + * %MEDIA_LNK_FL_IMMUTABLE\n> >> + *   Indicates that the link enabled state can't be modified at runtime. If\n> >> + *   %MEDIA_LNK_FL_IMMUTABLE is set, then %MEDIA_LNK_FL_ENABLED must also be\n> >> + *   set, since an immutable link is always enabled.\n> >\n> > What's the use case for both of the flags?\n> >\n> > I know the flags are there but what will they mean in practice for\n> > ancillary links?\n> \n> Within the kernel, I don't think they have any effect now (without patch\n> #3 of this series the graph iteration would have tried to walk them). I\n> mostly intended that they would be set so that future userspace users\n> wouldn't be able to flag them as disabled.\n\nHow about removing the flags parameter, hardcoding both\nMEDIA_LNK_FL_ENABLED and MEDIA_LNK_FL_IMMUTABLE inside the function, and\nspecifying in the userspace API documentation that both flags are always\nset of ancillary links ?\n\nThinking a bit further, what would be the implications of changing this\nrule in the future ? I don't know what use cases may require that, but\nlet's assume we start exposing mutable ancillary links, or mutable and\ndisabled ancillary links. How will existing userspace react to that, do\nwe need to specify rules in the uAPI documentation to tell userspace how\nto prepare for the future ?\n\n> >> + */\n> >> +struct media_link *\n> >> +media_create_ancillary_link(struct media_entity *primary,\n> >> +\t\t\t    struct media_entity *ancillary,\n> >> +\t\t\t    u32 flags);\n> >> +\n> >>  #define media_entity_call(entity, operation, args...)\t\t\t\\\n> >>  \t(((entity)->ops && (entity)->ops->operation) ?\t\t\t\\\n> >>  \t (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)","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 BF493BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Dec 2021 22:14:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F1AD2608A4;\n\tTue, 14 Dec 2021 23:14:34 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7BF5660117\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Dec 2021 23:14:33 +0100 (CET)","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 BC9948C4;\n\tTue, 14 Dec 2021 23:14:32 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"t5GXKCO9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1639520073;\n\tbh=vL3to66SXy2hA8z3FUzZARSIe8kt0thdsY0j1jCb6i4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=t5GXKCO9kFvS1JdXCdTsNzoCV6DqFBKrQQ3jhxUntF5ztH7ZFdxdiDwM5NDKvizeB\n\toa+b6aQlRwYn+lUfnD8LXIwM3TlHAkeCRcCFrSS21RJNhq074z4yR8SAhwBqtcDSI0\n\tAnTxINr2DaUl1lq2Kzs3HZCRcPHryoHrJJO+wHy8=","Date":"Wed, 15 Dec 2021 00:14:30 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<YbkXRs/RUnc/JmAZ@pendragon.ideasonboard.com>","References":"<20211213232849.40071-1-djrscally@gmail.com>\n\t<20211213232849.40071-5-djrscally@gmail.com>\n\t<YbkL2V24TFdA5KHx@paasikivi.fi.intel.com>\n\t<6929c5a8-67dc-77c6-459e-6ce26a08fb73@gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<6929c5a8-67dc-77c6-459e-6ce26a08fb73@gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","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@lists.libcamera.org,\n\tSakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":22038,"web_url":"https://patchwork.libcamera.org/comment/22038/","msgid":"<e99b42fe-e162-864a-c024-d0419a3f1ed2@gmail.com>","date":"2022-01-16T23:52:02","subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","submitter":{"id":90,"url":"https://patchwork.libcamera.org/api/people/90/","name":"Daniel Scally","email":"djrscally@gmail.com"},"content":"Hi Laurent, sorry - realised I never replied to this one\n\nOn 14/12/2021 22:14, Laurent Pinchart wrote:\n> Hi Daniel,\n>\n> Thank you for the patch.\n>\n> On Tue, Dec 14, 2021 at 09:54:32PM +0000, Daniel Scally wrote:\n>> On 14/12/2021 21:25, Sakari Ailus wrote:\n>>> On Mon, Dec 13, 2021 at 11:28:48PM +0000, Daniel Scally wrote:\n>>>> Add functions to create and destroy ancillary links, so that they\n>>>> don't need to be manually created by users.\n>>>>\n>>>> Signed-off-by: Daniel Scally <djrscally@gmail.com>\n>>>> ---\n>>>> Changes since the rfc:\n>>>>\n>>>> \t- (Laurent) Set gobj0 and gobj1 directly instead of the other union\n>>>> \tmembers\n>>>> \t- (Laurent) Added MEDIA_LNK_FL_IMMUTABLE to the kerneldoc for the new\n>>>> \tcreate function\n>>>>\n>>>>  drivers/media/mc/mc-entity.c | 30 ++++++++++++++++++++++++++++++\n>>>>  include/media/media-entity.h | 29 +++++++++++++++++++++++++++++\n>>>>  2 files changed, 59 insertions(+)\n>>>>\n>>>> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c\n>>>> index aeddc3f6310e..4e39e100ea03 100644\n>>>> --- a/drivers/media/mc/mc-entity.c\n>>>> +++ b/drivers/media/mc/mc-entity.c\n>>>> @@ -1052,3 +1052,33 @@ void media_remove_intf_links(struct media_interface *intf)\n>>>>  \tmutex_unlock(&mdev->graph_mutex);\n>>>>  }\n>>>>  EXPORT_SYMBOL_GPL(media_remove_intf_links);\n>>>> +\n>>>> +struct media_link *media_create_ancillary_link(struct media_entity *primary,\n>>>> +\t\t\t\t\t       struct media_entity *ancillary,\n>>>> +\t\t\t\t\t       u32 flags)\n>>>> +{\n>>>> +\tstruct media_link *link;\n>>>> +\n>>>> +\tlink = media_add_link(&primary->links);\n> Not a candidate for this series, but returning an error pointer from\n> media_add_link() could be nice.\n>\n>>>> +\tif (!link)\n>>>> +\t\treturn ERR_PTR(-ENOMEM);\n>>>> +\n>>>> +\tlink->gobj0 = &primary->graph_obj;\n>>>> +\tlink->gobj1 = &ancillary->graph_obj;\n>>>> +\tlink->flags = flags | MEDIA_LNK_FL_ANCILLARY_LINK;\n>>>> +\n>>>> +\t/* Initialize graph object embedded at the new link */\n> s/embedded at/embedded in/ ?\n>\n>>>> +\tmedia_gobj_create(primary->graph_obj.mdev, MEDIA_GRAPH_LINK,\n>>>> +\t\t\t  &link->graph_obj);\n>>>> +\n>>>> +\treturn link;\n>>>> +}\n>>>> +EXPORT_SYMBOL_GPL(media_create_ancillary_link);\n>>>> +\n>>>> +void media_remove_ancillary_link(struct media_link *link)\n>>>> +{\n>>>> +\tlist_del(&link->list);\n>>>> +\tmedia_gobj_destroy(&link->graph_obj);\n>>>> +\tkfree(link);\n>>>> +}\n>>>> +EXPORT_SYMBOL_GPL(media_remove_ancillary_link);\n> Non-static (and especially exported) functions must be declared in a\n> header file. You don't seem to use this function anywhere in this series\n> though, is it a leftover ?\n>\n>>>> diff --git a/include/media/media-entity.h b/include/media/media-entity.h\n>>>> index fea489f03d57..f7b1738cef88 100644\n>>>> --- a/include/media/media-entity.h\n>>>> +++ b/include/media/media-entity.h\n>>>> @@ -1104,6 +1104,35 @@ void media_remove_intf_links(struct media_interface *intf);\n>>>>   * it will issue a call to @operation\\(@entity, @args\\).\n>>>>   */\n>>>>  \n>>>> +/**\n>>>> + * media_create_ancillary_link() - creates a link between two entities\n> s/link/ancillary link/\n>\n>>>> + *\n>>>> + * @primary:\tpointer to the primary &media_entity\n>>>> + * @ancillary:\tpointer to the ancillary &media_entity\n>>>> + * @flags:\tLink flags, as defined in\n>>>> + *\t\t:ref:`include/uapi/linux/media.h <media_header>`\n>>>> + *\t\t( seek for ``MEDIA_LNK_FL_*``)\n>>>> + *\n>>>> + *\n>>>> + * Valid values for flags:\n>>>> + *\n>>>> + * %MEDIA_LNK_FL_ENABLED\n>>>> + *   Indicates that the two entities are connected pieces of hardware that form\n>>>> + *   a single logical unit.\n>>>> + *\n>>>> + *   A typical example is a camera lens being linked to the sensor that it is\n>>>> + *   supporting.\n>>>> + *\n>>>> + * %MEDIA_LNK_FL_IMMUTABLE\n>>>> + *   Indicates that the link enabled state can't be modified at runtime. If\n>>>> + *   %MEDIA_LNK_FL_IMMUTABLE is set, then %MEDIA_LNK_FL_ENABLED must also be\n>>>> + *   set, since an immutable link is always enabled.\n>>> What's the use case for both of the flags?\n>>>\n>>> I know the flags are there but what will they mean in practice for\n>>> ancillary links?\n>> Within the kernel, I don't think they have any effect now (without patch\n>> #3 of this series the graph iteration would have tried to walk them). I\n>> mostly intended that they would be set so that future userspace users\n>> wouldn't be able to flag them as disabled.\n> How about removing the flags parameter, hardcoding both\n> MEDIA_LNK_FL_ENABLED and MEDIA_LNK_FL_IMMUTABLE inside the function, and\n> specifying in the userspace API documentation that both flags are always\n> set of ancillary links ?\n\n\nThis is ok by me\n\n>\n> Thinking a bit further, what would be the implications of changing this\n> rule in the future ? I don't know what use cases may require that, but\n> let's assume we start exposing mutable ancillary links, or mutable and\n> disabled ancillary links. How will existing userspace react to that, do\n> we need to specify rules in the uAPI documentation to tell userspace how\n> to prepare for the future ?\n\n\nYeah maybe; at the moment my libcamera implementation wouldn't treat a\ndisabled link any differently, and for a lens at least I can't really\nsee any situation where a disabled link would be valid. Perhaps multiple\nLED drivers supporting the same sensor for different flash modes might\nbe a thing though, in which case it might be helpful to disable one of\nthe ancillary links so that you can flag a particular driver as the\nactive one, or something long those lines.\n\n\nSo perhaps the uAPI docs should explain that both ENABLED and IMMUTABLE\nare currently hardcoded, but that userspace should still check for an\nenabled link before following it.\n\n>\n>>>> + */\n>>>> +struct media_link *\n>>>> +media_create_ancillary_link(struct media_entity *primary,\n>>>> +\t\t\t    struct media_entity *ancillary,\n>>>> +\t\t\t    u32 flags);\n>>>> +\n>>>>  #define media_entity_call(entity, operation, args...)\t\t\t\\\n>>>>  \t(((entity)->ops && (entity)->ops->operation) ?\t\t\t\\\n>>>>  \t (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)","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 A9098BE086\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 16 Jan 2022 23:52:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E3074605A8;\n\tMon, 17 Jan 2022 00:52:05 +0100 (CET)","from mail-wm1-x330.google.com (mail-wm1-x330.google.com\n\t[IPv6:2a00:1450:4864:20::330])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 28B806021A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 17 Jan 2022 00:52:04 +0100 (CET)","by mail-wm1-x330.google.com with SMTP id c66so16879373wma.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 16 Jan 2022 15:52:04 -0800 (PST)","from [192.168.0.14]\n\t(cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161])\n\tby smtp.gmail.com with ESMTPSA id\n\tk10sm12155797wrz.113.2022.01.16.15.52.02\n\t(version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n\tSun, 16 Jan 2022 15:52:03 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"WHo4P/Ni\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=subject:to:cc:references:from:message-id:date:user-agent\n\t:mime-version:in-reply-to:content-transfer-encoding:content-language; \n\tbh=qdk3IrB8eVb4EXJwVIhekKHxFo45GX1zbCMhwvA2Jnk=;\n\tb=WHo4P/NiB+U5hYlDhzRGTPKO9KZrDmvsIvrnxWsKKpRgVH2Bz169g52OPCT9TX86dU\n\t5M5P+XAdY+v/7yznT/kQ6Lq/nV2eO5NqufV1FrKynOPSduDkx14iNsRcq7wIAuHcPSL1\n\t3+I2ZpYXDPqdb9lccoc5Aymw+HntKSykxFLbf6snUU6ZzyLj0oDgXDQBDaBMwmJOhS7u\n\tOI/7jXstTvP6htIqpy5ainvEWE7m4B2IdTfcPPcgnbjxma2rBJFaEjC5bpiyb0T2BmPk\n\tRAfGcqq0tHyL7O3t0NUT7AS96SKQYuhluKIUCfVVvCbZ1u5jHg1AJ2K8fM7gg1wAUl2e\n\tHB9A==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-transfer-encoding\n\t:content-language;\n\tbh=qdk3IrB8eVb4EXJwVIhekKHxFo45GX1zbCMhwvA2Jnk=;\n\tb=TCka1Odo/dYHEB7bUDp9K8zNeabZDr878OVUFd8JJAi+6VKYMelhgc984sA4HRUvP/\n\t3UbDwxqxWxks/TL2HRqz+G570iaegAN8lTI7vAYi3pJv7sT7BdTCN/1IFtLbpuaVNE6+\n\tsV6Zd1m7HqmH8iUeKhGUXFSTBejlqpid0Jx/VcIX1o/xxFsQwhCdisUsYMRe5YkYtmCg\n\tj01onpnyTUjKFilbUNL8EDl45xMv5DrqreWpW4nn4KK5a9T5+qTxuhrvMAt4aDsYnC/V\n\twrQonvzHZnjEFfmsvJUMJUReU3qcFIfqGj0ybh1Kq+EZyjqRmaF4r4aPRd5eB8NdJoNt\n\t3cDA==","X-Gm-Message-State":"AOAM531YRLdKZJq+RUw8k8hhGorCq8uZ686x+pLP3dAFgwd0uSTrimS3\n\tZpFOGLkXAsfgufUgfSNLP4I=","X-Google-Smtp-Source":"ABdhPJyvwBiuzeM+0rueS0XWV/7z2QFJ0+mDJwVBh08FQUDS2jIfD3WBW1NbmCGWntmFRu9MYMFrrw==","X-Received":"by 2002:a1c:e909:: with SMTP id\n\tq9mr17138933wmc.184.1642377123792; \n\tSun, 16 Jan 2022 15:52:03 -0800 (PST)","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20211213232849.40071-1-djrscally@gmail.com>\n\t<20211213232849.40071-5-djrscally@gmail.com>\n\t<YbkL2V24TFdA5KHx@paasikivi.fi.intel.com>\n\t<6929c5a8-67dc-77c6-459e-6ce26a08fb73@gmail.com>\n\t<YbkXRs/RUnc/JmAZ@pendragon.ideasonboard.com>","From":"Daniel Scally <djrscally@gmail.com>","Message-ID":"<e99b42fe-e162-864a-c024-d0419a3f1ed2@gmail.com>","Date":"Sun, 16 Jan 2022 23:52:02 +0000","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101\n\tThunderbird/78.14.0","MIME-Version":"1.0","In-Reply-To":"<YbkXRs/RUnc/JmAZ@pendragon.ideasonboard.com>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"7bit","Content-Language":"en-US","Subject":"Re: [libcamera-devel] [PATCH 4/5] media: entity: Add support for\n\tancillary links","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@lists.libcamera.org,\n\tSakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]