Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3469689pxb; Mon, 4 Apr 2022 17:59:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGEkcorzQNfhRgbDYeFeiwASDrtJ6hJ7i1yt8GJGBjcEDW52QF34fYiFSSL61w4jb+o4aY X-Received: by 2002:a17:902:a588:b0:156:599c:6278 with SMTP id az8-20020a170902a58800b00156599c6278mr812821plb.109.1649120397623; Mon, 04 Apr 2022 17:59:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649120397; cv=none; d=google.com; s=arc-20160816; b=UEfkusTAa1kWsORDynQdC8Ze3Mhrb/cInj8IgBjlC2M9Vv6MYWYQCEMCwDgFxYGmN3 HlHXhjE0eJc0LF+t47XYnQwD3Vs+qEUAuHxJuOHSgUxAPHRge4ILIfR9O/uTYiiFBZg8 eSBPmHmEy66nuLuXqFJzdCnm/QncCUOVP12JIDEi2AtmDdIH78UC65AgPBCCoDODKPPy tap2qeWCNaUQAzrUD/cH8dPrnTky79SUA8xH3UzpR9T3F6501BK5sEQ2u2N2/4TAbVxZ bKIhVZk6fQck2EYomqHO6qnZItZd7lCQ67306LTAz6RaNpvZozadNE2NoexYRc2hEMvq qdeQ== 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=oU/P0lUIzx1uZfbuXoLmvC/k7etlrfD8HbND/4uBtMs=; b=dWgqmqw0QgJMCc98TwQd785WFcVvHe0r/MtKaOflmipJFAu4y+Kj6yECEjXof+QXFb 4CTvbTPnfZgcGnug6h8eZNuaCCQgjeQBO+nszXZl3/h5mAz5PobbBUmw4DNn7Fp5UrzF TI/bFzYNf/txxmguOJbSYXCvyngnudvGXB11n7pwKK9wF2mKszg7UNEgaxiTIu0MFcHS Mb2vE2BaAl0gS7ByIqNY6TKwIxyAKSfAvV8BmVzE3v2E/szFCnrPxWYCoTI8gFYmSFyg G6rxIZ6S5UVhmHjzyHwZD1TXYKEqpAjBj0q0qA19POlrNevLP6Zd9b8XPmeKdB/0EKwQ u0Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=CVm3r8sE; 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 r1-20020a17090a940100b001c60d6b8faesi673610pjo.78.2022.04.04.17.59.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 17:59:57 -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=CVm3r8sE; 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 75AFB14CD0D; Mon, 4 Apr 2022 17:06:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242948AbiCaXdc (ORCPT + 99 others); Thu, 31 Mar 2022 19:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238019AbiCaXd3 (ORCPT ); Thu, 31 Mar 2022 19:33:29 -0400 Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9CE9624EDA4 for ; Thu, 31 Mar 2022 16:31:41 -0700 (PDT) Received: by mail-lj1-x236.google.com with SMTP id s13so1770674ljd.5 for ; Thu, 31 Mar 2022 16:31:41 -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=oU/P0lUIzx1uZfbuXoLmvC/k7etlrfD8HbND/4uBtMs=; b=CVm3r8sEiJHudIn3wBe5psgjEjOXEvg7kAXV5xw19t+3DbObpkYUHppzcz6qWIyEKC iD+uGmLJdXzgNCcEVX3/o2rL3pH35aBBGYvKh1WC1iiWOWhQglndY1DyhfDoBvDHciUT HKdhiizGnGLfo9pL1ZqNneKf5bIxKreY/JwCs= 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=oU/P0lUIzx1uZfbuXoLmvC/k7etlrfD8HbND/4uBtMs=; b=cY9fPdlH5Axoq7pt/cjBXPdulyMUr4TUth02xpWwGxFCm2wXVzfB3VqbdrMDne0PI4 aYS8urXf/guuxkV/oD3Kq5uQ1QFZxPcwuMz05mVlj4JdLCmYfhtizaoLzHKK/MuBUGWw SHb5yXzq+c/i7r6Yfba6dJMD86hTeVFuFjNHq6q4rMuA99KJohb7vDtEpIkav3f5XfAh 2x+6wS2JIvAKg8N1ezHtiWR35OkIAsyOC/2dISWTpbx9OfoSKeFkk2jxuQ8huUjqZfkl W896EhFU+GVvUG7KQquu8YCVQ8Demkze1u4VH6INSmhf+a1QjSnXgpzkcOagNQIEUjNS ETPg== X-Gm-Message-State: AOAM530QIxSlMuyutpuRXIfxkhhO1t0fnP7ntInODIMCCo+mfhn6Aepc qXDXxrAR5fQOnYiTP2P7H0AQBaJIdUZR8RBOdyg= X-Received: by 2002:a2e:8610:0:b0:249:7bc4:bbb8 with SMTP id a16-20020a2e8610000000b002497bc4bbb8mr12028763lji.370.1648769499469; Thu, 31 Mar 2022 16:31:39 -0700 (PDT) Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com. [209.85.167.50]) by smtp.gmail.com with ESMTPSA id z13-20020a195e4d000000b0044a49605b88sm70888lfi.50.2022.03.31.16.31.38 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 31 Mar 2022 16:31:39 -0700 (PDT) Received: by mail-lf1-f50.google.com with SMTP id 5so1910476lfp.1 for ; Thu, 31 Mar 2022 16:31:38 -0700 (PDT) X-Received: by 2002:a5d:4491:0:b0:203:f63a:e89b with SMTP id j17-20020a5d4491000000b00203f63ae89bmr5618171wrq.342.1648769032444; Thu, 31 Mar 2022 16:23:52 -0700 (PDT) MIME-Version: 1.0 References: <1648656179-10347-1-git-send-email-quic_sbillaka@quicinc.com> <1648656179-10347-8-git-send-email-quic_sbillaka@quicinc.com> In-Reply-To: <1648656179-10347-8-git-send-email-quic_sbillaka@quicinc.com> From: Doug Anderson Date: Thu, 31 Mar 2022 16:23:40 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v6 7/8] drm/msm/dp: Support edp/dp without hpd To: Sankeerth Billakanti Cc: 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 , Dmitry Baryshkov , quic_vproddut , quic_aravindh@quicinc.com 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 Wed, Mar 30, 2022 at 9:04 AM Sankeerth Billakanti wrote: > > Some eDP sinks or platform boards will not support hpd. > This patch adds support for those cases. You could say more, like: If we're not using HPD then _both_ the panel node and the eDP controller node will have "no-hpd". This tells the eDP panel code to hardcode the maximum possible delay for a panel to power up and tells the eDP driver that it should continue to do transfers even if HPD isn't asserted. > Signed-off-by: Sankeerth Billakanti > --- > drivers/gpu/drm/msm/dp/dp_catalog.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/msm/dp/dp_catalog.c b/drivers/gpu/drm/msm/dp/dp_catalog.c > index 1809ce2..8f1fc71 100644 > --- a/drivers/gpu/drm/msm/dp/dp_catalog.c > +++ b/drivers/gpu/drm/msm/dp/dp_catalog.c > @@ -244,10 +244,17 @@ void dp_catalog_aux_update_cfg(struct dp_catalog *dp_catalog) > > int dp_catalog_aux_wait_for_hpd_connect_state(struct dp_catalog *dp_catalog) > { > - u32 state; > + u32 state, hpd_en; > struct dp_catalog_private *catalog = container_of(dp_catalog, > struct dp_catalog_private, dp_catalog); > > + hpd_en = dp_read_aux(catalog, REG_DP_DP_HPD_CTRL); > + hpd_en &= DP_DP_HPD_CTRL_HPD_EN; > + > + /* no-hpd case */ > + if (!hpd_en) > + return 0; > + > /* poll for hpd connected status every 2ms and timeout after 500ms */ > return readl_poll_timeout(catalog->io->dp_controller.aux.base + > REG_DP_DP_HPD_INT_STATUS, > @@ -586,8 +593,10 @@ void dp_catalog_ctrl_hpd_config(struct dp_catalog *dp_catalog) > reftimer |= DP_DP_HPD_REFTIMER_ENABLE; > dp_write_aux(catalog, REG_DP_DP_HPD_REFTIMER, reftimer); > > - /* Enable HPD */ > - dp_write_aux(catalog, REG_DP_DP_HPD_CTRL, DP_DP_HPD_CTRL_HPD_EN); > + /* Enable HPD if supported*/ > + if (!of_property_read_bool(catalog->dev->of_node, "no-hpd")) I don't think this is a particularly lightweight operation. It's literally iterating through all of our device tree properties and doing string compares on them. ...but this function is called somewhat often, isn't it? It feels like the kind of thing that should happen at probe time and be stored in a boolean. ...and then you can use that same boolean in dp_catalog_aux_wait_for_hpd_connect_state() rather than reading the register value, right? -Doug