Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3679924rdg; Wed, 18 Oct 2023 02:56:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGya5Trwwaq5PyzYmtrGIrSVtBbFUj7Ur9GLpAsj4faYWyzgDJUI4YApfhHB8R/87U2p4Og X-Received: by 2002:a17:902:d48a:b0:1ca:87e5:9d72 with SMTP id c10-20020a170902d48a00b001ca87e59d72mr5857345plg.56.1697622994349; Wed, 18 Oct 2023 02:56:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697622994; cv=none; d=google.com; s=arc-20160816; b=BRN6xhCY/SX6xwbyusoE57p6hAgeVXNpHnJv7cbUVLN3ezhUnd+BPVXNXXpu07X5kX Lb6Avcv7+iHFjy0gOQ+Tq0N5TfWJuhObyQoGLaYny1uOPn/Gy0MkTSkREcZvR7eJaFf1 6mjmycRjaiq3w92B9dvhXm9WjGMAy+QwrShaAGq8DN7Uv1YlWduREQlqbtaFrd1yyXsr HnZJILCQ6tvE1/iM4rxfAqjIF6Y7CYZMmTFk+VeSdxlFZg9ZGswD5xx7no9BVHslOuEt OisuVk/LDtCxY3TflLGVN+c7fNom244P4aILm4+a/HpSXPpgU80xQulax+GsrzyBn8xv C6Iw== 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=MWYca27krfkgRLQY4C1I3F3FDDKXSpdfaTgv4Jldy+U=; fh=xgQPTrgLZQHuZj3y2k2Oo1btQSWdIEXXpp2hdMBXZPA=; b=cog0PMsHwe9hfe9r4qKHaM5CKSePIuR4gjE2lQukt3H7JFkDQ0r2fbR/fjrHz9SvEO wm4G7JJ7MXpfBXIqyc9u9ecyeDjC/0fpk90anqsSw7hkfKfX9ThPyu2wM6CybPoa1Oqs HIkGWW6S0YqbFjcqamFGAVDfMOkFdfykF73ZDpRaTL0xZxfqvw2Dx53KmlDk18xGYqCC dyhFnqxR0/KtiLSGEuA0bn5rcJ0hqnq3EcfM7/UZ1vuAk5LRUed8NnZbczSLYYGCe/9f sfoNliyjIfptd2uDbJmzdza/YOn2lbey0iSgDDEn7Q/34nagD4JZEJAp1/PD3p50KDpD L/pA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id ij5-20020a170902ab4500b001ca4e2a35efsi1666131plb.45.2023.10.18.02.56.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 02:56:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id C288B8050000; Wed, 18 Oct 2023 02:56:31 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229482AbjJRJ4R (ORCPT + 99 others); Wed, 18 Oct 2023 05:56:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbjJRJ4P (ORCPT ); Wed, 18 Oct 2023 05:56:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8C942B0; Wed, 18 Oct 2023 02:56:13 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BB26C433C7; Wed, 18 Oct 2023 09:56:10 +0000 (UTC) Message-ID: Date: Wed, 18 Oct 2023 11:56:08 +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> <56a09e21-5f43-4d0d-b603-777bbfd1885f@xs4all.nl> <6f5da0fa-9c01-dab2-647e-2a3c0a50b316@starfivetech.com> From: Hans Verkuil In-Reply-To: <6f5da0fa-9c01-dab2-647e-2a3c0a50b316@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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 18 Oct 2023 02:56:31 -0700 (PDT) On 18/10/2023 11:52, Jack Zhu wrote: > > > On 2023/10/18 17:31, Hans Verkuil wrote: >> 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(); >> } >> } >> > > Can see relevant Info in the log. Great! Can you do one more thing? Please run 'v4l2-compliance -m /dev/media0 --verbose' and mail the output to me. It's pretty big, so just email it to me, without CCs. I want to take a closer look at the output to see why this patch is needed. Regards, Hans