Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3495270pxb; Mon, 4 Apr 2022 18:49:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4tfj6rSi8VljfYQ6BilKGCLp8MwD3IP/MrP+73MFxablHu8rO/uBJSmE6CKk6AU6HBQDJ X-Received: by 2002:a17:902:bcc2:b0:14f:23c6:c8c5 with SMTP id o2-20020a170902bcc200b0014f23c6c8c5mr968999pls.131.1649123361894; Mon, 04 Apr 2022 18:49:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649123361; cv=none; d=google.com; s=arc-20160816; b=n4+B7Gw34tgpE4j6mCxdk8D2FsbQD2+Fk/FoTXT2lIxrxLEcbh7phqscQ/GpWPnv3O ozFtwmftCGwZHsAud+ig15SkSxbsjfaCz414iS/hUyCZVO9o+e9xCl4lwrq0RYn3Olr8 5vBz5ENmkofNuoU6PnjunuPiIctUdONgGphDYamGvPDXsPNXYn5qpdBY8pLdd9gEQ3aR gvt7PDkBT0zjZi3RyWMuAh0Qv9x38m4tQAZA84E3nvtsl1fnFXJjJdOt7yHq7/ltSCoA T87hGPGvT0nVZTjgDnszHEk6aIr9ZZhW6nc/FatonbNTgPYm6+aTd0Mv5xoiF3YioHCR i30g== 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=McouKnSmKFWKF2SpoB2peGm/9//rXoQgWM99Hh1/NkM=; b=hLaJK/oX273nn/inEKiMmZ5Y+AYUEpvLAvc5hltAequ5i28OA3ekTFY9rwNRQJ1Jv3 3l688nbP+p/e1cq+PiRz2G33oFQombO3yNTtgUeFEYuWPJHmoEY0J4JLJf4uPDfAFvLI E8/4PPUxH/+YLmmuGpF/WqqNsqBM03sFX3LfVOzjXefoQZlq7FZRqMvbmBnXmPKHtnow cnyoTHARIshBI9ni2aq2+5yaoqMDuYcB+Rs+vx0UmQCzdk0G4VIl+XQQUVaHpbQVCBQR mg1ZG7YJA37z1Rl2ellKza+zZXLc4QR5GlQb7VmVcty+mtbsp9AtmnM394PByxnc8v0j TFSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=M++cEUJl; 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=linaro.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id o24-20020a635a18000000b00399563035e3si1349308pgb.809.2022.04.04.18.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 18:49:21 -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=@linaro.org header.s=google header.b=M++cEUJl; 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=linaro.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BC45F2B0EC6; Mon, 4 Apr 2022 17:50:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348992AbiDDWLY (ORCPT + 99 others); Mon, 4 Apr 2022 18:11:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382653AbiDDVbn (ORCPT ); Mon, 4 Apr 2022 17:31:43 -0400 Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBCE515A07 for ; Mon, 4 Apr 2022 14:15:28 -0700 (PDT) Received: by mail-qv1-xf32.google.com with SMTP id f3so8510207qvz.10 for ; Mon, 04 Apr 2022 14:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=McouKnSmKFWKF2SpoB2peGm/9//rXoQgWM99Hh1/NkM=; b=M++cEUJlbCPGoHHxmMxvBelMxqgIBsOO1jFQ1hxhkxPZWCi9yjs3IOyz3DUBfIHTby hMf7DehfSJgg5MS33J2RzV6Za5Fx8CpIeYOhknWnvbkUyNPUbjCU1EClkx377aee23Ed /y2xV0M0VEAKcVJVW4ThuGCUzAzjmK5dWYPIeEid3dAv9np5b1dmU0a7JCY1I2torFM1 M6nthhJ5f/2xyZRhP6slKdYv7VnlT0ixAW+jcKuz4py1y6qx+s1NzcMzRyRThP0QKRKk szde6JHOfXwsnWGShpS3m4bdH2QYtwUy0mKBrdcCSwrjhSMVy+rkK12oEdm0q6uHT0XH Y84A== 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=McouKnSmKFWKF2SpoB2peGm/9//rXoQgWM99Hh1/NkM=; b=zFkCgABqeB2/d6hcF9xUPkkDqGiNvjiCARUc71wCCdfDZC5puuNvGkVuT5kIzC2z5p ba3KgwihwB7/wUvNF/8oAKFoP5pN2+N9IuWi5nUtWBgriHcEAm79OmKKQuPn1haN3UHA vFvjVg/x4tE+uQpkecPT5xvo12RKwvXL4sE3N6mluNg6LCa3ViXhU/MxnBxpUKnl5cxB x68uBqXB77/El+tPE/ayo/aV/tXKCS/symejQJsAltQ81U3wQs4E5W28xs8SDQXgBk+T maR9uDbnBAwN59hVeg98CNMxhERUqAvKR5ObOnjhdsdA/dnFzC4fL3EciETtudmRsUdQ drFw== X-Gm-Message-State: AOAM530t/+4RWg353sYWCbsbHwPs8GIDkdbrGuL0LfDG9VthU8/3KG8u of6/NfFpEd4+/+F5iyTwn9iDUZzl6Ggy+pcJRg32vQ== X-Received: by 2002:ad4:53a4:0:b0:430:1d8c:18ea with SMTP id j4-20020ad453a4000000b004301d8c18eamr99107qvv.115.1649106927946; Mon, 04 Apr 2022 14:15:27 -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: From: Dmitry Baryshkov Date: Tue, 5 Apr 2022 00:15:16 +0300 Message-ID: Subject: Re: [PATCH v6 7/8] drm/msm/dp: Support edp/dp without hpd To: "Sankeerth Billakanti (QUIC)" Cc: Doug Anderson , 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@linaro.org" , 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,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 On Mon, 4 Apr 2022 at 21:32, Sankeerth Billakanti (QUIC) wrote: > > Hi Doug, > > > 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. > > > > Okay. I will add it > > > > > > 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? > > > It is called twice for DP. Once while booting through a thread scheduled from kms_obj_init > and when resuming from PM suspend. > > With aux_bus addition, this function will be called thrice for eDP. Once during bootup with > aux_bus, then from scheduled event from kms_obj_init and pm resume like DP. > > I will check if we can use a no-hpd Boolean flag instead. As the driver has a separate dp_parser code, it might be a good fit to parse the DT once and then to use boolean flag afterwards. -- With best wishes Dmitry