Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp31603244rwd; Fri, 7 Jul 2023 01:34:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlHAxyLz6sRhO8y7DMsyObCPB6Khr0qJG77DVc+6PDBt0w/MkDqb2rYak75zlAw6LLuUCHta X-Received: by 2002:a05:6358:2809:b0:134:ec9d:ef18 with SMTP id k9-20020a056358280900b00134ec9def18mr6166621rwb.28.1688718863402; Fri, 07 Jul 2023 01:34:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688718863; cv=none; d=google.com; s=arc-20160816; b=Gj7+vJ7gkW2LEBkAzw2pct1Y1r1FeshVr3dy9PJxmtDGrs7nYeGTRcDgHssn2+s5MY KUaI2pgPdb9JLxQnkaVVx2sJhgnGxPAsX00bfrYvcBEsnG1MoDcTlFbbzH1eu6BQ1fEG gfjYOnaGrXx+MaEhfoRGeKUVfFURpUvjXmygXSBOsF6rEDED8dU9aZkgqlNiztXlqnKu hD3uR205QcgI1fuf54N5+XQcxny3d9fpZwcCyIm8VacOd5+9MluphxDU2jIjn3Y5dSva /Pl87tCBcmbF8tscMPKWld5p8TkvC4eeV03zmn++KwtLEB87YJ9Uv3O4DIMv9vJR6KM5 DJtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=UICQMdLCdvd6RrW7LjkYioIbHWT7wIioRRBI6u6YoTQ=; fh=hTQrtCwMunqqOjFQ29qTH17VOvDhgHl2wuauRwD/TRA=; b=jP7XVDH2jU0SYx+iAAvX/Gy2MNPed7vyCgK0Si0SwET/R5iHkj5akXEOtVcG1T6cIt 1x4pWBE6xYMicar9HpBgGHcT9Q/S0Rs3bjfZ3s3P7thkMmNGxZvM6FS1ZBuSytfGdEp6 8VMMUgFdU96TC90geUSiu6LSGmsKYopZcksXCD/b/r5dLbiL6MZw6OdkcY6d39BM55Ep KFejO7huiQ/2kloU2iRjoeBXoxixvrEOVb9Akcy8fuhAMsqN8ovM1NI9JK/cr4O1KE9P HnmtE1VkvTNvnWmNd3vsm8uJk0BaDWHPAcjdRFTQjS1AVVvBbnKZg++KT44wTKOSEb/w MSlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=hz3k4VuE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fd34-20020a056a002ea200b00668724d0816si3529505pfb.38.2023.07.07.01.34.11; Fri, 07 Jul 2023 01:34:23 -0700 (PDT) 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=@chromium.org header.s=google header.b=hz3k4VuE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232674AbjGGIXk (ORCPT + 99 others); Fri, 7 Jul 2023 04:23:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231912AbjGGIXi (ORCPT ); Fri, 7 Jul 2023 04:23:38 -0400 Received: from mail-vk1-xa2e.google.com (mail-vk1-xa2e.google.com [IPv6:2607:f8b0:4864:20::a2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7EE81FC9 for ; Fri, 7 Jul 2023 01:23:27 -0700 (PDT) Received: by mail-vk1-xa2e.google.com with SMTP id 71dfb90a1353d-47e35eba3e9so564286e0c.2 for ; Fri, 07 Jul 2023 01:23:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1688718207; x=1691310207; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=UICQMdLCdvd6RrW7LjkYioIbHWT7wIioRRBI6u6YoTQ=; b=hz3k4VuEy6wOXt0lpPW/xMVBDzyZvDuKbgWkY4EGFNjYwXz8DCR8+LcYru9Byh2iMT SDaNg56+FHWdEK4jTB1lH6ryhTs8aNRFH17wBz/E2P+TyLbJm3RmEpaf++GYdKuilvo/ xQUM55FuqVn8TNmVKwPczVS0HW9/lr3B0W1Gs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688718207; x=1691310207; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UICQMdLCdvd6RrW7LjkYioIbHWT7wIioRRBI6u6YoTQ=; b=VvC63yK4JXuQncZWXhc77JfB3+KDzxbeAAQtNurHRHP4zFj3kPI+IapsTbChCbHmLC aHU6IK23iAC30mASw0D/JMza0kS5JO+09IDt/cF4GFQkhWu1xWkng6Zq0zIWRAbbnCgw rzuezj+RtE9IejTSEd4gYyj9NyDJc2e1/MQmVFeOMB1on3eJMUlxiY0kKhwgzUgHDUYP glCwqFWXEywAduaZh907w7pxTANG2SAZA6Dg4jhalZNXuGTVVOSezUyPkMSyw9QjtrVg K1vGLbcP2c4YBT2CPyBhGkE+dS4orsB1Mmi1Di7v6wk57emU3XUoqbZzD/DoPo+cotXv 9EsA== X-Gm-Message-State: ABy/qLYcpYRoCqXrXTmesat34OHDEHBOzXIoPQ2jdhyNDQ+llZXOSgV6 dNvgdufyRXs9g5aAtRG5t63AZzB/JEx4dzdxMBaC84z1723ifWEi X-Received: by 2002:a1f:4144:0:b0:47e:9bbb:103b with SMTP id o65-20020a1f4144000000b0047e9bbb103bmr1455691vka.6.1688718206907; Fri, 07 Jul 2023 01:23:26 -0700 (PDT) MIME-Version: 1.0 References: <20230706123025.208408-1-angelogioacchino.delregno@collabora.com> In-Reply-To: <20230706123025.208408-1-angelogioacchino.delregno@collabora.com> From: Chen-Yu Tsai Date: Fri, 7 Jul 2023 16:23:15 +0800 Message-ID: Subject: Re: [PATCH v4 0/9] MediaTek DisplayPort: support eDP and aux-bus To: AngeloGioacchino Del Regno Cc: chunkuang.hu@kernel.org, p.zabel@pengutronix.de, airlied@gmail.com, daniel@ffwll.ch, matthias.bgg@gmail.com, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kernel@collabora.com, nfraprado@collabora.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Thu, Jul 6, 2023 at 8:30=E2=80=AFPM AngeloGioacchino Del Regno wrote: > > Changes in v4: > - Set data lanes to idle to prevent stalls if bootloader didn't > properly close the eDP port > - Now using the .done_probing() callback for AUX bus to prevent > probe deferral loops in case the panel-edp driver is a module > as previously seen with another bridge driver (ANX7625) on > some other SoCs (MT8192 and others) > - Rebased over next-20230706 > - Dropped Chen-Yu's T-b tag on last patch as some logic changed > (before, I wasn't using the .done_probing() callback). > > Changes in v3: > - Added DPTX AUX block initialization before trying to communicate > to stop relying on the bootloader keeping it initialized before > booting Linux. > - Fixed commit description for patch [09/09] and removed commented > out code (that slipped from dev phase.. sorry!). > > This series adds "real" support for eDP in the mtk-dp DisplayPort driver. > > Explaining the "real": > Before this change, the DisplayPort driver did support eDP to some > extent, but it was treating it entirely like a regular DP interface > which is partially fine, after all, embedded DisplayPort *is* actually > DisplayPort, but there might be some differences to account for... and > this is for both small performance improvements and, more importantly, > for correct functionality in some systems. > > Functionality first: > > One of the common differences found in various boards implementing eDP > and machines using an eDP panel is that many times the HPD line is not > connected. This *must* be accounted for: at startup, this specific IP > will raise a HPD interrupt (which should maybe be ignored... as it does > not appear to be a "real" event...) that will make the eDP panel to be > detected and to actually work but, after a suspend-resume cycle, there > will be no HPD interrupt (as there's no HPD line in my case!) producing > a functionality issue - specifically, the DP Link Training fails because > the panel doesn't get powered up, then it stays black and won't work > until rebooting the machine (or removing and reinserting the module I > think, but I haven't tried that). > > Now for.. both: > eDP panels are *e*DP because they are *not* removable (in the sense that > you can't unplug the cable without disassembling the machine, in which > case, the machine shall be powered down..!): this (correct) assumption > makes us able to solve some issues and to also gain a little performance > during PM operations. > > What was done here is: > - Caching the EDID if the panel is eDP: we're always going to read the > same data everytime, so we can just cache that (as it's small enough) > shortening PM resume times for the eDP driver instance; > - Always return connector_status_connected if it's eDP: non-removable > means connector_status_disconnected can't happen during runtime... > this also saves us some time and even power, as we won't have to > perform yet another power cycle of the HW; > - Added aux-bus support! > This makes us able to rely on panel autodetection from the EDID, > avoiding to add more and more panel timings to panel-edp and, even > better, allowing to use one panel node in devicetrees for multiple > variants of the same machine since, at that point, it's not important > to "preventively know" what panel we have (eh, it's autodetected...!). > > This was tested on a MT8195 Cherry Tomato Chromebook (panel-edp on aux-bu= s) Do you have panel-edp built as a module? If I have it built in, the panel can correctly display stuff. If I have it built as a module, the panel is correctly detected, but the panel stays black even if DRM thinks it is displaying stuff. And it looks like EDID reading and panel power sequencing is still not working correctly, i.e. needs regulator-always-on? ChenYu > P.S.: For your own testing commodity, here's a reference devicetree: > &edp_tx { > status =3D "okay"; > > pinctrl-names =3D "default"; > pinctrl-0 =3D <&edptx_pins_default>; > > ports { > #address-cells =3D <1>; > #size-cells =3D <0>; > > port@0 { > reg =3D <0>; > edp_in: endpoint { > remote-endpoint =3D <&dp_intf0_out>; > }; > }; > > port@1 { > reg =3D <1>; > edp_out: endpoint { > data-lanes =3D <0 1 2 3>; > remote-endpoint =3D <&panel_in>; > }; > }; > }; > > aux-bus { > panel: panel { > compatible =3D "edp-panel"; > power-supply =3D <&pp3300_disp_x>; > backlight =3D <&backlight_lcd0>; > port { > panel_in: endpoint { > remote-endpoint =3D <&edp_out>; > }; > }; > }; > }; > }; > > > AngeloGioacchino Del Regno (9): > drm/mediatek: dp: Cache EDID for eDP panel > drm/mediatek: dp: Move AUX and panel poweron/off sequence to function > drm/mediatek: dp: Always return connected status for eDP in .detect() > drm/mediatek: dp: Always set cable_plugged_in at resume for eDP panel > drm/mediatek: dp: Change logging to dev for mtk_dp_aux_transfer() > drm/mediatek: dp: Enable event interrupt only when bridge attached > drm/mediatek: dp: Use devm variant of drm_bridge_add() > drm/mediatek: dp: Move AUX_P0 setting to > mtk_dp_initialize_aux_settings() > drm/mediatek: dp: Add support for embedded DisplayPort aux-bus > > drivers/gpu/drm/mediatek/mtk_dp.c | 197 +++++++++++++++++++----------- > 1 file changed, 127 insertions(+), 70 deletions(-) > > -- > 2.40.1 >