Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp413910pxb; Thu, 23 Sep 2021 02:58:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/s/5EJLJ7KoDsgbWl86kpcDxv2BYB5c+5MUVzri1vOb2QHjx8sNTgqp5337rprQ10cndJ X-Received: by 2002:a05:6e02:1c24:: with SMTP id m4mr3021647ilh.296.1632391121418; Thu, 23 Sep 2021 02:58:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632391121; cv=none; d=google.com; s=arc-20160816; b=Fs7chpsRvJ+Wvgm9UhMNpwCZlFD3+BlGkd1yJ71j29rV+LZAwriphyq/UkgRj2Ei4o HqtYQpfBcREguvOHcMFipdoFzhx7KjBujXejAZrmjX7imz4zCKL5v+CgQGZT33CbKdQn /kXOiFKo3V/YXSGLv8mOYsMaTjVZNxeyfPFZk72FXYm/5yAj7zV1h6+cUIMPYuvCGUyn Ggop6jhR+nPSAbn+UH1Dzd6Qly/i6jEG4vDwnA3DESWiiOmt17sATlwmczdbjChZ+BkE bpbd0uqM75Xz2q4VLvls3ZJMQsgCKB+OEmY7B93LY6cfrIfcyyNk2An6QQq+zJGgVDi5 XSSw== 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=IDa2WRPuoV8CULciRg09mSJXzbHkCaX4O0lSs6y9dGE=; b=tYGNsomNIOV+8YO7jgxmBqxJ0NoPLOPHxkPX1473JPnqHzMiRpiC/3q9JlwwL4Ve3a pDUjzRkIGqcKG03dQojNZHYEI5UIEnH34xN3fygO92EAwFec5ytzKDKBuBZSTy7lrsdd YN07uY3/lskvQHVz6H8L6NFAUNikUXwZBCFS32ZKqTR1slbkD44QFlwpS5p+bI/iwdbq P7rnIdfo7P0l8+tsXHs/TdUcU0kJXEu2iUwCtZFT8jeTh8sfd3tyLMcGc44VsJQJyucX tdUZSvhKANUY1hDqR5AVmUIedXPJo/Sqp7f9d47pj/xSdZe2BXqZLcwMLBPjIKgjcait UlpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=tkVfb50y; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si7683275ilu.143.2021.09.23.02.58.30; Thu, 23 Sep 2021 02:58:41 -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=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=tkVfb50y; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240249AbhIWJ5h (ORCPT + 99 others); Thu, 23 Sep 2021 05:57:37 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([81.169.146.164]:33854 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240186AbhIWJ5g (ORCPT ); Thu, 23 Sep 2021 05:57:36 -0400 X-Greylist: delayed 14621 seconds by postgrey-1.27 at vger.kernel.org; Thu, 23 Sep 2021 05:57:35 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1632390957; 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=IDa2WRPuoV8CULciRg09mSJXzbHkCaX4O0lSs6y9dGE=; b=tkVfb50yJlQybJnTBzTJKcoVxEr+elg/cQMPH+u9N2TfkQZSpM09MifNmf9qLIMp1d QM5l5mfYcDcYxQVtOj03xV9In2oybH5VcPjASz3gYjbdQyyNmmEg53t6L/BE9vBLr0Ey Ii32vKYG44IxMYz/jARWiVOaBQJsIs/xxcIneYXgZREjvA47AS0FBfIsy/yZM1ZB8+Tl 01SrcL9tss2omRiicmfXYjlkpzGkM+cux0U6J98p8YKqHyMNgqaxGiUV+Eti3UO/6e+I drqypRJaK7KpLoAQOB2Y9+IwNUkxKKIhuoNLljKM9JNJg3LoXRaZACwqElcM5UlGuD1X 9/wg== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMgPgp8VKxflSZ1P34KBj7gpw91N5y2S3iMUQeg==" X-RZG-CLASS-ID: mo00 Received: from mbp-13-nikolaus.fritz.box by smtp.strato.de (RZmta 47.33.8 SBL|AUTH) with ESMTPSA id I01f74x8N9tvJPn (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); Thu, 23 Sep 2021 11:55:57 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.21\)) Subject: Re: [PATCH v3 6/6] drm/ingenic: Attach bridge chain to encoders From: "H. Nikolaus Schaller" In-Reply-To: Date: Thu, 23 Sep 2021 11:55:56 +0200 Cc: Paul Cercueil , David Airlie , Daniel Vetter , linux-mips , list@opendingux.net, dri-devel , linux-kernel , Paul Boddie Content-Transfer-Encoding: quoted-printable Message-Id: <3764505C-7CA9-40C4-8CFA-8B0F2361E6D5@goldelico.com> References: <20210922205555.496871-1-paul@crapouillou.net> <20210922205555.496871-7-paul@crapouillou.net> <32234186-1802-4FDF-801A-B14E48FB86D8@goldelico.com> <896D04E4-4058-474B-8BD2-7F21B1C754E4@goldelico.com> To: Laurent Pinchart X-Mailer: Apple Mail (2.3445.104.21) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Laurent, > Am 23.09.2021 um 11:27 schrieb Laurent Pinchart = : >=20 > Hi Nikolaus, >=20 > On Thu, Sep 23, 2021 at 11:19:23AM +0200, H. Nikolaus Schaller wrote: >>=20 >>>>> + ret =3D drm_bridge_attach(encoder, &ib->bridge, NULL, >>>>> + DRM_BRIDGE_ATTACH_NO_CONNECTOR); >>>>=20 >>>> DRM_BRIDGE_ATTACH_NO_CONNECTOR makes it fundamentally incompatible >>>> with synopsys/dw_hdmi.c >>>> That driver checks for DRM_BRIDGE_ATTACH_NO_CONNECTOR being NOT = present, >>>> since it wants to register its own connector through = dw_hdmi_connector_create(). >>>> It does it for a reason: the dw-hdmi is a multi-function driver = which does >>>> HDMI and DDC/EDID stuff in a single driver (because I/O registers = and power >>>> management seem to be shared). >>>=20 >>> The IT66121 driver does all of that too, and does not need >>> DRM_BRIDGE_ATTACH_NO_CONNECTOR. The drm_bridge_funcs struct has >>> callbacks to handle cable detection and DDC stuff. >>>=20 >>>> Since I do not see who could split this into a separate bridge and = a connector driver >>>> and test it on multiple SoC platforms (there are at least 3 or 4), = I think modifying >>>> the fundamentals of the dw-hdmi architecture just to get CI20 HDMI = working is not >>>> our turf. >>>=20 >>> You could have a field in the dw-hdmi pdata structure, that would >>> instruct the driver whether or not it should use the new API. Ugly, >>> I know, and would probably duplicate a lot of code, but that would >>> allow other drivers to be updated at a later date. >>=20 >> Yes, would be very ugly. >>=20 >> But generally who has the knowledge (and time) to do this work? >> And has a working platform to test (jz4780 isn't a good development = environment)? >>=20 >> The driver seems to have a turbulent history starting 2013 in = staging/imx and >> apparently it was generalized since then... Is Laurent currently = dw-hdmi maintainer? >=20 > "Maintainer" would be an overstatement. I've worked on that driver in > the past, and I still use it, but don't have time to really maintain = it. > I've also been told that Synopsys required all patches for that driver > developed using documentation under NDA to be submitted internally to > them first before being published, so I decided to stop contributing > instead of agreeing with this insane process. There's public > documentation about the IP in some NXP reference manuals though, so it > should be possible to still move forward without abiding by this rule. >=20 >>>> Therefore the code here should be able to detect if = drm_bridge_attach() already >>>> creates and attaches a connector and then skip the code below. >>>=20 >>> Not that easy, unfortunately. On one side we have dw-hdmi which >>> checks that DRM_BRIDGE_ATTACH_NO_CONNECTOR is not set, and on the >>> other side we have other drivers like the IT66121 which will fail if >>> this flag is not set. >>=20 >> Ok, I see. You have to handle contradicting cases here. >>=20 >> Would it be possible to run it with DRM_BRIDGE_ATTACH_NO_CONNECTOR = first >> and retry if it fails without? >>=20 >> But IMHO the return value (in error case) is not well defined. So = there >> must be a test if a connector has been created (I do not know how = this >> would work). >>=20 >> Another suggestion: can you check if there is a downstream connector = defined in >> device tree (dw-hdmi does not need such a definition)? >> If not we call it with 0 and if there is one we call it with >> DRM_BRIDGE_ATTACH_NO_CONNECTOR and create one? >=20 > I haven't followed the ful conversation, what the reason why > DRM_BRIDGE_ATTACH_NO_CONNECTOR can't always be use here ? The synopsys driver creates its own connector through = dw_hdmi_connector_create() because the IP handles DDC/EDID directly. Hence it checks for ! DRM_BRIDGE_ATTACH_NO_CONNECTOR which seems to be = the right thing to do on current platforms that use it. For CI20/jz4780 we just add a specialisation of the generic dw-hdmi to make HDMI work. Now this patch for drm/ingenic wants the opposite definition and create = its own connector. This fails even if we remove the check (then we have two = interfering connectors). > We're moving > towards requiring DRM_BRIDGE_ATTACH_NO_CONNECTOR for all new code, so = it > will have to be done eventually. So from my view drm/ingenic wants to already enforce this rule and = breaks dw-hdmi. IMHO it should either handle this situation gracefully or include a fix = for dw-hdmi.c to keep it compatible. BR and thanks, Nikolaus