From patchwork Mon Dec 13 23:42:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 12674887 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 165A6C433F5 for ; Mon, 13 Dec 2021 23:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244266AbhLMXnJ (ORCPT ); Mon, 13 Dec 2021 18:43:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244259AbhLMXnI (ORCPT ); Mon, 13 Dec 2021 18:43:08 -0500 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB5E8C06173F for ; Mon, 13 Dec 2021 15:43:07 -0800 (PST) Received: by mail-wm1-x333.google.com with SMTP id 137so13092988wma.1 for ; Mon, 13 Dec 2021 15:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=dldKQiAsH5NhCbn3AHqG5fc9Jd8QHr7SEGOiBRpzv+Y=; b=pZ9KPL7IqYcROTksOwvAgfewPToD7EMRIqXr835W6zFQPD30D1R+eiAxHiH2C0AV+k O/jzD4c2UM+/VS2UgYRfU8PHbOkkougFUpPN5BLFJVKWfN5DB/OvWkTD6TcDrKB4T99g eAoHwuZYH+8+bD2LfqAPAhea9yTULRfWU5YE76zgiXOtPw6Uhns62pwwzin+9wIuoBdV wruZ2UqFMVqbKDPFXk8hjZ6how6iJmoGH6FkA1wr6AGARhaiMwcKBMplIz1snK1Cf58c b8rfxLkIsm5leF1n6N/L7NgJHF8+6COgbkBxWBvktd4WSWjJZqmxfpH6br5lYZU5XYW4 tIOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dldKQiAsH5NhCbn3AHqG5fc9Jd8QHr7SEGOiBRpzv+Y=; b=yi6vryjWyvyUG1gowpU3RpXXTWbcLZoY4bBvHT0dDwfwAgChr+hZLUy5vQQlY06rzP hQwIB+2zf4Pj34rJUPjgh0/IKTDpgldDQ2P7XEbdRCgqlrOh121eBVrcM5K7hCb55yCW 4kP20MBPTaZEjorEairGIr9TOHX+zItiBJvLHuYEuenOcPHA8TXSxYy5SCn3tgJ0SlIG KMqJ5DoCbM0zvD4RdW0Yel9zCdYoh/czgYRwdVVuLVKIcujnWS73+J4TJho3+GE2Tdfr 55EjvDyL2AHwHxzbGLmUCJ84QiZgj3S5IoEczWStTOFWT/SbvjUFQTxmz7PtSOchELiB Or9g== X-Gm-Message-State: AOAM530RKkaEcWIQYjT9XvbzvoW4ZISOfR1j6Rv+oPHfHqyO+WRJwf7x IyJXBMPMuQZDsSmC8TTBDuEjtyG44r0= X-Google-Smtp-Source: ABdhPJy2LnEcI1vRObLzd2Ox+j1fAU3ORgLZZCDFOKQKrUaY/p43xYEdBlgID5GEvB8b3lupNdf8Uw== X-Received: by 2002:a1c:4d13:: with SMTP id o19mr2368799wmh.164.1639438986435; Mon, 13 Dec 2021 15:43:06 -0800 (PST) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id p19sm435516wmq.4.2021.12.13.15.43.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 15:43:06 -0800 (PST) From: Daniel Scally To: linux-media@vger.kernel.org Subject: [v4l-utils 1/3] v4l-utils: Add MEDIA_LNK_FL_ANCILLARY_LINK macro Date: Mon, 13 Dec 2021 23:42:56 +0000 Message-Id: <20211213234258.41411-2-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211213234258.41411-1-djrscally@gmail.com> References: <20211213234258.41411-1-djrscally@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add a macro to describe the new type of media link in the kernel. Signed-off-by: Daniel Scally --- include/linux/media.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/media.h b/include/linux/media.h index 17432318..e3123d1a 100644 --- a/include/linux/media.h +++ b/include/linux/media.h @@ -222,6 +222,7 @@ struct media_pad_desc { #define MEDIA_LNK_FL_LINK_TYPE (0xf << 28) # define MEDIA_LNK_FL_DATA_LINK (0 << 28) # define MEDIA_LNK_FL_INTERFACE_LINK (1 << 28) +# define MEDIA_LNK_FL_ANCILLARY_LINK (2 << 28) struct media_link_desc { struct media_pad_desc source; From patchwork Mon Dec 13 23:42:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 12674889 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 0037FC433FE for ; Mon, 13 Dec 2021 23:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244254AbhLMXnK (ORCPT ); Mon, 13 Dec 2021 18:43:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57486 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243542AbhLMXnI (ORCPT ); Mon, 13 Dec 2021 18:43:08 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DCBDC061748 for ; Mon, 13 Dec 2021 15:43:08 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id a9so29658901wrr.8 for ; Mon, 13 Dec 2021 15:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Sm43MlLMN3sE4KKkoCXQEwEwVx8aKp2ER1tS++CTyNI=; b=YPMnFM1VM/FyFKSY1fcFkk7UfPUvRTk1PYvIp+/mi3Joun1Pm4vf/cwYklXI792yr+ 0oEBketxHCxNCU4vTZcejyFL3P3/d7FQojHTnIZE7zKN0QqsDZEXtW7RvOqL52A532bX yLhirNq12tHMc5r78fzpe5JO5BrXzHnlQmPCyPJiLm9HA7XLSiipQi2+R1LT70mR3nEm yNih5m2tAZ0ZAXw0/p7hyu2YGtQIbUaEXYxETMuFkNN1j9e3OWEFLBy1vbFJwZegeQu4 z0Zrj6lrRFJkdnfaNYMoiDyNq4GmAnRUdFKS/Mjw/NBwoIa5VyxWif817ZPWRde6PU4e oiIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Sm43MlLMN3sE4KKkoCXQEwEwVx8aKp2ER1tS++CTyNI=; b=5NJbv/G6+gv6rIBBEzizsYBIbLUAPwCJ3CP5KbaJ8RYJylZlusmykMYczfcOmBNJTE 7RumtpGMvQ8Ejn7YgA0dQ97NOQBkiW1ez+77UkqKfGMXzf1qh/y32t7os6nE0Jkr+05S 5qFNzwBuw/y5+nw3z7w6oD6v0FzU3kHJHn0vMv9qLws4wWWU3wya8sM3gAE+WvPDWx+q d9eI+2AOYwhKZNgZZsLTe9Y5uCdDrIa6uWJvsx47Esbz9Jg6yLdWhIp6N0Euldvx1hf0 NfFaNjSqJqDkeTxMP+hhjft3ISiXD73ZftjBm8wt4896FPXybqlpj6SbM73gyuoF7Ux7 M74w== X-Gm-Message-State: AOAM532/RNI7dGvKhMKw0joixbmqijx+A+kIAzoY1aNRpq52xnHDDnF6 23j5Bqa0HzvSxcMEYQwAZpf8BYUzT40= X-Google-Smtp-Source: ABdhPJxvMb/tBVECutU9Olmk+aUmld8oPcnJlXMXiptv39Tt/ISlfsqBSv7oMdZ+Zb7EjMuZUAgPyg== X-Received: by 2002:adf:ffc4:: with SMTP id x4mr1735185wrs.695.1639438987037; Mon, 13 Dec 2021 15:43:07 -0800 (PST) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id p19sm435516wmq.4.2021.12.13.15.43.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 15:43:06 -0800 (PST) From: Daniel Scally To: linux-media@vger.kernel.org Subject: [v4l-utils 2/3] mc_nextgen_test: Display ancillary links Date: Mon, 13 Dec 2021 23:42:57 +0000 Message-Id: <20211213234258.41411-3-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211213234258.41411-1-djrscally@gmail.com> References: <20211213234258.41411-1-djrscally@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Add an argument to toggle display of ancillary links in the output of mc_nextgen_test. Update media_show_links() to account for the extra type of link and display them if configured by the right option. The optargs table is reformatted, since with the new option name it doesn't really fit in the original indentations. Signed-off-by: Daniel Scally --- Alternatively the ancillary-links could be "ancl-links" or something to try and make it fit in the existing structure, but that seemed much uglier. contrib/test/mc_nextgen_test.c | 61 ++++++++++++++++++++++------------ 1 file changed, 39 insertions(+), 22 deletions(-) diff --git a/contrib/test/mc_nextgen_test.c b/contrib/test/mc_nextgen_test.c index b8c26045..6086ceb4 100644 --- a/contrib/test/mc_nextgen_test.c +++ b/contrib/test/mc_nextgen_test.c @@ -47,17 +47,18 @@ const char *argp_program_bug_address = "Mauro Carvalho Chehab source_id) == MEDIA_GRAPH_PAD) { + __u32 type = link->flags & MEDIA_LNK_FL_LINK_TYPE; + + color = CYAN; + switch (type) { + case MEDIA_LNK_FL_DATA_LINK: if (!show_data_links) continue; - color = CYAN; - } - if (media_type(link->source_id) == MEDIA_GRAPH_INTF_DEVNODE) { + show(color, 0, "data"); + + break; + case MEDIA_LNK_FL_INTERFACE_LINK: if (!show_intf_links) continue; + + color = BLUE; + show(color, 0, "interface"); + + break; + case MEDIA_LNK_FL_ANCILLARY_LINK: + if (!show_ancillary_links) + continue; + + color = MAGENTA; + show(color, 0, "ancillary"); + break; } obj = objname(link->id, '#'); source_obj = objname(link->source_id, '#'); sink_obj = objname(link->sink_id, '#'); - if ((link->flags & MEDIA_LNK_FL_LINK_TYPE) == MEDIA_LNK_FL_INTERFACE_LINK) - show(color, 0, "interface "); - else - show(color, 0, "data "); show(color, 0, "link %s: %s %s %s", obj, source_obj, - ((link->flags & MEDIA_LNK_FL_LINK_TYPE) == MEDIA_LNK_FL_INTERFACE_LINK) ? "<=>" : "=>", + ((type) == MEDIA_LNK_FL_DATA_LINK) ? "=>" : "<=>", sink_obj); if (link->flags & MEDIA_LNK_FL_IMMUTABLE) show(color, 0, " [IMMUTABLE]"); @@ -1117,7 +1134,7 @@ int main(int argc, char *argv[]) if (show_interfaces) media_show_interfaces(mc); - if (show_data_links || show_intf_links) + if (show_data_links || show_intf_links || show_ancillary_links) media_show_links(mc); } From patchwork Mon Dec 13 23:42:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Scally X-Patchwork-Id: 12674891 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 88CA1C433EF for ; Mon, 13 Dec 2021 23:43:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244255AbhLMXnK (ORCPT ); Mon, 13 Dec 2021 18:43:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244245AbhLMXnJ (ORCPT ); Mon, 13 Dec 2021 18:43:09 -0500 Received: from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com [IPv6:2a00:1450:4864:20::32b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08253C061574 for ; Mon, 13 Dec 2021 15:43:09 -0800 (PST) Received: by mail-wm1-x32b.google.com with SMTP id i12so13108182wmq.4 for ; Mon, 13 Dec 2021 15:43:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=/FM5lJgSblkiQRy6I2XnHiIitHe+h/ds8OLMIyjzGYs=; b=CUO9PCmIA/jLOdtawZ24PyEzxGqOJtP15w9SWt0bYyroTBi7tKjvbVHhlTZFhfoYBi oGps18WFeXhaKxpFu0vmrIfVj10i+fmDrfWl3lDj+q1xKueYMWUVa7Jgr2AgaVQ9cIdK AMgeG8AQKnGTgn40vmVG/w2FPeWxTZ0giibPTgo6uWixnu1613qQbLSnUF6RLZkjQK8U CTkFtKGG8TZGdhHoeQ+BylrQizMRQWS4xmTgCeBkVprybfHCf51ojCZRso3M0rrxYHPH GM7TcuIO+mrx6MJUTZsqkRm9dZtVbCOivwOMv9NcpqI/69LrU6yyIKMk/Y4LDFsHOwVc Bbdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/FM5lJgSblkiQRy6I2XnHiIitHe+h/ds8OLMIyjzGYs=; b=EHlfq4I4M5xyygZ1btBudj71HhkxYWBRVLy/fwTYSXc3DGud/wRSNH+0qaZvtMzMHt ah1sdZKdkHSQ3XFItzmy7nU4wIkOgnw/7CZYVSh8jVeSElK6L6aBYMM71zHGvgkZoSI7 XExWWsgAoam2JkCZFABCt01XkLXSGJMmnURMv/iV0rBtE4djIVydu/fCHWQZSC9wjXV2 EqzmD9/PLQhfm/8/U9GqWg1OWdUatm0qWijLWsVlMqrb/NQldTvB5ulh8EYfEt2b3O+t dAVsTJJSxfvbsLbnIjKlOwz0JKY2G3qUsFn1CMiSIxaa1MdgEbUoZSQXKoYXoN5MivK8 rmLA== X-Gm-Message-State: AOAM533yBS82M36RuiVS5v6Z4o2JVBCaE3pbz/Dmf8vCtRM6e6GwgFGT x8sMOLjbIsrORWmfeLxRWyHVbzrIlSE= X-Google-Smtp-Source: ABdhPJyj78yNSKf7/PPSxzm0VjlSdmKoVF5pQm545BKnVWVlzvWK8BTDgekzvfa6ZS+M5ir8PV7MRQ== X-Received: by 2002:a05:600c:3505:: with SMTP id h5mr41207699wmq.22.1639438987623; Mon, 13 Dec 2021 15:43:07 -0800 (PST) Received: from localhost.localdomain (cpc141996-chfd3-2-0-cust928.12-3.cable.virginm.net. [86.13.91.161]) by smtp.gmail.com with ESMTPSA id p19sm435516wmq.4.2021.12.13.15.43.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Dec 2021 15:43:07 -0800 (PST) From: Daniel Scally To: linux-media@vger.kernel.org Subject: [v4l-utils 3/3] v4l2-compliance: Account for ancillary links Date: Mon, 13 Dec 2021 23:42:58 +0000 Message-Id: <20211213234258.41411-4-djrscally@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211213234258.41411-1-djrscally@gmail.com> References: <20211213234258.41411-1-djrscally@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Update v4l2-compliance to account for ancillary links, since there are a couple of places in it that explicitly assume only two types of links exist. Signed-off-by: Daniel Scally --- utils/v4l2-compliance/v4l2-test-media.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp index 28af0d83..85b1eab5 100644 --- a/utils/v4l2-compliance/v4l2-test-media.cpp +++ b/utils/v4l2-compliance/v4l2-test-media.cpp @@ -261,7 +261,8 @@ int testMediaTopology(struct node *node) for (unsigned i = 0; i < topology.num_links; i++) { media_v2_link &link = v2_links[i]; - bool is_iface = link.flags & MEDIA_LNK_FL_LINK_TYPE; + bool is_iface = (link.flags & MEDIA_LNK_FL_LINK_TYPE) == + MEDIA_LNK_FL_INTERFACE_LINK ? true : false; fail_on_test(check_0(link.reserved, sizeof(link.reserved))); fail_on_test(!link.id); @@ -460,7 +461,8 @@ int testMediaEnum(struct node *node) link_disabled = links.links[i]; // This ioctl only returns data links - fail_on_test(fl & MEDIA_LNK_FL_LINK_TYPE); + fail_on_test((fl & MEDIA_LNK_FL_LINK_TYPE) != + MEDIA_LNK_FL_DATA_LINK); fail_on_test(links.links[i].sink.entity == links.links[i].source.entity); if (is_sink) { fail_on_test(links.links[i].sink.index >= ent.pads);