Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3373123pxb; Mon, 17 Jan 2022 18:56:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxJRmnKXqABRoWYZpuej0mEkwcPJy04OORNOVGj4oPrNwN5UwO+ztJWK12yWZH+QqubZFH X-Received: by 2002:a17:902:8d8d:b0:14a:dd79:17b2 with SMTP id v13-20020a1709028d8d00b0014add7917b2mr219680plo.88.1642474587308; Mon, 17 Jan 2022 18:56:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642474587; cv=none; d=google.com; s=arc-20160816; b=xneoYoMNN/IPEzhlIah14GQb2cXs3htzaBhU7Ip4jP/oLj0Vnejg27nEZDxTtMrCDG XFFGhv7aYImbFISqRxjd+FeSHTRfFicm+6cJAGc8YdOgzFnk6iY4oGTpZqWbR2006Kcg 9rdprEjCjIYf6RlDkO8iTjfoPYUCJ+TJjQJIO1pcnUL9jyA+v+OHzyUFLWBGt8GYd6b8 FIwfl0BI1Uyan83+0BdqYibW9+IcBdWgbKsZYlNP2y/dnI6aYoKnR4blGRLwCDzAmWr5 lMizSGLIctCEAU3r7jDCV7Od3YFQ2eOUQfgVO4aAh+C4vHbo3hQLBxPk5WHwrkbwpzfQ Etxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cKwU2z0WzA6eXQxgtc3caEqVcpArN/pRGPxwhgA1Nc4=; b=kqTE6zqvmjTlDMzOSpyqugTkMKj+skuAWR7h0mRFeKh7sIyZ36te+xK3tsklQMvfyM HDn6loBThIfpeRpXbz2hSgebmEoZRLMOPoFlRDjtT8/KOTlCBLNvtPxrzyZ8eguDcSff p/9I0kxK091Q8kQL/ecJGUbTg9wClUz4RPPaEWlajhT2OJttj2ECGVnyBI6gIDynJjs4 C4rmtPxJq96/fyHzcz6/boPwUAg6QalZHUleIojn/mBMCjJ38MJ+XswRi2gMvDX+YzSI hx9JabAQ4gzlaplRoMPyFHOrGqGfoDDHpn7M5X5gpY2kvHin3hDPUMvz3KU/Mw5nChHM aneA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YTt7Qi7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j19si14575822pfi.12.2022.01.17.18.56.15; Mon, 17 Jan 2022 18:56:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=YTt7Qi7y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S242583AbiAQS1I (ORCPT + 99 others); Mon, 17 Jan 2022 13:27:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235551AbiAQS1E (ORCPT ); Mon, 17 Jan 2022 13:27:04 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB612C06173F for ; Mon, 17 Jan 2022 10:27:03 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id c71so69218168edf.6 for ; Mon, 17 Jan 2022 10:27:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cKwU2z0WzA6eXQxgtc3caEqVcpArN/pRGPxwhgA1Nc4=; b=YTt7Qi7y/uU1VdwxKGR/sNUDhDVueC1mcA/WpAjQ9pPOiXP4tVdnt0G0LfVX1EOq2J G+1VR4LBQ5d1z6WbledtfytoOVB6nEW4eFjQybcjraXgnMl/Edx83ZCq149HbhDeQai7 KCXAj+bC2Fk3bB9G4Gtlt+euMbd1IoqkiKYGk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cKwU2z0WzA6eXQxgtc3caEqVcpArN/pRGPxwhgA1Nc4=; b=X11DbVhMPDWUCa4b0dSKj8puKiZWPMOmAi4M5rCqlWuGTvnNUmBojlxLdjPZf93kx3 8PwYfEbjwO16rmy0qITHftDzK5K5ePt3AR+vOMrNYaX4q2hMehSyLwzuqNmaaCDEMrAZ /ysynVaD5mfacTot8HZ8p36Vz0jw4iSFGKrBlplKBpVWZStJFEkllEPyJ+N2TRg2687X ekGNnanB2qV8b9ePNqbFV6tsE0FKn7SUs/0srW+PHd3jIOYJs7G2OevxfTkOGk4RrHai GUhVQTo0rQpgyiVHKy9H7CCxBw8FXUMdxd6zZkj7IBnnX7gL9zw/LU2mR9ROJjM6b4lo CLVQ== X-Gm-Message-State: AOAM532YZwjmGFMKO5ExA4QQRATyv/LsJKNGNz20eqFZk+XZp2tnptzq z/Uil12KlGz+wAuFL1InUaKyJQ== X-Received: by 2002:a17:906:e295:: with SMTP id gg21mr18308367ejb.375.1642444022462; Mon, 17 Jan 2022 10:27:02 -0800 (PST) Received: from alco.lan (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id la10sm4657462ejc.22.2022.01.17.10.27.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jan 2022 10:27:02 -0800 (PST) From: Ricardo Ribalda To: Nicolas Dufresne , Laurent Pinchart , Hans Verkuil , Sergey Senozhatsky , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, tfiga@chromium.org, Mauro Carvalho Chehab Cc: Ricardo Ribalda Subject: [PATCH v3 1/3] media: v4l2-dev.c: Add Meta: to the name of metadata devices Date: Mon, 17 Jan 2022 19:26:56 +0100 Message-Id: <20220117182658.468993-2-ribalda@chromium.org> X-Mailer: git-send-email 2.34.1.703.g22d0c6ccf7-goog In-Reply-To: <20220117182658.468993-1-ribalda@chromium.org> References: <20220117182658.468993-1-ribalda@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 d03ace324db0..98be80010702 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); -- 2.34.1.703.g22d0c6ccf7-goog