Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2259977pxm; Fri, 4 Mar 2022 12:32:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjb+4tZYTC2H8TWDxRBNmmG22qHnYoSRvrlVZ4GyH8olP8M49Hj19fyyegBPASXrtrX3uc X-Received: by 2002:a17:90a:ccb:b0:1bc:e520:2284 with SMTP id 11-20020a17090a0ccb00b001bce5202284mr447415pjt.66.1646425941674; Fri, 04 Mar 2022 12:32:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646425941; cv=none; d=google.com; s=arc-20160816; b=vYxm6F9UGyAYg5I1tT2YBU+lRMkkk7wttGiLVn4mtbbi8gc5UxLefJgEpj3WMKg23H llrClWkYSngtCbbXYrcaDJ9wnRX5n97JvtOl4JVZ+H9gSDxmeEq6rDT9ACrVS0uwVXfn /C5So0GaVTz1OG4g/TdWEq0DUlfIjSviWL7pWPYFdzetyYpJGQ03cgttaZJEIp2Q+KKw uDj9tHsivu4ST6cb0v6oTR+OdICVjpezxUepmSUBBnN676n3hB36uwRL3YhCBfnrt0OU O9/Ygjqr4NApHvPG8YqXWQlmVEA4E/IfA3Tepx/KekzKvhhfLxEEIPURFwCt5/v+M9mv LOJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date; bh=yASb70dwW1Ef9hpamxfAcrsnNL4T7pPX5XqzhRFccQg=; b=TqXxBHKliCFFvay5gaU+OOf/T0AUPGb/UR3mikKMWEQKDFdkvHYF6M9Hi2HXLSR5X6 BepcyI3hS+D4ok6mQpddm0aAmpYwWtzTW1h4rh4xR1OYPkNKrOa/WXUfSRiGZLEabeS/ V0mBXdfYzkWPGAuxOB3MIMb7VTjJb60CRB6/Ma1HY066d5pCoSjtyV0HX3nMCkgzJDUG i2SWoNO2KIhcvg/7t9D3c7W0gSJ9yrif0SbcmpZFTDxlxVNIcUXHis9S/XmKc1rABQEl vUjoRDp+4MyAu2QkDwB+iM30DyuMDT/AZjJKupKbYBM5Me/RKdYn6EhMXAitxgw86JQ0 QcEA== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o13-20020a170903300d00b0014fd48eafdesi5088158pla.158.2022.03.04.12.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 12:32:21 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1B56E29D57A; Fri, 4 Mar 2022 11:36:14 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238743AbiCDSfC convert rfc822-to-8bit (ORCPT + 99 others); Fri, 4 Mar 2022 13:35:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235729AbiCDSfA (ORCPT ); Fri, 4 Mar 2022 13:35:00 -0500 Received: from aposti.net (aposti.net [89.234.176.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A2A55F66; Fri, 4 Mar 2022 10:34:12 -0800 (PST) Date: Fri, 04 Mar 2022 18:33:59 +0000 From: Paul Cercueil Subject: Re: [Letux-kernel] [PATCH v16 1/4] drm/bridge: dw-hdmi: introduce dw_hdmi_enable_poll() To: "H. Nikolaus Schaller" Cc: Neil Armstrong , 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 , Laurent Pinchart Message-Id: In-Reply-To: <5CC8B441-AA50-45F5-A5D3-2F40F72A1B50@goldelico.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Le ven., mars 4 2022 at 19:15:13 +0100, H. Nikolaus Schaller a ?crit : > 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 ?crit : >>> Hi Paul, Neil, >>>> Am 04.03.2022 um 17:47 schrieb Paul Cercueil >>>> : >>>> From 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/dcss-dev.c#L292 > https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/imx/dcss/dcss-kms.c#L145 > https://elixir.bootlin.com/linux/latest/source/drivers/gpu/drm/omapdrm/omap_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@cogentembedded.com/T/ Looks correct to me. It has been reviewed by two people so I believe it will be merged very soon. Cheers, -Paul