Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp211990rdb; Thu, 19 Oct 2023 02:03:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJak7ZpWA2dCepT1UJlV9ihRiu5oT1Q2rWUjKGVGmP29scU4i8brK82BAYmOoNQRGEYVxU X-Received: by 2002:a17:90a:11:b0:27d:df04:d109 with SMTP id 17-20020a17090a001100b0027ddf04d109mr1846323pja.2.1697706194145; Thu, 19 Oct 2023 02:03:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697706194; cv=none; d=google.com; s=arc-20160816; b=uG1KXz+KMpFY1s//QIwcaL+3//NDpN1YHOdtCf4QFnIsCZKtnFkE7sdeHxHQK5Hb+4 NZrfxFC2JFkRXszLiLqkUg5OZ8YwJhgO5To7sTvaiEz4a5u/kBr59d9RsbKwgUxzper+ ftBElv5zr8koV7DywQerzCNggbWubjB55ZMo7ryDxihOwryWbsbSVDq0yuCbcjuX27Vu 4D42zajWC+GVTHPpwBzbNW2JSHKyXoRMsp1EBqHvqt6qqor0P9eUTp5qIiljp9us/H3i R2RLcRMQl2HHrP72pDBvPVXeiYpiEc1AOW2vpBvhiB2eXsS3qQvD09KEoycFgsnjOuKQ qcIw== 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:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id; bh=5kiMzEmhN+L0h2aKvLqmo+8SNawSWVFwAK4z/+PoUhQ=; fh=xgQPTrgLZQHuZj3y2k2Oo1btQSWdIEXXpp2hdMBXZPA=; b=l0Lcc1c6rXfx//yjNjzl+c0Y/WY+bf4NkDR/aDzjIKNXSBUcoh3kGxVtzBbil2KwgG EIZJ5hBCUbqWH2INz4dRB+HSR3brGbqVGkq0+byHVfeTFLkzeNNuxarb7XYv+M1h53GR ydZwkXbXkJw73/mcB/geeIdUWGr6a+XrHu/cU3Tqif1PfdU5QsbEvhZL3gBnurj68DFS tWLPbDp0Kq4kgjdcCvIK0Sscf6HVwSimVNtroy4ENdQryNETQ0FmuvPte6Pdqk6ljRUW aXwbhQMbh48HkXifzb9dXGYAswRquOKbmPgCheWyyXiTpx670j0yxOXIxGSwPtxWH8m6 MV6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id mu3-20020a17090b388300b0027b3755185dsi1933263pjb.99.2023.10.19.02.03.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 02:03:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 9F547822CAD5; Thu, 19 Oct 2023 02:03:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344938AbjJSJDJ (ORCPT + 99 others); Thu, 19 Oct 2023 05:03:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40164 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344985AbjJSJDH (ORCPT ); Thu, 19 Oct 2023 05:03:07 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 42E45129; Thu, 19 Oct 2023 02:03:05 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1255C433C8; Thu, 19 Oct 2023 09:03:00 +0000 (UTC) Message-ID: <994fa2ad-9e0e-4492-b5f5-bb09985108c8@xs4all.nl> Date: Thu, 19 Oct 2023 11:02:59 +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 From: Hans Verkuil 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> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 19 Oct 2023 02:03:12 -0700 (PDT) On 18/10/2023 11:56, Hans Verkuil wrote: > 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. Thank you for your help. This v4l2-compliance patch is in fact needed, and I have just pushed the fix. Regards, Hans