Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3134433ybz; Sun, 3 May 2020 18:11:50 -0700 (PDT) X-Google-Smtp-Source: APiQypKPLt9gxxVcVE39n8BtGvNjRp7IOYFKIaOXuLJnZDFkXFZhL91dHroPVeaC/FcEfPRBQDZc X-Received: by 2002:a05:6402:356:: with SMTP id r22mr13382698edw.3.1588554710556; Sun, 03 May 2020 18:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588554710; cv=none; d=google.com; s=arc-20160816; b=q3dE3LO4gIp5r98tKVpbDvUUdPJbYIxdK4I4RKFdoNgUOu6uZl6Ke+YEM/p9irjJqa 06UFLydtuIunYFEWl1cWFKsgKK1KbNmxtl+/XVak9nOtZrY3jsH1WU2zvy2Oyw005Smb FR01NBw4eGOp9w+edADF0koLDkq7f1P7zIQzG5wUxC8zmZaMhi1GZGjsOJWE8pUnlGR1 VTpw56f2ly+ShcIGEbL7q5BJkze/sOs/YpfyEtKGKqrrJ1v1gO9oDPbEDfJsrXd4kA8u xjlUAtUHF1s8nzmt5p3nh3k//l+HX9dcMh/9gPCqditDZVjSdw+97OtwGhluP0MXGqQg +YuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:cc:to:subject:from:date :dkim-signature; bh=F3RwTvS4W/Ru6HPIjFj+d9jqrjj8rrS76agrs9WAWAA=; b=l+/d4/KKzHNEwUrqeofSk7ASW2cmT2WN8yXIA+IspFUV4zW0qTl/V46js/4TIXiZfD 3Lmbg61gX8lBby3HXiKy2YKv06s+CQJO0rhb0A9diZ4vOD42rl6LFRfwQRFPf9R0EESX Y7QALiCuAlTbFkajqOk6UzXhwzmuaA/Y4s5AcLGy6n1XERUWGoYqkngG9f11XSnh2DvX l9I7ycDTYa7UscqVI8ggqB4w1d8PvXX4DMNI4XPsVCmsh2Uz4ZVRXa79uVmqfelN/ayv BtuXux0MS8yTTm3uS/T/wP5ppqf1M5f0Cb4udr0K2eyEBR7Cy73YSIt1jAVGE8QQkzYh knGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=JtCWfSGU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e25si5857437edv.157.2020.05.03.18.11.28; Sun, 03 May 2020 18:11:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@crapouillou.net header.s=mail header.b=JtCWfSGU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=crapouillou.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727090AbgEDBFh (ORCPT + 99 others); Sun, 3 May 2020 21:05:37 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:37862 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726282AbgEDBFg (ORCPT ); Sun, 3 May 2020 21:05:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1588554334; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=F3RwTvS4W/Ru6HPIjFj+d9jqrjj8rrS76agrs9WAWAA=; b=JtCWfSGUh9re+3gtwIPVYhHKnqMydySyvWFRBnxPdQAKrSWiJggKm7kP2Ph05Ebp13bNoI +MKgD6goxUhrjziZPjjkolIMpyezdg9oMQZoeimI6b9XAUNDW/oeQUqR4wGUH+XREi0Hi/ laW0mz6FxfeLc/Bnh8cccgXXwkkkBSM= Date: Mon, 04 May 2020 03:05:22 +0200 From: Paul Cercueil Subject: Re: DRM interaction problems on Ingenic CI20 / jz4780 with dw-hdmi and ingenic-drm To: "H. Nikolaus Schaller" Cc: Dave Airlie , Sascha Hauer , Andy Yan , Yakir Yang , Vladimir Zapolskiy , Paul Boddie , linux-mips@vger.kernel.org, Linux Kernel Mailing List , MIPS Creator CI20 Development Message-Id: In-Reply-To: <125Q8Q.9F49TXF6ZICX1@crapouillou.net> References: <125Q8Q.9F49TXF6ZICX1@crapouillou.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Nikolaus, So I just wrote a HDMI driver for a different chip, I guess I can=20 answer some of your questions now. Le lun. 13 avril 2020 =E0 13:25, Paul Cercueil a=20 =E9crit : > Hi Nikolaus, >=20 >=20 > Le sam. 11 avril 2020 =E0 16:14, H. Nikolaus Schaller=20 > a =E9crit : >> Hi, >> we (Paul Boddie and me) are working to get HDMI functional on the >> Ingenic CI20 board with jz4780 SoC which uses a specialization of >> the dw-hdmi driver. >>=20 >>=20 >> So far we have identified two issues. >>=20 >> The first is that HPD interrupts are not properly processed. >>=20 >> drm_helper_hpd_irq_event() is called by HPD events but >> dev->mode_config.poll_enabled is false. >>=20 This is to be used when there's no hardware interrupt. I believe you=20 have one, right? Then call drm_kms_helper_hotplug_event() from the=20 interrupt handler instead. >> Therefore the interrupt is ignored and nothing happens. >>=20 >> Now I wonder about the logic behind checking for poll_enabled. >> I understand that a driver can do either polling or irq or both. >>=20 >> Therefore handling the irq_event shouldn't be disabled by=20 >> poll_enabled >> being false. Otherwise we can only do: nothing, polling, polling+irq >> but not irq alone. >>=20 >> The jz4780 hdmi subsystem (drm/bridge/dw-hdmi.c) uses >>=20 >> connector->polled =3D DRM_CONNECTOR_POLL_HPD; >>=20 >> but shouldn't this enable polling? Note that there seems to be >> no (direct) call to drm_kms_helper_poll_init(). >>=20 >> If we set dev->mode_config.poll_enabled =3D true in >> drm_helper_hpd_irq_event() things start to work. >>=20 >> Please can you clarify what would be best practise here to >> get HPD event handling working. >>=20 Remove that - this stuff is for hardware without interrupts, where=20 everything has to be polled. >> The other issue is in dw-hdmi.c: >>=20 >> We found out that ingenic_drm_encoder_atomic_check() fails because >>=20 >> info->num_bus_formats =3D=3D 0 >>=20 >> and not 1. This blocks further initialization. >>=20 >> The reason seems to be that dw_hdmi_bridge_attach() does not call >> drm_display_info_set_bus_formats() with a proper format like >> other drivers (e.g. drm/bridge/ti-tfp410.c) are doing. >>=20 >> We have patched to set a single bus format MEDIA_BUS_FMT_RGB888_1X24 >> and then DRM setup seems to work (although we still have no valid >> HDMI signal but that is likely something else). >>=20 >> Please can you explain how setting the bus format should be fixed >> in dw-hdmi.c. >>=20 I'm not sure, but that information may come from EDID data. Are you=20 able to obtain video modes from the connected monitor? -Paul >> If these questions should be forwarded to other specialists, please >> do so. >=20 > It should be sent to the DRI mailing list, you missed the most=20 > important one. >=20 > -Paul >=20 >>=20 >> BR and thanks, >> Nikolaus Schaller