Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp229786pxp; Sat, 5 Mar 2022 02:48:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJx58AsK88zy2YzA1xPE95ilUSabBd75nXlFK87OBFFj4lVHH9/JyF7is0iA5OTM9wIMjs/q X-Received: by 2002:a17:906:a152:b0:6cd:3098:18c9 with SMTP id bu18-20020a170906a15200b006cd309818c9mr2381970ejb.422.1646477329616; Sat, 05 Mar 2022 02:48:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646477329; cv=none; d=google.com; s=arc-20160816; b=xWizkrnU9HRBM/P5QdZQ88UzfJunBw2zkIzKlJel7ymt/XkgcDYONpilvLgTGJfIwy kkX+8NRVSedufiu7/aO7HQDX8NxwxxyHldihQGAuvsDDJG5VgciLu0m65C6jRL9beIk9 MK4X2QcbgoK2SUX62/ojI5b/DnaxemDCENWYPFW+3y3UtLB6Lz6Q7iJORlw6ItnOU6id pvcV+S+YDL53Mbl163gtLLGtSID870IAdykfkAjUXMgPB77e8Sc//e7Bvl/Z7xlkxQTF UmQdwrFAdfbodyeDs1d9BtGAOn6xNTLihETvId+hJqv28tJ9w6MEOD9J52rs3kp2zbdx Wx8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=Rd2dzRhbC7TMKXZYXCyMjIw3Nh9dHZcfGisq2xIWIBY=; b=hU+A1oG5V1sQgMaHAjlvIzQtOaKm5L4YRj0V3lvhmcsE7wSSIxfNW3AV9Mtx2X9hCd dGqSlWDp5Xb02wJo8hyvLkaE70a0SMzIxHOp5t7K1jPthIXZPWTiJMJLV6kuvKc6Tmy6 5/B8Xm96o7hv9qDB0ZhqSoWoMcXX5YpsoMbSH+8ITvXomBOHowpnlMt9bGfeUT3i2HPx Cg4QIDWwRVLdetKhhUSJfSGB/scnDMoZh7Bf5Rbsr40YGlsd9SCGyycFjV0RGioXyfNh ULBlLkyMMpEvn3QTmtHsHeNt1LdkZ78MSnjgM8JeNEyUT7Fi6QIvnEFn7vVKzqmTA/Ze KCag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=kSLmZLvX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020a170906244400b006d6e52569bfsi4209673ejb.585.2022.03.05.02.48.11; Sat, 05 Mar 2022 02:48:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=kSLmZLvX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231448AbiCEHvN (ORCPT + 99 others); Sat, 5 Mar 2022 02:51:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231351AbiCEHvK (ORCPT ); Sat, 5 Mar 2022 02:51:10 -0500 Received: from mo4-p01-ob.smtp.rzone.de (mo4-p01-ob.smtp.rzone.de [81.169.146.165]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B54041C11D; Fri, 4 Mar 2022 23:50:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1646466598; s=strato-dkim-0002; d=goldelico.com; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject:Cc:Date: From:Subject:Sender; bh=Rd2dzRhbC7TMKXZYXCyMjIw3Nh9dHZcfGisq2xIWIBY=; b=kSLmZLvXfi/dtKgen6iTcjlzMLBh9l8EZfiflqV8TCRolJEisq6/9FMB3bsmN2+Kru AXBiAZah3tu0zY7v3wM2FSSAuwIiQnlYIW6Bx7mr6rcAQaHE/lhMeUJ6DZEP0R68wiyb jsQC/1dKEpQxmP5cTqyh9thzgUcHPTgiTVXamAuGeCjokl9VOUF2aO7GfDE/dCMYQ6XG Y0Ol5lW/n64nPTYHl399XUyptDnEi3x3KIybp0CkXooSgMgRMtN9znQTgEejzq+8UumB vV+o5iUNZwAQLtzDsIDo+3kLRRfpchN+DANlCBw0eH3JpIo9rZIA4zXVya9RAEPcfR4D +DPg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj7gpw91N5y2S3i8cX7w==" X-RZG-CLASS-ID: mo00 Received: from imac.fritz.box by smtp.strato.de (RZmta 47.40.1 DYNA|AUTH) with ESMTPSA id n729cey257nuBmA (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve X9_62_prime256v1 with 256 ECDH bits, eq. 3072 bits RSA)) (Client did not present a certificate); Sat, 5 Mar 2022 08:49:56 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [Letux-kernel] [PATCH v16 1/4] drm/bridge: dw-hdmi: introduce dw_hdmi_enable_poll() From: "H. Nikolaus Schaller" In-Reply-To: <02FDA8C2-68FD-4EB8-9846-AF510D16424D@goldelico.com> Date: Sat, 5 Mar 2022 08:49:56 +0100 Cc: Paul Boddie , Andrzej Hajda , Maxime Ripard , Jonas Karlman , David Airlie , Robert Foss , linux-mips , dri-devel , linux-kernel , Kieran Bingham , Jernej Skrabec , Discussions about the Letux Kernel Content-Transfer-Encoding: quoted-printable Message-Id: References: <983e9064-17ad-e646-f37d-ca9173ba0967@baylibre.com> <3E620AF4-402E-45EA-9D92-92EAEA9647F5@goldelico.com> <929BF693-D54F-40F0-BB61-520301D1C31F@goldelico.com> <8JF88R.9V5YQ3Q6E8QO2@crapouillou.net> <5CC8B441-AA50-45F5-A5D3-2F40F72A1B50@goldelico.com> <02FDA8C2-68FD-4EB8-9846-AF510D16424D@goldelico.com> To: Paul Cercueil X-Mailer: Apple Mail (2.3445.104.21) X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Hi Paul, > Am 04.03.2022 um 19:41 schrieb H. Nikolaus Schaller = : >=20 >=20 >=20 >> Am 04.03.2022 um 19:33 schrieb Paul Cercueil : >>=20 >>=20 >>=20 >> Le ven., mars 4 2022 at 19:15:13 +0100, H. Nikolaus Schaller = a =C3=A9crit : >>> Hi Paul, >>>> Am 04.03.2022 um 19:04 schrieb Paul Cercueil = : >>>> Le ven., mars 4 2022 at 18:51:14 +0100, H. Nikolaus Schaller = a =C3=A9crit : >>>>> Hi Paul, Neil, >>>>>> Am 04.03.2022 um 17:47 schrieb Paul Cercueil = : >>>>>> =46rom what I understood in Nikolaus' last message, HDMI hotplug = is actually correctly detected, so there's no need for polling. What is = missing is the call to drm_kms_helper_hotplug_event *somewhere*, so that = the information is correctly relayed to userspace. >>>>> Exactly. >>>>> As Maxime pointed out it should already be called by = drm_helper_hpd_irq_event() in dw_hdmi_irq() but isn't >>>>> because mode_config.poll_enabled isn't enabled. >>>>> So we can either >>>>> a) enable mode_config.poll_enabled so that it is called by = drm_helper_hpd_irq_event() or >>>>> b) make drm_kms_helper_hotplug_event() being called explicitly in = dw_hdmi_irq(). >>>>> We could guard that by mode_config.poll_enabled to avoid = drm_kms_helper_hotplug_event() >>>>> being called twice (but I think the "changed" mechanism will take = care of). >>>>>> I think this issue can be fixed by calling = drm_bridge_connector_enable_hpd() on the connector in ingenic-drm-drv.c. >>>>> I don't see yet how this would solve it, but it may work. >>>> dw_hdmi_irq() calls drm_bridge_hpd_notify(), which would call = bridge->hpd_cb() if it was non-NULL. >>> Ok, this is a case c). >>> I vaguely remember having tried to analyse what bridge->hpd_cb is = but stopped since it is NULL... >>>> Calling drm_bridge_connector_enable_hpd() will set the = bridge->hpd_cb() callback to point to drm_bridge_connector_hpd_cb(), = which itself will call drm_kms_helper_hotplug_event(). Therefore, all = that is missing is one call to drm_bridge_connector_enable_hpd(). >>> Ah, ok, I see. >>>>> Anyways, this all is a missing feature (sometimes called "bug") of = the *dw-hdmi driver* and IMHO >>>>> neither of the connector nor the ingenic-drm-drv. >>> Well, a little more analysis shows that = drm_bridge_connector_enable_hpd is called >>> in the *-drv.c for some other plaforms: >>> = https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/imx/dcss/dc= ss-dev.c#L292 >>> = https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/imx/dcss/dc= ss-kms.c#L145 >>> = https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/omapdrm/oma= p_drv.c#L393 >>> = https://elixir.bootlin.com/linux/v5.17-rc6/source/drivers/gpu/drm/msm/hdmi= /hdmi.c#L317 >>>>> So I think it should not be solved outside dw-hdmi. >>> Hm. Can we call drm_bridge_connector_enable_hpd() from inside = dw-hdmi? >>> Or would this be the solution if merged? (I currently can't try = code). >>> = https://lore.kernel.org/lkml/a7d0b013-6114-07b3-0a7b-0d17db8a3982@cogentem= bedded.com/T/ >>=20 >> Looks correct to me. It has been reviewed by two people so I believe = it will be merged very soon. >=20 > Great. I will try asap. If it works we can drop all our private = ideas... >=20 > And focus on the last missing piece for jz4780 HDMI: the output format = negotiation (which still is not working properly - but I have to analyse = why). Yes, it works. And I see you have merged it to drm-misc-next so that I = can build on it. So there is only the bus format negotiation to be understood and finally = solved for v17. Great and thanks, Nikolaus