Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3673477rdg; Wed, 18 Oct 2023 02:38:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHRJ32PGYQnYbG+I80MtfyUuCU0Fv7P9PqOV5NFoZHSVYCq8q3Bpb/p3CbYSr1qx0RGo8KU X-Received: by 2002:a05:6a20:3d13:b0:16b:cc6c:d728 with SMTP id y19-20020a056a203d1300b0016bcc6cd728mr5241179pzi.44.1697621922756; Wed, 18 Oct 2023 02:38:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697621922; cv=none; d=google.com; s=arc-20160816; b=sfl2KkAtRW4iFzph+EDThKViag9+4BltlfyfOE9ecu02yKod7Kasfav3wL4apOV8PH UbPNBsN9KokI2FndMFe7fML4m/ITYMU7RiWGm1nFU6gBWD9i/4NegLlcjh65HOFJ5DXg Fe8ARWrqd+F7kj1lt5yY2WtVwNM25MKfdUj+gr/nVrVYo+RKOWNmrXUG5YCf/wlRQ6ZE nLM1qlCMaAFHC7Kx6kNyL0EAR5AYuW9WfIsUtrAvM/cdHK+C1NGJDA5UZOFq+/F1aAcz 02JK5m9DPxi0mTWb/IyUbqa038uDZ1HptTiAR+ZWAVFG7Am1VN2MTzPpWRzt7ut0dSQJ x43g== 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=aCz2UMVPaKJFj0QXcF6TycOSOMp/jwizT60vg6x7gJo=; fh=xgQPTrgLZQHuZj3y2k2Oo1btQSWdIEXXpp2hdMBXZPA=; b=flGd3u8dm26IDTQZZfDWkIkSVYJMNVDHhed4fJmXgfiljO34fkLw2lG9B2Xp/tKF6q xT4AD63u65JFtsEQBh0uCD2hRjstCsdfRTyVo6R+X8zU4SqnrPh6GkqZgxFfe8u2mq/K dLdCfvht92axVLlPbrj6Ops/uWE66LHwD09FTmFcgRwa7RmYQHJVQ5dS68FqT/u1qgUO Gw+h0e6muPs1RhiOdjUwZYfsEGL1uXIB2MNM6JrnqcXWIxU0ZPEfYMnhrwyLH7tZAihL RQHnIjDnvQ3/y4hj2hRX3AbCsgIiLzsbtIa8KRZ9tn+1qQEnlDtMH73pU0xG5iQAjA/k K6JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id u14-20020a170902e5ce00b001ca4ad86358si3901819plf.388.2023.10.18.02.38.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 02:38:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id B2E5680239E0; Wed, 18 Oct 2023 02:38:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbjJRJh6 (ORCPT + 99 others); Wed, 18 Oct 2023 05:37:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230059AbjJRJcc (ORCPT ); Wed, 18 Oct 2023 05:32:32 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 112BAD47; Wed, 18 Oct 2023 02:31:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 83C51C433C8; Wed, 18 Oct 2023 09:31:34 +0000 (UTC) Message-ID: <56a09e21-5f43-4d0d-b603-777bbfd1885f@xs4all.nl> Date: Wed, 18 Oct 2023 11:31:32 +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> <4a74a40c-ee3c-4563-87d1-27e859eb6982@xs4all.nl> <687a4c58-3666-1c7b-fcfd-d586c28dea35@starfivetech.com> From: Hans Verkuil In-Reply-To: <687a4c58-3666-1c7b-fcfd-d586c28dea35@starfivetech.com> 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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 02:38:30 -0700 (PDT) On 18/10/2023 11:25, Jack Zhu wrote: > > > On 2023/10/18 16:50, Hans Verkuil wrote: >> 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 >> > > From the log, there is no change. Oops, my mistake. Also apply this change: diff --git a/utils/v4l2-compliance/v4l2-test-media.cpp b/utils/v4l2-compliance/v4l2-test-media.cpp index 0195ac58..52ab7fb8 100644 --- a/utils/v4l2-compliance/v4l2-test-media.cpp +++ b/utils/v4l2-compliance/v4l2-test-media.cpp @@ -612,7 +612,7 @@ void walkTopology(struct node &node, struct node &expbuf_node, } testNode(test_node, test_node, expbuf_node, type, - frame_count, all_fmt_frame_count); + frame_count, all_fmt_frame_count, node.g_fd()); test_node.close(); } } Regards, Hans