Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2176217rdf; Mon, 6 Nov 2023 06:56:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGRsC6KsFRVRJ3HlLrysF0uSX7usJYvzNGjoR+KcCLUnwe6dIxOosmU6oMDH+nny80BoPFQ X-Received: by 2002:a05:6871:3905:b0:1e9:de31:8000 with SMTP id og5-20020a056871390500b001e9de318000mr26117321oac.9.1699282573490; Mon, 06 Nov 2023 06:56:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699282573; cv=none; d=google.com; s=arc-20160816; b=B6o23exFdDjws/yPEy3actcSsEOqZiIrAKqJokJvzvKwWqeNNmtevgBu4btQimtPmj eUBaZKelZ9pfYpO5ZeBzYa4yO+WqcKUh/f3xWv2dGdlGW4DUA9l0AGD7yzjuumg4TQEo CZNyIrGC0+oIE35CoGrRL8KjN96PAilJ1eVKDySSM+yRGbitDAF3cDAXsL8XvXsO27ap i76sQsMgJwMV9zVM1JHU6LY2PrXiT5e/0LoXUtjwYTvDXbwtVUYvOuocqoBIuYn2mBa+ YxU+kBij/a/4xod6ahgO4xuQ+qM07HALWahR7GQLLqWlMVcNBtG1eLi3rY46KVyM97Fc tnjA== 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:autocrypt :from:references:cc:to:content-language:subject:user-agent :mime-version:date:message-id; bh=VcHZJINnHMsNrk67k3WgzUV+klLswN3m5K8xd+ASDjI=; fh=VWtNaRxL1BdkOm3+HamD6/9+UXeXqNt6Go8VMIcQ+E4=; b=E6/Ay0PlLB9BC8AUJQGrliR6Pnht1q0SPEYWGBmZSJud0njz5sEDA1usRu3TVvWTRk SwHG/lLdll61pdrXiXzkEOrNfqyLrpGk4tuPpYKmfQn4O8BqrB9zWISMMRarXx83/aX9 geihc1MeewJygYoZS3ezHDfvc6j3XI41V6pIIw8sbf5leRffP9HuXY83ou9MQo7YcduO CXXEjVbV7kVbPubvgpSgXscKtjNg6m/FIBzOb+zXk0BeDz+y9aeuY9PIikNsflJ6YtJI 6iijvKiczhVwkvxZs2iyrDU61/H+5oSkBFIxZV7qIQ0peSrXZ+FljEbeIsRQLRnbQ70c JZOQ== 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:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id bc14-20020a656d8e000000b005b970288ac1si8897410pgb.190.2023.11.06.06.56.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 06:56:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (Postfix) with ESMTP id 45E2F8093438; Mon, 6 Nov 2023 06:55:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231767AbjKFOz0 (ORCPT + 99 others); Mon, 6 Nov 2023 09:55:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229974AbjKFOzY (ORCPT ); Mon, 6 Nov 2023 09:55:24 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD2B4BB; Mon, 6 Nov 2023 06:55:21 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AD41FC433C8; Mon, 6 Nov 2023 14:55:17 +0000 (UTC) Message-ID: Date: Mon, 6 Nov 2023 15:55:15 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH RFC v3 12/37] drm/connector: hdmi: Create Infoframe DebugFS entries Content-Language: en-US, nl To: Maxime Ripard Cc: Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Emma Anholt , Jonathan Corbet , Sandy Huang , =?UTF-8?Q?Heiko_St=C3=BCbner?= , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-sunxi@lists.linux.dev References: <20231031-kms-hdmi-connector-state-v3-0-328b0fae43a7@kernel.org> <20231031-kms-hdmi-connector-state-v3-12-328b0fae43a7@kernel.org> <806f2ad3-c80b-41e5-9388-f1af7bace8e3@xs4all.nl> From: Hans Verkuil Autocrypt: addr=hverkuil@xs4all.nl; keydata= xsFNBFQ84W0BEAC7EF1iL4s3tY8cRTVkJT/297h0Hz0ypA+ByVM4CdU9sN6ua/YoFlr9k0K4 BFUlg7JzJoUuRbKxkYb8mmqOe722j7N3HO8+ofnio5cAP5W0WwDpM0kM84BeHU0aPSTsWiGR yw55SOK2JBSq7hueotWLfJLobMWhQii0Zd83hGT9SIt9uHaHjgwmtTH7MSTIiaY6N14nw2Ud C6Uykc1va0Wqqc2ov5ihgk/2k2SKa02ookQI3e79laOrbZl5BOXNKR9LguuOZdX4XYR3Zi6/ BsJ7pVCK9xkiVf8svlEl94IHb+sa1KrlgGv3fn5xgzDw8Z222TfFceDL/2EzUyTdWc4GaPMC E/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jZCVHk/woaMZv c1Dm4Uvkv0Ilelt3Pb9J7zhcx6sm5T7v16VceF96jG61bnJ2GFS+QZerZp3PY27XgtPxRxYj AmFUeF486PHx/2Yi4u1rQpIpC5inPxIgR1+ZFvQrAV36SvLFfuMhyCAxV6WBlQc85ArOiQZB Wm7L0repwr7zEJFEkdy8C81WRhMdPvHkAIh3RoY1SGcdB7rB3wCzfYkAuCBqaF7Zgfw8xkad KEiQTexRbM1sc/I8ACpla3N26SfQwrfg6V7TIoweP0RwDrcf5PVvwSWsRQp2LxFCkwnCXOra gYmkrmv0duG1FStpY+IIQn1TOkuXrciTVfZY1cZD0aVxwlxXBnUNZZNslldvXFtndxR0SFat sflovhDxKyhFwXOP0Rv8H378/+14TaykknRBIKEc0+lcr+EMOSUR5eg4aURb8Gc3Uc7fgQ6q UssTXzHPyj1hAyDpfu8DzAwlh4kKFTodxSsKAjI45SLjadSc94/5Gy8645Y1KgBzBPTH7Q== 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Mon, 06 Nov 2023 06:55:45 -0800 (PST) On 06/11/2023 15:44, Maxime Ripard wrote: > Hi Hans, > > On Fri, Nov 03, 2023 at 10:05:18AM +0100, Hans Verkuil wrote: >> Hi Maxime, >> >> Thank you for posting v3, this time it runs fine on my RPi 4, thank you for >> fixing that. >> >> I'll start working on a conformity checker for this. > > Awesome :) And anyone who is interested can find the work-in-progress for that here: git://linuxtv.org/hverkuil/edid-decode.git Use the -I option to point to the file containing the infoframe to parse it. Later it will also check the conformity of the infoframe against the display's EDID. That's why this is part of edid-decode since you need an EDID parser to verify if the InfoFrames are also conform the standards. > >>> +static int create_hdmi_infoframe_files(struct drm_connector *connector, >>> + struct dentry *parent) >>> +{ >>> + int ret; >>> + >>> + ret = CREATE_HDMI_INFOFRAME_FILE(connector, parent, audio); >>> + if (ret) >>> + return ret; >>> + >>> + ret = CREATE_HDMI_INFOFRAME_FILE(connector, parent, avi); >>> + if (ret) >>> + return ret; >>> + >>> + ret = CREATE_HDMI_INFOFRAME_FILE(connector, parent, drm); >> >> Hmm, I had to look into the code to figure out that 'drm' stands for >> Dynamic Range and Mastering InfoFrame. While entirely correct, it is >> also very confusing in the context of the 'drm' subsystem. >> >> I am not quite certain what the best approach is here. >> >> Internally in the drm code it is talking about 'hdr' or 'hdr metadata', >> but that's a bit confusing as well since there is also an HDR Dynamic >> Metadata Extended InfoFrame defined in CTA-861, even though support for >> that is not (yet) implemented in drm. >> >> At minimum there should be a comment in the code explaining what drm >> stands for in this context. >> >> One option to consider is renaming this file to hdr_drm, thus indicating >> that this is HDR related. > > I ended up doing both, thanks for the suggestion > >>> + if (ret) >>> + return ret; >>> + >>> + ret = CREATE_HDMI_INFOFRAME_FILE(connector, parent, spd); >>> + if (ret) >>> + return ret; >>> + >>> + ret = CREATE_HDMI_INFOFRAME_FILE(connector, parent, vendor); >> >> There may be multiple vendor specific InfoFrames in the future, so how >> would that be handled? Perhaps add a comment here that currently only one >> vendor specific InfoFrame is supported, but suggest how to handle multiple >> VSIFs in the future. >> >> What would actually be nice (although probably not that easy to fix) is if >> the name of the file would be "vendor-XXXXXX' where 'XXXXXX' is the IEEE OUI >> number. > > I guess it's not entirely clear to me what that would look like. In > order for the framework to create the debugfs files, we would need some > enumeration mechanism (probably through a callback?), and then the > driver would generate the entire content of that file. > > Which makes me question whether the framework should be initialised at > all? Maybe the simpler would be to just have drivers maintain their own > debugfs files and storing the content in their own, private, structure. It's a good question. And I also would like to use this for HDMI receivers (so using it in the media subsystem). Let me try and find some time this week or next week to dig into this a bit more and see if I can implement it on the media side as well. See what would be the best approach here. It would not surprise me if the debugfs part should move to video/hdmi.c since that's already used by both drm and media. Regards, Hans > > Maxime