From patchwork Fri Dec 2 17:08:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 29026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp974695wrr; Fri, 2 Dec 2022 09:11:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf6tIfJrsh9tGPWh70510b8J5gOwocr99fCmIysPG8+9daWvEKdBfwmcIycoQ+7r6EpADwTN X-Received: by 2002:a17:90a:d597:b0:219:861a:48b7 with SMTP id v23-20020a17090ad59700b00219861a48b7mr5901207pju.141.1670001103635; Fri, 02 Dec 2022 09:11:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670001103; cv=none; d=google.com; s=arc-20160816; b=KEJHxYY05AP+/aGU/9PsXfHqbpnQM1IHGyh40wpWJREQJv6B0OazDUoMU4Nom1kBvL Mu5a3N5Kgw9g2bgbqei1Xx5w5/5cs4rr1DWh3ysBdoxkMkCO7SsbvpbIdpW4+QhxOWun ILQy2GOEWwvTFTKs5GuKlTiKi4w4WiMFinExFXaLUUVw1ZugK4LwvDSPxPXXDjBnULDr k430FsqaXI31iNjyVSAgYNogLWkXrrMLyIN1gdxxGWFDeZ0TLL/+o6UZI6hffLXEpBFt Pp+opQt4GUaPT0WvCeMfAk+lTlhWAEpdemAH49wYr4oOdNGDyDJbPdYg4rFcI2cLeYIs MB7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=0Osxc+X4hVnu15Q3eTBw5jI2KUp8vy0lxvuL8UQ3aC0=; b=Qq3n0FeTdNoCKWUjlr5QVSiGjTvYsbhnJnNuirF6VCpQGHke0qjloqENZzdpv9ebtq 6k4r8wZ7sJFgp/gZE+8pF6HL8FOBHNs90Vv22oRE+hyjDdBfbbU3XrwHEWcMJlIIKmS1 yDVcRkMj+MczwlARNBom1s/0HHXhjFdgDdyx28xYUBoGb7ITtiLta9bWAaZAG6oRrd9w YcpDFzNrlC7fyV5mKYaBEXUK6y890GOxvjFPxQUeUfyoZKqKxvDWmzx3K7V9cpmp60iE yy8CyBlLrP+jhHQCaktW5xWhOeVUACU7mXQWAED9cTwRdlBojADmwwQ8w9f8Z7zIblbA igFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GnS8QhSY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 5-20020a631845000000b004774a05eddbsi7537586pgy.828.2022.12.02.09.11.29; Fri, 02 Dec 2022 09:11:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GnS8QhSY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234281AbiLBRIg (ORCPT + 99 others); Fri, 2 Dec 2022 12:08:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234108AbiLBRId (ORCPT ); Fri, 2 Dec 2022 12:08:33 -0500 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73DCAC936B for ; Fri, 2 Dec 2022 09:08:30 -0800 (PST) Received: by mail-ej1-x635.google.com with SMTP id ha10so13030198ejb.3 for ; Fri, 02 Dec 2022 09:08:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=0Osxc+X4hVnu15Q3eTBw5jI2KUp8vy0lxvuL8UQ3aC0=; b=GnS8QhSYEMv6n4jw0yFfUbZvwg5Vhq+985nBIzjutBkUlJTjAES6Qa3j4FDdFzaNhd xPs2ypslvirhSLt/avB43QTL/kelOxqQL6FrOFue/KgICMQvM051OhnKukuOG7/6nN1B mNspBDvw6GParxheS+tuiAz0fi+ztewwb1HAU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Osxc+X4hVnu15Q3eTBw5jI2KUp8vy0lxvuL8UQ3aC0=; b=CpJk/vEd0j1/JwdmpxQxjJkf/VMOFUU6PJGS8upFjPTQaA5/el6OfH4dCUGCCj2cvM A6lNt4E8R/cXXlExSpd0MZ/JIQ6Z24RaTQ94di9CCvj09y7X48C3Pmt5L1+JELirbrPQ e4JOwKca971NWiVdjSbl/go/u8J8Q1p81Kv7jwP/aIUkPcWFqhiLALT6p2lZGlVo8xv6 52wrQD9KEofhU04hHT0QFUXKEU9vinSxJyfN5kAqsWSWXsTzCHQe7+BHP9CjpiHDgP9p 8upkkW4VtmAhYFImQ+iLFs0ILxp/dmx/HNgWRkUfq6czgG6smwzbMzH2LyTugzTmgKWC jHsg== X-Gm-Message-State: ANoB5plDFBe6EhfVpdCbkQGEUV8uV70q9iPmizry5hfaTC/mNP/6cLCk BjbAkC8mCzPyrej7mpv3+NJdTA== X-Received: by 2002:a17:906:240f:b0:7c0:9f04:1938 with SMTP id z15-20020a170906240f00b007c09f041938mr11228599eja.769.1670000909427; Fri, 02 Dec 2022 09:08:29 -0800 (PST) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id p23-20020aa7d317000000b00461cdda400esm3168080edq.4.2022.12.02.09.08.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:08:29 -0800 (PST) From: Ricardo Ribalda Date: Fri, 02 Dec 2022 18:08:17 +0100 Subject: [PATCH v4 1/3] media: v4l2-dev.c: Add Meta: to the name of metadata devices MIME-Version: 1.0 Message-Id: <20220920-resend-meta-v4-1-3ac355b66723@chromium.org> References: <20220920-resend-meta-v4-0-3ac355b66723@chromium.org> In-Reply-To: <20220920-resend-meta-v4-0-3ac355b66723@chromium.org> To: Yunke Cao , Mauro Carvalho Chehab , Laurent Pinchart , Sergey Senozhatsky Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=1570; i=ribalda@chromium.org; h=from:subject:message-id; bh=S/2IqTrS982KVl7xBqyOVIPsEn1hTfJgkOaPng55noA=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjijEHhwhyiGaRWIE8Uwg1apHOrqxn6xO5ElcuWngc RfSqvt6JAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4oxBwAKCRDRN9E+zzrEiCbYD/ 9zTf9/1R1mr3eyJB5lNnh0633R51L2Org2I+fBBpEAQuV0E5f+X+Wvt5fS1x9OGakxv7FMljhc7/VW UycA4caSUByvyMLsWh5VrwRzGe4PetwRafYyZHKMD2ltxmWKRdvf0EIzxlqJNtA2UpWqbv1/2fnZs2 MRS9jOpFIfKv6HexUGs9W0IQqW0zCjuXesmq/UiTEKCCF2wFK76A7fDEYiO67P6BhMX2PtJO4T2l9n ghq7UWWV96Sdf0+zat+q2o15M5gh8vWsjJkLSIhyRCK35FKUS+LqRCdY21m747yr6c9ifbh+boyNeS nTmy+N+jBPCswv8MmF7XT6glJkLRRe2NGtTpDU1yGBVuK9bbIwvyckVBQm2SOVtY6cDvaEhk5AroHV CSMwrcqW70mLSKBLEGvGHSlLplp5Hr5xi5vCimvqZOxr0TcR1WhcXWqr3kh2I7BzjogliVIjarBQ2l +2rOLr8Xl5dnXbc6kWM6JkL8z0U6h3JXaGWqpBB7/VSKsu+AHXhlLLH/u/vyQ/PV+Lh/T1Qh3dwPSV jo06AX7OmJemmcNPTT9zVrpXfUlJZ9jtzxfasYcwM2dnOruGT4CIB/cIym/W+18ikKFQLWMk5ht+Sv fvl56wMlfC+MwAgBex16f0J1qTa0BsB27zxm7iC0tqooCN4/bhSTb/GubcDg== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751123077096942838?= X-GMAIL-MSGID: =?utf-8?q?1751123077096942838?= Devices with Metadata output (like uvc), create two video devices, one for the data itself and another one for the metadata. Add a "Meta: " to the beginning of the device name, as suggested by Mauro, to avoid having multiple devices with the same name. Fixes v4l2-compliance: Media Controller ioctls: fail: v4l2-test-media.cpp(205): v2_entity_names_set.find(key) != v2_entity_names_set.end() test MEDIA_IOC_G_TOPOLOGY: FAIL fail: v4l2-test-media.cpp(394): num_data_links != num_links test MEDIA_IOC_ENUM_ENTITIES/LINKS: FAIL Suggested-by: Mauro Carvalho Chehab Signed-off-by: Ricardo Ribalda Reviewed-by: Yunke Cao --- drivers/media/v4l2-core/v4l2-dev.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-dev.c b/drivers/media/v4l2-core/v4l2-dev.c index 397d553177fa..5c2c9ebb6b96 100644 --- a/drivers/media/v4l2-core/v4l2-dev.c +++ b/drivers/media/v4l2-core/v4l2-dev.c @@ -901,6 +901,15 @@ int __video_register_device(struct video_device *vdev, if (WARN_ON(type != VFL_TYPE_SUBDEV && !vdev->device_caps)) return -EINVAL; + /* Add Meta: to metadata device names */ + if (vdev->device_caps & + (V4L2_CAP_META_CAPTURE | V4L2_CAP_META_OUTPUT)) { + char aux[sizeof(vdev->name)]; + + snprintf(aux, sizeof(aux), "Meta: %s", vdev->name); + strscpy(vdev->name, aux, sizeof(aux)); + } + /* v4l2_fh support */ spin_lock_init(&vdev->fh_lock); INIT_LIST_HEAD(&vdev->fh_list); From patchwork Fri Dec 2 17:08:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 29025 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp974274wrr; Fri, 2 Dec 2022 09:10:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6tI8C7pna8ndi+NLSv/MaTe+dOJjjef8AWH8tmGs0zlt1SGQH7wI4/j9zv4VE4nk8CZZRg X-Received: by 2002:a05:6402:2b8c:b0:468:ebc8:7476 with SMTP id fj12-20020a0564022b8c00b00468ebc87476mr47473226edb.223.1670001058443; Fri, 02 Dec 2022 09:10:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670001058; cv=none; d=google.com; s=arc-20160816; b=rIsOouxD4FEx3vy9okiqFiZcM/LXeuJoux9HKOYwUqCjjPhZXKSri/0YNfVjKiuz/D EZwZX4AIOsiceDiuTCahYc7s1j3pDD3qb09NvfFM/Kf2tkHxmg4/VF4cGzOBvMXQ++BF KD43Kt3OkwXWy5V5ctEZijnhalV8WRgcyKdomN42o9hrSZoqt0WUbZgEKxXe+Di/3IgW P05XlT5x+w80FlvcCkpkyyT6zUHD7Y1X66tCP52lgODouKE4HKgndhBAHPvxqyMUbXKb TILJaPmMOnZY41RwIHOHMgMDJMkFa3aYj2SHUer9kb1OOD2sgbvYMtyyo5RluOURsWFR ceyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=TCQ9M8MyOEnK5pTEhdeO3mymMoTWGn8RzIavHlNHD6M=; b=oTkiURtVF2w8IxNI9gfwncVCKig4AVbbd8Ync+F8HzzrAXgOXgXUVEOfI13WUCWsBg wWqO94G/D2RSxPr8aIefYvSv/zwm7SAt3En7QiBNTmXGWf0XvUI9mfjWMd+v8HkZwcgw vVdeunY/aprj4rLUh1uOz2LKBmcJfhyJDbsuvETI79dzw4I7qfl64leWGhxvm6TmVtcU nHiG+7eWsLu7qYoALceuI1kOWgVm5eFnRZCHHp25C6bynnNLFs5/4oEFmTT+SQZ4cVD/ 8u9IyyTi/EL4Akrt12iSQIstjr+hCsuNuJNoU5m+I3EkdTjrzXlEC5HawDxdZK4JR+fi GxOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="R/oMM0lW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jg7-20020a170907970700b00781132a4ca6si6896842ejc.850.2022.12.02.09.10.31; Fri, 02 Dec 2022 09:10:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="R/oMM0lW"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234360AbiLBRIo (ORCPT + 99 others); Fri, 2 Dec 2022 12:08:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234030AbiLBRIe (ORCPT ); Fri, 2 Dec 2022 12:08:34 -0500 Received: from mail-ej1-x62f.google.com (mail-ej1-x62f.google.com [IPv6:2a00:1450:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CDFB1D11FD for ; Fri, 2 Dec 2022 09:08:31 -0800 (PST) Received: by mail-ej1-x62f.google.com with SMTP id b2so12988357eja.7 for ; Fri, 02 Dec 2022 09:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=TCQ9M8MyOEnK5pTEhdeO3mymMoTWGn8RzIavHlNHD6M=; b=R/oMM0lWUbfpFHh0O9/+DBNeQs4nbkDIDSrNwITxX3+i2Myafv0d25iU65xGMgf4IW XKMysLO0P36sYbZ+nT5P+83p3R96mmLyFvA9BKQ5cmt16CFcazjSE3qiUF2E4Nv6vZos HxqQPrOoyOiv43k+qZMxhGjrFKrW92au0ZVYc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TCQ9M8MyOEnK5pTEhdeO3mymMoTWGn8RzIavHlNHD6M=; b=4N2uYmzBeAsOKaxrHs8B5dynsQsf7/ubBCDyWgXA0cZgk8Mdt9nQZR4ACaQlIwvW7B HsntTiXbEdqySj9qVPXyw3c4SQGOFEculveyPIy27kayU3mOtrQtSafUqezFKlKfzThy yLT5+qiNbpv7+s3qdhyVwvycWHpmok/CnygE+V3lo5kkmXOnFUsaQgTQKKsDhaGTMPc5 ebFswj1AN3xomeaS8BKo7D/TcRpefWNamK10cG5rVPRsIgob0ItAWLLrp9ZnAJ+o34ur yDXHzpP+ULZLwdcmHjvMCyfUWm3dBodMRCunuXTb3lrapkSrQWMdl4fndvWO70DXPRRU GsFQ== X-Gm-Message-State: ANoB5pn62pNgWjfBA/wwWCeUwYKF3Dy3+kIPbkFCYGy2HDZ/ga76fRHY mCiqbgKEPz+7us3lSm+91/gCTA== X-Received: by 2002:a17:907:77ce:b0:7c0:8225:54d with SMTP id kz14-20020a17090777ce00b007c08225054dmr16814628ejc.286.1670000910178; Fri, 02 Dec 2022 09:08:30 -0800 (PST) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id p23-20020aa7d317000000b00461cdda400esm3168080edq.4.2022.12.02.09.08.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:08:29 -0800 (PST) From: Ricardo Ribalda Date: Fri, 02 Dec 2022 18:08:18 +0100 Subject: [PATCH v4 2/3] media: Documentation/driver-api: Document device name MIME-Version: 1.0 Message-Id: <20220920-resend-meta-v4-2-3ac355b66723@chromium.org> References: <20220920-resend-meta-v4-0-3ac355b66723@chromium.org> In-Reply-To: <20220920-resend-meta-v4-0-3ac355b66723@chromium.org> To: Yunke Cao , Mauro Carvalho Chehab , Laurent Pinchart , Sergey Senozhatsky Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=1173; i=ribalda@chromium.org; h=from:subject:message-id; bh=SfUbFly0L3KPaCuRZ5w00Du+lIHrvLRHPtWI2RZZpxM=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjijEJTiEOmUITGiLvUCgkbCs81Q810EX+dXH3NyaT mXwvuGGJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4oxCQAKCRDRN9E+zzrEiH+6D/ 4yIlInPaIUb3c4STKRJvD4EWozBosI6T/1nKVk3G6TFxnh9oizy6AXNbJLZrwtOJpKqkj9Ks5ICQ6B lqFTWpjvhnfKcrVV0ToMygkwju67mqgUSm6PfTUhWhLbxk25i6+luvVtnkJfunw6W46/rU+9YNFs5c w08uwPEckBTM6bciZkTrY7F27fpe6Hf7nW6J/a6gScSnQh7es6pdBrK/xAncOGTE9+SsQJPVvu0LvO tDVnhPz1aV+BYYUCLE+Es/rJcGVBnxw+a+kZXQDqKQBCq2h6m1yThavXXHOh061luADcr0d6wHaIgY g8OoMWu9bnT2QQmADG4cmgTDcM1OfBDXZhDzD/CCuCUEAhiqVYAOB/urPfyIfrFHq8jPhgVv3ws1T6 FPTJj7yvCgHG2tL4oSTVRFX46NiEm/311whLXSBchnQ0zg8VS3paWWhJy5/G/l6lE8tf7yZ37kmf12 6kTAd5Q/WHYXdblAs3uFZs1+Z9NN0VNNJGVmek4sEyv9IrDtAopL2DqRjTxlY8iY8rHsD1hdag7ssg +K+3ZLlfdwsRZyQtHdf1KwYxZrqRzq4wfL1u+Ds+hs5IkmIAlCWQFJyB9chP271obMkui7lUoKlJe+ XehpqL57Kfg8oqOuCmImjeMkOVT8RdJWrmv7yMKLImBs+fvBpOT0Oe6kH62w== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751123029944715517?= X-GMAIL-MSGID: =?utf-8?q?1751123029944715517?= Document how the name of the metadata devices is modified. Signed-off-by: Ricardo Ribalda Reviewed-by: Yunke Cao --- Documentation/driver-api/media/v4l2-dev.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Documentation/driver-api/media/v4l2-dev.rst b/Documentation/driver-api/media/v4l2-dev.rst index 99e3b5fa7444..935a46e29c5e 100644 --- a/Documentation/driver-api/media/v4l2-dev.rst +++ b/Documentation/driver-api/media/v4l2-dev.rst @@ -42,7 +42,9 @@ You should also set these fields of :c:type:`video_device`: - :c:type:`video_device`->v4l2_dev: must be set to the :c:type:`v4l2_device` parent device. -- :c:type:`video_device`->name: set to something descriptive and unique. +- :c:type:`video_device`->name: set to something descriptive and unique. If the + device has the `V4L2_CAP_META_CAPTURE` or `V4L2_CAP_META_OUTPUT` capabilities, + the string `Meta:` will be inserted before the original name. - :c:type:`video_device`->vfl_dir: set this to ``VFL_DIR_RX`` for capture devices (``VFL_DIR_RX`` has value 0, so this is normally already the From patchwork Fri Dec 2 17:08:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 29024 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp974205wrr; Fri, 2 Dec 2022 09:10:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf4nHtn56u/2Llqh+3GTB+ijun7X7TRkHY/DLjhTnNCBeLSjL9Y0qvZzsGCF5Ds+eav7fxYc X-Received: by 2002:a05:6a00:2342:b0:575:1df5:4207 with SMTP id j2-20020a056a00234200b005751df54207mr27327670pfj.4.1670001052752; Fri, 02 Dec 2022 09:10:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670001052; cv=none; d=google.com; s=arc-20160816; b=W91+BsqoE71xWveHn2Lcx6YRUg84/nsp1HxTZz7ns3sGtz8kSuQYGvuYVTtuUJchBt xQOm76ZwtlCjGcrzC40ixrzFXn1RccdgREe50NiadZ2/Nin3cby/9rB9zBgwdSY3/zyQ qAVrENt1Jm5Q+z+3nnyAvXfthLXvYpQfakhzQz0ctzKygIjRwqP+hOU82xLbEOUa0A5P 3LXMhcm2/ayE29awM53j8aF6Py8hSU/iF6QxNQ+Hu0LntNsuzzhN3sXxehMS2oPg5/Fw DrolNWYVjAYNz9WfolzhwLHFshs9FF8ETuAy4L4kzUujPh6j+USQrHF2WcRfA+/7EwYH yY2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=wtZA1IbfmQV1q6JbQ4L1axaQ6pL7lh9jXHUHF+NGf+s=; b=crqX4Lfvvxvt+kLQwybQg9ISbqbBU0tTkk4qXW0BlIoS/L1aHmo1SsmkzLQWi+xhUL jqvIDFB7CFJvZCcMhboNWOOHeLrVNvgPPOb/tPF2p8EoxBau7nPxOuS+qS2VgQSxksk8 aSiOaUtsNc3B4y6vRoem8tJsz4NHC0nVvwiSf6nScPUqim65KAgCeNz9QgMYUFpuIcGf XgC5LDG+86nu09MXz7CU+S1yDgnpDDN7G3Cni723E5XvmNIxQQy3Vx8FAt0xQKDwyPMr 8mVw2ucFWymfRCfbORZnDChEC7aKwoWbqirqLebSpUQS88V8ndHm0ZRcuk+Ds9Q6HNzF su6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XpikTCNV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a056a000b9200b0054568a55597si8857953pfj.96.2022.12.02.09.10.38; Fri, 02 Dec 2022 09:10:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XpikTCNV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234370AbiLBRIq (ORCPT + 99 others); Fri, 2 Dec 2022 12:08:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234211AbiLBRIe (ORCPT ); Fri, 2 Dec 2022 12:08:34 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6734D15AC for ; Fri, 2 Dec 2022 09:08:32 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id n20so13078954ejh.0 for ; Fri, 02 Dec 2022 09:08:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=wtZA1IbfmQV1q6JbQ4L1axaQ6pL7lh9jXHUHF+NGf+s=; b=XpikTCNVTwEOA5uF8nNd5n/17A51tYzKCsH3sFvNsx7NQIlGfqeYPmt+MPPTil0B9c HoA1iwi/zEldKG9JkeVX+amy3q/vGckf4YOJJZq6aKxUtcpQqtvsP97cy1tjVEwII11V nOqCsWmk2LGIUPqE1HZG8UiN0l0cJKQvaKSjY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wtZA1IbfmQV1q6JbQ4L1axaQ6pL7lh9jXHUHF+NGf+s=; b=ERKZq23HCDfjemzOtv+HS/5uSbloHuwrZcHJNyYj6ViWrvLe/bq1bMUJWTI/HEv76q arSHFe57aOG+QQOXceU/61g1wfmynRRCpsTG7YG9r9jUx7FVBGwD7hDqrDYmTVxhnIV+ OhZ1H6Z7uqhw4AcNrtMOzEEKeILfGvDwpFOy8u1te/jg4x2MYGxqYjanhNoiePdHJySc vXq9ySDuvSbX7EIRHEIKYN9O8b5y/KIV1313vc8i2u9hrtysW/6nju77ieZExbSo6XCi kh5QZg7u4RMFwZz6Gmptw7cCgpxmivoI1+WbHymYts0X1+fKvCiauFtTMr5sdXakDV6k AbNQ== X-Gm-Message-State: ANoB5plpJGSLSshRRGwlbCbyKk6kY3VmCA1jCCYlndxR75Uf2y9osLhq 5Yn2HEQV/plCrQ1ksndiXs3Z1Q== X-Received: by 2002:a17:906:c303:b0:7ad:95d2:9df2 with SMTP id s3-20020a170906c30300b007ad95d29df2mr14266490ejz.607.1670000910978; Fri, 02 Dec 2022 09:08:30 -0800 (PST) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id p23-20020aa7d317000000b00461cdda400esm3168080edq.4.2022.12.02.09.08.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:08:30 -0800 (PST) From: Ricardo Ribalda Date: Fri, 02 Dec 2022 18:08:19 +0100 Subject: [PATCH v4 3/3] media: uvcvideo: Add a unique suffix to camera names MIME-Version: 1.0 Message-Id: <20220920-resend-meta-v4-3-3ac355b66723@chromium.org> References: <20220920-resend-meta-v4-0-3ac355b66723@chromium.org> In-Reply-To: <20220920-resend-meta-v4-0-3ac355b66723@chromium.org> To: Yunke Cao , Mauro Carvalho Chehab , Laurent Pinchart , Sergey Senozhatsky Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Ricardo Ribalda X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=1196; i=ribalda@chromium.org; h=from:subject:message-id; bh=nncAxgIlMLPqi8B4D2XzAtMUAbjMzg6DbKN4jx7ltvo=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjijEKf6IQrPsYfpx8DB/t21WB2f//wrtkc3pBusyj OJet42yJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4oxCgAKCRDRN9E+zzrEiEf9EA CQ4I7QGoNfJc9SX11wg89UhJOeSV96QkPThsmoSd+ZSPI54GSWuTIU5scGGnYkXaCUoMlZh0UUvz2Q aIq7bDEfpmwCV6ioehV41ihZyXx3jAk8hHwjArKCdkvjxXL3qcBuYBvqDnNhPDufiMbdt020JrednB SlFrEa9DrGYNGERL7H5gyh60gLTxvT6i3TNP+8Q4+cgnXkMYDwTWXZ2Qgc5WY8ULBtXzWW8/BxNocr yVr3Lh795K3zVpg/AEiG+ZseaV9I5VTc5NzMDwAwEzOS66uLFPBNYuN67PlW/WO354hOJw8hdkgZqu nyem3E/OvSF6k5Je/csoQ3OUJFbw0b657ilB4bOQy/BL7yH6MYQPRfziUKJkLi4z+H7FdbuFZwpWEK EgdH9jGHSGYUD+ePn1TGzttAah24E17G4QOWGt2a23um4b00eIMvXZcYap/n6BfO6jDiJpMYiyfqZN swe6t1+t0zmKdYVcznkLD7F8Mj+WmkwYcQQrphdjKlQN8NsuSi2lXExVumSnGRNT3CahDuqovBw/Bq vJ187rhlO897Szhl+WuAzg1quLkKQ9J6sXb9M3Exexs3r1hdyg3alVYAjzxAFARErx9E4Y8C7HWJjG To1sxIYs0gyIO7Zacp/WnYB3q6NuiAnaIjJrWXFe32Bp18lk1ikY4VrFPJsg== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751123023865233199?= X-GMAIL-MSGID: =?utf-8?q?1751123023865233199?= Some cameras have multiple data inputs (i.e. IR sensor and RGB sensor), append a unique number to the device name. Fixes v4l2-compliance: Media Controller ioctls: fail: v4l2-test-media.cpp(205): v2_entity_names_set.find(key) != v2_entity_names_set.end() test MEDIA_IOC_G_TOPOLOGY: FAIL fail: v4l2-test-media.cpp(394): num_data_links != num_links test MEDIA_IOC_ENUM_ENTITIES/LINKS: FAIL Signed-off-by: Ricardo Ribalda Reviewed-by: Yunke Cao --- drivers/media/usb/uvc/uvc_driver.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 215fb483efb0..f4032ebb3689 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c @@ -1963,7 +1963,8 @@ int uvc_register_video_device(struct uvc_device *dev, break; } - strscpy(vdev->name, dev->name, sizeof(vdev->name)); + snprintf(vdev->name, sizeof(vdev->name), "%s %u", dev->name, + stream->header.bTerminalLink); /* * Set the driver data before calling video_register_device, otherwise