Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2221189pxb; Fri, 25 Mar 2022 13:19:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxu918JcaPwapit3jtfOnhvknpUZUKLtStZ9p3QB7gzpqbtLsyg5co/z0K3elJLmMQ0QKeQ X-Received: by 2002:a17:903:41d0:b0:154:de5:a240 with SMTP id u16-20020a17090341d000b001540de5a240mr13662119ple.32.1648239541302; Fri, 25 Mar 2022 13:19:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648239541; cv=none; d=google.com; s=arc-20160816; b=CFl5SP0+hr9alWkJGSR8uRSk04UR3wdY1yDdFW9gM3nK8nDFaSpeXkF5kzYdSwHjVM rrQZLfHD6hct+jdljtNqlvOu6bG3gDIGT6pt+K0e2NWvKZ4x1fvzqqpanIqUiN/Dq5Rq 9mZ9+xI4RibdMdapTo9abOqhZEJEoWP0ukRD4nIEapqMsjsPpWBRw4fK0jMg0caYNdTl GJWbimbgfHOBiPEga3ig7dVX18MLHKS+wg71hB9M5bIVKQi4OkRbkXEtm/wRqHVaHfSK hkQVmogjvcngTwv+dkdd4+i6Ux2fmWrCxSW2drwi/hCgkxMxPEZnUm7LL68MtPUK+0hS TGZA== 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=yMwLgpBMsPacoyetf0Jh9z411mlnHCKLxH5G5J9Bol4=; b=Php3L21sLv+5t0/FPL6HGF3G9ZvIpSCQ3Avrqx63YiR+Cy8+7MIj064WDQv0S3Jlr4 DoySRfc4cod/SLaGYqvzTnN12E0QkNybVnNFongRgFWM5RJ9vXgL8bPPGDlcQWU5gMrW Liy6Mqw26+OwDfGsd5R3+sswLiRiDktKRdqYno5caek9+Sjv5wHIWmY5pcp5BS0y6vTD NJGaO0diaPogYuQByicydi988J/G97Z7iUC+o7jycVh0YFg7UaJdqvH7TcKSok4/DH3+ HSlRRpu1mhaDeo6w5mV2pC4CRWjDEWY1rRPqKPwLlaQxKKw08DEfEDTLaJ9Q0P5W0f4w aKVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Y/hl4bV1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l9-20020a655609000000b003816043ef67si3545347pgs.348.2022.03.25.13.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 13:19:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Y/hl4bV1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 CDF9D3B41AE; Fri, 25 Mar 2022 12:16:29 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358340AbiCYQNT (ORCPT + 99 others); Fri, 25 Mar 2022 12:13:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237175AbiCYQNS (ORCPT ); Fri, 25 Mar 2022 12:13:18 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E96981658 for ; Fri, 25 Mar 2022 09:11:44 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id m3so14153022lfj.11 for ; Fri, 25 Mar 2022 09:11:44 -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=yMwLgpBMsPacoyetf0Jh9z411mlnHCKLxH5G5J9Bol4=; b=Y/hl4bV1BEodjTa26V56UFW7xKKqtQqV6DPIWr1GJnYIF/hoTalbgulB3gdkxC3WMu XQSVwQKZUG2sZ3ETMy3ROt+OUqrF9D6QN04UTPaN6gbN3wyxUFGruTKWHtEDwcTGXgCT NQ7DKJpWM/09QfTXA3AQLleirinBmBKZv4PFM= 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=yMwLgpBMsPacoyetf0Jh9z411mlnHCKLxH5G5J9Bol4=; b=acno8h+Uz7BV4jnFpY2n7SDjv3qLW0Fb6BtzKWuIC4fYHnKsa7MLeHVAHtYjVVUtLl L/lqLGgRTnB8/Da4Bd7i8nsR3vCUwCjonFNmyMs5OrTH1b7Fyx2r8v2pfV8dJvenB3hT bSmepOhH037yC0rQhpit1tYDv6ABdoFUaNOLBkYUufomVC5KomH9aXAunlOY7vQ7zqrx Vi867Nt7KgCtL6X2OwjiTEofo7JVqEs3jQSQTaMvQi22zkXGPvYDA29AXd+kDnjf5/WS YpBTtzIkOWavQ/yM5pjhuOadP8rWdH3KImwC/lC++vwSZDpfn6eC1uHzsXbGagid9992 1PMA== X-Gm-Message-State: AOAM533CNq3UuIosEE1hs6/hNWv+6YW9ge/HuHZMEU+wCX3AhrDIfBpb Ai5WovNdaDmT2SVn8HSJF2czHC2WpON+MHQQ6a0= X-Received: by 2002:a19:4306:0:b0:44a:599b:468 with SMTP id q6-20020a194306000000b0044a599b0468mr8418196lfa.481.1648224702154; Fri, 25 Mar 2022 09:11:42 -0700 (PDT) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id 25-20020a2e0e19000000b002495d863173sm703950ljo.61.2022.03.25.09.11.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Mar 2022 09:11:41 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id p15so14168990lfk.8 for ; Fri, 25 Mar 2022 09:11:41 -0700 (PDT) X-Received: by 2002:adf:fc47:0:b0:203:dda1:4311 with SMTP id e7-20020adffc47000000b00203dda14311mr9797547wrs.301.1648224364037; Fri, 25 Mar 2022 09:06:04 -0700 (PDT) MIME-Version: 1.0 References: <1647452154-16361-1-git-send-email-quic_sbillaka@quicinc.com> <1647452154-16361-7-git-send-email-quic_sbillaka@quicinc.com> In-Reply-To: From: Doug Anderson Date: Fri, 25 Mar 2022 09:05:51 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v5 6/9] drm/msm/dp: wait for hpd high before any sink interaction To: "Sankeerth Billakanti (QUIC)" Cc: Stephen Boyd , David Airlie , dri-devel , "bjorn.andersson@linaro.org" , Thierry Reding , Sam Ravnborg , "Kuogee Hsieh (QUIC)" , Andy Gross , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , quic_vproddut , linux-arm-msm , "Abhinav Kumar (QUIC)" , Rob Herring , Sean Paul , Sean Paul , quic_kalyant , LKML , "dmitry.baryshkov@linaro.org" , "krzk+dt@kernel.org" , freedreno Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3.1 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=unavailable 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 Fri, Mar 25, 2022 at 8:54 AM Sankeerth Billakanti (QUIC) wrote: > > > -----Original Message----- > > From: Doug Anderson > > Sent: Saturday, March 19, 2022 5:26 AM > > To: Stephen Boyd > > Cc: Sankeerth Billakanti (QUIC) ; open list:OPEN > > FIRMWARE AND FLATTENED DEVICE TREE BINDINGS > > ; dri-devel ; > > freedreno ; linux-arm-msm > msm@vger.kernel.org>; LKML ; Rob Clark > > ; Sean Paul ; > > quic_kalyant ; Abhinav Kumar (QUIC) > > ; Kuogee Hsieh (QUIC) > > ; Andy Gross ; > > bjorn.andersson@linaro.org; Rob Herring ; > > krzk+dt@kernel.org; Sean Paul ; David Airlie > > ; Daniel Vetter ; Thierry Reding > > ; Sam Ravnborg ; > > dmitry.baryshkov@linaro.org; quic_vproddut > > Subject: Re: [PATCH v5 6/9] drm/msm/dp: wait for hpd high before any sink > > interaction > > > > Hi, > > > > On Fri, Mar 18, 2022 at 4:27 PM Stephen Boyd > > wrote: > > > > > > > > Pushing hpd state checking into aux transactions looks like the > > > > > wrong direction. Also, as I said up above I am concerned that even > > > > > checking the GPIO won't work and we need some way to ask the > > > > > bridge if HPD is asserted or not and then fallback to the GPIO > > > > > method if the display phy/controller doesn't have support to check > > > > > HPD internally. Something on top of DRM_BRIDGE_OP_HPD? > > > > > > > > If we could somehow get the HPD status from the bridge in the panel > > > > driver it definitely would be convenient. It does feel like that's > > > > an improvement that could be done later, though. We've already > > > > landed a few instances of doing what's done here, like for > > > > parade-ps8640 and analogix_dp. I suspect designing a new mechanism > > > > might not be the most trivial. > > > > > > What is done in the bridge drivers is to wait for a fixed timeout and > > > assume aux is ready? Or is it something else? If there's just a fixed > > > timeout for the eDP case it sounds OK to do that for now and we can > > > fine tune it later to actually check HPD status register before the > > > panel tries to read EDID. > > > > Right. For the parade chip (which is only used for eDP as far as I know--never > > DP) waits for up to 200 ms. See ps8640_ensure_hpd(). > > > > So I guess tl;dr to Sankeerth that it's OK for his patch to have the wait in the > > aux transfer function, but only for eDP. Other discussions here are about > > how we could make it better in future patches. > > > > > > The aux transactions for external DP are initiated by the dp_display driver only after the > display is hot plugged to the connector. The phy_init is necessary for the aux transactions > to take place. So, for the DP case, like Doug mentioned below, this patch is introducing > an overhead of three register reads to detect hpd_high before performing aux transactions. > So, we felt this was okay to do for DP. Personally I'm not that upset about the 3 register reads. The problem Stephen pointed out is bigger. It's possible that a DP cable is unplugged _just_ as we started an AUX transaction. In that case we'll have a big delay here when we don't actually need one. > On the other hand, for eDP, it is necessary to wait for panel ready through this hpd connect status. > Currently there is no way to know which type of connector it is in the dp_aux sub-module. > > However, as the discussion suggested, to have the wait only for eDP, I am thinking to pass the > connector_type information to aux sub-module and register different aux_transfer functions > for eDP and DP. The eDP transfer function will wait for hpd_high and the DP transfer function > will be same as the one before this patch. Personally I wouldn't register two separate functions. You could just store a boolean in your structure and only wait for HPD if this is eDP. One extra "if" test doesn't seem like it justifies splitting off into two functions... -Doug