Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1004024pxb; Wed, 6 Apr 2022 06:30:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWaoKogLivEtDy0EbcXEXD453A6jbz/49dIekWYbK9RR9wy+iJ8ASCmIVnuW5pjRmg36n7 X-Received: by 2002:a17:90b:3851:b0:1c7:80f9:5306 with SMTP id nl17-20020a17090b385100b001c780f95306mr9886693pjb.207.1649251835769; Wed, 06 Apr 2022 06:30:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649251835; cv=none; d=google.com; s=arc-20160816; b=BjbMjlspMfJce6dtRLw54JOt/w5Nd7SxXYBMdHM38aM+GIr4pxfANtEpmYWazEjoYN DIKTx++HvkpX4RteRdUsiw2wPtZhhetvQHPpUcpZIfg4qRbW539V/jxRQDK43khpWcLP 3IFzG+o8Tt9XZJmHqj3B9pdnqikAFZDwf4zPp2mdFWXWwbTEbHU4j4f0wQ++L5CGOQsu EWPy12lEqzY6Y8/GWOb7WfBsEj/C6ityNr4a5SpjGmz9vHiaRyzHKACXiBHA7xZB13Xo /O+DuF3TSbOoqvPXzev5iP2BUADTCiXrYmkT2/VmVUkS8Z5Gj9Oa3YGiGn1wDOwb4us6 bfcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=660LH2+GxfU/Tt425A6dqO9O0qLu2gGwDombZrfKpU8=; b=TlVE59ZFvpeFIlX+P4+TokHJ6gSkcEU1bI31dOg3NXHLifMVqf9IWdWLnK0PhbFXc9 d2nI8bOFD2KIFGYbjUC7WAzl7cx3gZSgNlWG8x+PWewqiuD4vMYC2c2EzJSUWs1unz85 mgLMaSU2Yjo4CADqQ+yx0jssv7OSrUnJ0nijPCNSzWpER9o70xz0m3mObs7regOQpkha 6cY10Im1UMIHL2slLq3j3/tSUniSsHLVAzuqRe6JpCPRFZCsZoB6d8Q02OCqX2XHyDSN ZKiqbzK6xjP9LcysAS2IM7I8qVmEWux63iCsBwvowpqHmI7yOpf8ADdnsEy8P/jO7ttM 0Nnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="gwNC/cNN"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id e10-20020a170903240a00b00153e286ba0bsi14705909plo.520.2022.04.06.06.30.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 06:30:35 -0700 (PDT) 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; dkim=pass header.i=@chromium.org header.s=google header.b="gwNC/cNN"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 127A45C8194; Wed, 6 Apr 2022 04:08:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1390081AbiDEUGH (ORCPT + 99 others); Tue, 5 Apr 2022 16:06:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1573188AbiDESN6 (ORCPT ); Tue, 5 Apr 2022 14:13:58 -0400 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60DB286E3A for ; Tue, 5 Apr 2022 11:11:58 -0700 (PDT) Received: by mail-ej1-x629.google.com with SMTP id dr20so28247669ejc.6 for ; Tue, 05 Apr 2022 11:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=660LH2+GxfU/Tt425A6dqO9O0qLu2gGwDombZrfKpU8=; b=gwNC/cNNASSPrm/edmwXPk0X7RaQdKKSivzCUoyBbji7ak6C8kchHEP5egX8PkIP4C sazrZ+UZmtaVXMpC4qrc5t0H+eIPolaDcFXOFq2kJoDEq0rKnwf93q0H04FDyVTlple4 HndygiAgVBA2rSkB38vxENQIHCisJHKkZm1Uk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=660LH2+GxfU/Tt425A6dqO9O0qLu2gGwDombZrfKpU8=; b=8BHk+yFCo3qjn9hgz2i6T0MsBbhHuMhOwPk6AZM6bK1qeSxPu2mnTKGqvq7vbCUzra yk4tSdEdg4DG50IO+aL5/Gpnn+35E6VD02UwP0sAJwq0QZFmt9KT6jzIvsih672hANpT 092Mjw5LI3DxykjDSDwgAdVseY58y09p41+ljjKSZ6e7k3NDoz5drwofKgljwI2FCAsv wKARfvtM7YtrlgL3b7cpm5hVBJU7kxH3VO+UVW8ARssCcHxkcizUnWhhvl6mltuElWXP 4qq0p7E/fZqgofw7VRcBkrz1YZ/LcwpXbWa78CbSGevHsyUhMRGFpPdw0Oo9XxaCQ3Ap jjOw== X-Gm-Message-State: AOAM5306anmlElVXUkRTJxjY1D1qt41EpM5SVudWo1D4rWIuYiJUWO9t AjuJN8Cwq94P14dK/ao6DWuL/rjQEIlXSRRy X-Received: by 2002:a17:907:60cc:b0:6e0:dab3:ca76 with SMTP id hv12-20020a17090760cc00b006e0dab3ca76mr4807869ejc.154.1649182316540; Tue, 05 Apr 2022 11:11:56 -0700 (PDT) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com. [209.85.221.43]) by smtp.gmail.com with ESMTPSA id e26-20020a50ec9a000000b004193fe50151sm7115120edr.9.2022.04.05.11.11.53 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Apr 2022 11:11:54 -0700 (PDT) Received: by mail-wr1-f43.google.com with SMTP id u3so20629772wrg.3 for ; Tue, 05 Apr 2022 11:11:53 -0700 (PDT) X-Received: by 2002:adf:9123:0:b0:205:f439:cbdf with SMTP id j32-20020adf9123000000b00205f439cbdfmr3560336wrj.513.1649182313067; Tue, 05 Apr 2022 11:11:53 -0700 (PDT) MIME-Version: 1.0 References: <1648656179-10347-1-git-send-email-quic_sbillaka@quicinc.com> <1648656179-10347-2-git-send-email-quic_sbillaka@quicinc.com> <392b933f-760c-3c81-1040-c514045df3da@linaro.org> <3e5fa57f-d636-879a-b98f-77323d07c156@linaro.org> In-Reply-To: <3e5fa57f-d636-879a-b98f-77323d07c156@linaro.org> From: Doug Anderson Date: Tue, 5 Apr 2022 11:11:40 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 1/8] drm/msm/dp: Add eDP support via aux_bus To: Dmitry Baryshkov Cc: Sankeerth Billakanti , dri-devel , linux-arm-msm , freedreno , LKML , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Rob Clark , Sean Paul , Stephen Boyd , quic_kalyant , "Abhinav Kumar (QUIC)" , "Kuogee Hsieh (QUIC)" , Bjorn Andersson , Sean Paul , David Airlie , Daniel Vetter , quic_vproddut , "Aravind Venkateswaran (QUIC)" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 Hi, On Tue, Apr 5, 2022 at 10:36 AM Dmitry Baryshkov wrote: > > On 05/04/2022 20:02, Doug Anderson wrote: > > Hi, > > > > On Tue, Apr 5, 2022 at 5:54 AM Dmitry Baryshkov > > wrote: > >>> 3. For DP and eDP HPD means something a little different. Essentially > >>> there are two concepts: a) is a display physically connected and b) is > >>> the display powered up and ready. For DP, the two are really tied > >>> together. From the kernel's point of view you never "power down" a DP > >>> display and you can't detect that it's physically connected until it's > >>> ready. Said another way, on you tie "is a display there" to the HPD > >>> line and the moment a display is there it's ready for you to do AUX > >>> transfers. For eDP, in the lowest power state of a display it _won't_ > >>> assert its "HPD" signal. However, it's still physically present. For > >>> eDP you simply have to _assume_ it's present without any actual proof > >>> since you can't get proof until you power it up. Thus for eDP, you > >>> report that the display is there as soon as we're asked. We can't > >>> _talk_ to the display yet, though. So in get_modes() we need to be > >>> able to power the display on enough to talk over the AUX channel to > >>> it. As part of this, we wait for the signal named "HPD" which really > >>> means "panel finished powering on" in this context. > >>> > >>> NOTE: for aux transfer, we don't have the _display_ pipe and clocks > >>> running. We only have enough stuff running to do the AUX transfer. > >>> We're not clocking out pixels. We haven't fully powered on the > >>> display. The AUX transfer is designed to be something that can be done > >>> early _before_ you turn on the display. > >>> > >>> > >>> OK, so basically that was a longwinded way of saying: yes, we could > >>> avoid the AUX transfer in probe, but we can't wait all the way to > >>> enable. We have to be able to transfer in get_modes(). If you think > >>> that's helpful I think it'd be a pretty easy patch to write even if it > >>> would look a tad bit awkward IMO. Let me know if you want me to post > >>> it up. > >> > >> I think it would be a good idea. At least it will allow us to judge, > >> which is the more correct way. > > > > I'm still happy to prototype this, but the more I think about it the > > more it feels like a workaround for the Qualcomm driver. The eDP panel > > driver is actually given a pointer to the AUX bus at probe time. It's > > really weird to say that we can't do a transfer on it yet... As you > > said, this is a little sideband bus. It should be able to be used > > without all the full blown infra of the rest of the driver. > > Yes, I have that feeling too. However I also have a feeling that just > powering up the PHY before the bus probe is ... a hack. There are no > obvious stopgaps for the driver not to power it down later. This is why I think we need to move to Runtime PM to manage this. Basically: 1. When an AUX transfer happens, you grab a PM runtime reference that _that_ powers up the PHY. 2. At the end of the AUX transfer function, you do a "put_autosuspend". Then it becomes not a hack, right? > A cleaner design might be to split all hotplug event handling from the > dp_display, provide a lightweight state machine for the eDP and select > which state machine to use depending on the hardware connector type. The > dp_display_bind/unbind would probably also be duplicated and receive > correct code flows for calling dp_parser_get_next_bridge, etc. > Basically that means that depending on the device data we'd use either > dp_display_comp_ops or (new) edp_comp_ops. > > WDYT? I don't think I know the structure of the MSM DP code to make a definitive answer here. I think I'd have to see a patch. However I'd agree in general terms that we need some different flows for the two. ;-) We definitely want to limit the differences but some of them will be unavoidable... -Doug