Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3654222rdg; Wed, 18 Oct 2023 01:51:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHwR1TzogMRP45F7eM/wX5ok/H7yuEXT6r9CikUs6mLKzl4B0CUw7apddiIaDZqvyOlY8M4 X-Received: by 2002:a17:902:e80b:b0:1ca:e4b:148d with SMTP id u11-20020a170902e80b00b001ca0e4b148dmr5196851plg.65.1697619068648; Wed, 18 Oct 2023 01:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697619068; cv=none; d=google.com; s=arc-20160816; b=o5A7nEMQdBvTItpj26vDdfciE7xcNGioDIaIcz8vU9eLmekWlvNTWIpRQ7qqGYbMVr HgB0JJRMQRKyJzzrm7tMX27c0HhK0YGFfnWnnqt1HEpWaagJkl9t9zYiTaae4ta/LFYg HwtExI1rNhX39viIH+wdEMn1eYo7rxmFUjzFIjPFVkW32+d7jNgck+7efSCF/utCcVJo UcsUYYkVuciKiqjQU3FNx7AXh0BdZUQoxkbGwLb3QITFEsk2//qt4tWwemj9sEkfP6LJ C/yelEUoZpVqvmmodthXSa4cIxu9Y3g5EUKd8kysHEPVFFHl3exRenWI5aRwcRqSzxF3 UHZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=SqeOROTqvGqutwzbLHT7TtaEXEncGL8b64Nd1KqiBB0=; fh=xgQPTrgLZQHuZj3y2k2Oo1btQSWdIEXXpp2hdMBXZPA=; b=hIjCk4VNB/R9c60uLahoDjfNf3FWmmwS4a4LsSHDXI4Oo6v8UbfdU/BtDGj0YY43uo bjvm7s9f8x4tL/sKpJ6v5js0TQqUc8k2JfVFVyBQ/t9mDxajGl7yM9q1plC7bMljnUVV GAcUB9Nf0LyzI2RR7KQd48Uz+KI3P5YxojN7SICSdw7AWePXcmRDvFFf9BVMFOKmomLl jNPl1Ef5c0NG65/EZFmk8u6DzuRAf+JaM6piXVze4nKMad1nTx67NR/TGeGWUrft7m34 xJcroTpqEGj6EPbPUmRiI1QPkH71gA3EofBTgFTrBgwFeuKSs9UAcOB+uCi9unml1tmN Q3rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u1-20020a170902e80100b001ca0a487ab2si3845024plg.200.2023.10.18.01.51.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 01:51:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xs4all.nl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2135F8027F02; Wed, 18 Oct 2023 01:51:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbjJRIum (ORCPT + 99 others); Wed, 18 Oct 2023 04:50:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229579AbjJRIui (ORCPT ); Wed, 18 Oct 2023 04:50:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A366EFD; Wed, 18 Oct 2023 01:50:36 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A00BEC433C8; Wed, 18 Oct 2023 08:50:33 +0000 (UTC) Message-ID: <4a74a40c-ee3c-4563-87d1-27e859eb6982@xs4all.nl> Date: Wed, 18 Oct 2023 10:50:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10 0/8] Add StarFive Camera Subsystem driver Content-Language: en-US, nl To: Jack Zhu , Mauro Carvalho Chehab , Robert Foss , Todor Tomov , bryan.odonoghue@linaro.org, Rob Herring , Krzysztof Kozlowski , Conor Dooley , Greg Kroah-Hartman , Philipp Zabel , Laurent Pinchart Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-staging@lists.linux.dev, changhuang.liang@starfivetech.com References: <20231008085154.6757-1-jack.zhu@starfivetech.com> <98297bfc-ab81-4bb5-acc3-619fdf879276@xs4all.nl> From: Hans Verkuil In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,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 howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 18 Oct 2023 01:51:06 -0700 (PDT) Hi Jack, On 18/10/2023 04:37, Jack Zhu wrote: >>> -------------------------------------------------------------------------------- >>> Compliance test for device /dev/v4l-subdev1: >>> >>> Driver Info: >>> Driver version : 6.6.0 >>> Capabilities : 0x00000000 >> >> But this does not appear for v4l-subdev1. >> >> I can't really tell why it doesn't show that. Can you debug a little bit? >> The code is in v4l2-compliance.cpp, line 1086: >> >> ent_id = mi_media_info_for_fd(media_fd, node.g_fd(), &is_invalid, &node.function); >> >> The mi_media_info_for_fd() function calls ioctl(media_fd, MEDIA_IOC_DEVICE_INFO, &mdinfo), >> and that fails for some reason. It could be that media_fd is invalid (would be weird). >> >> This could well be a v4l2-compliance bug that you hit with this driver. >> > > On the test board, /dev/v4l-subdev1 is imx219, and the corresponding directory is > /sys/dev/char/81:3/device. Media0 does not exist in this directory. Therefore, the media_fd > obtained through mi_get_media_fd(node.g_fd(), node.bus_info) is invalid. > > I don't know why media0 does not exist in /sys/dev/char/81:3/device? > Can you try again with this v4l2-compliance patch? I need to dig a bit deeper as to why media0 is missing, but for now try this. Regards, Hans diff --git a/utils/v4l2-compliance/v4l2-compliance.cpp b/utils/v4l2-compliance/v4l2-compliance.cpp index 7169eefe..29475d6b 100644 --- a/utils/v4l2-compliance/v4l2-compliance.cpp +++ b/utils/v4l2-compliance/v4l2-compliance.cpp @@ -968,7 +968,7 @@ err: } void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_node, media_type type, - unsigned frame_count, unsigned all_fmt_frame_count) + unsigned frame_count, unsigned all_fmt_frame_count, int parent_media_fd) { struct node node2; struct v4l2_capability vcap = {}; @@ -997,8 +997,12 @@ void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_ memset(&vcap, 0, sizeof(vcap)); } - if (!node.is_media()) - media_fd = mi_get_media_fd(node.g_fd(), node.bus_info); + if (!node.is_media()) { + if (parent_media_fd >= 0) + media_fd = parent_media_fd; + else + media_fd = mi_get_media_fd(node.g_fd(), node.bus_info); + } int fd = node.is_media() ? node.g_fd() : media_fd; if (fd >= 0) { diff --git a/utils/v4l2-compliance/v4l2-compliance.h b/utils/v4l2-compliance/v4l2-compliance.h index 7caf254b..c47f25f5 100644 --- a/utils/v4l2-compliance/v4l2-compliance.h +++ b/utils/v4l2-compliance/v4l2-compliance.h @@ -308,7 +308,7 @@ int check_ustring(const __u8 *s, int len); int check_0(const void *p, int len); int restoreFormat(struct node *node); void testNode(struct node &node, struct node &node_m2m_cap, struct node &expbuf_node, media_type type, - unsigned frame_count, unsigned all_fmt_frame_count); + unsigned frame_count, unsigned all_fmt_frame_count, int parent_media_fd = -1); std::string stream_from(const std::string &pixelformat, bool &use_hdr); // Media Controller ioctl tests