From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B08DC433FE for ; Fri, 8 Apr 2022 13:43:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbiDHNpw (ORCPT ); Fri, 8 Apr 2022 09:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233768AbiDHNpv (ORCPT ); Fri, 8 Apr 2022 09:45:51 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7710743EF3 for ; Fri, 8 Apr 2022 06:43:47 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id w18so10081376edi.13 for ; Fri, 08 Apr 2022 06:43:47 -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=1ZpanQL7fJ5Imrl94t4mOv+0fifiSCixQTFhocGBbW4=; b=ocU4WzdvqVtDrF+QNMkeIFKSbQDrw614kxrKDCXUNEPj0TcZTn2VF33O7pzWeuQcUi /kpIefrRb+tIPM7KdnbR0CjVrj0C7uFD+iwBJMThlUaqxYgu/HgyrOL3xZXxjwikkwPM /w5y4+LqxJFClA/AFhhdE9da2MRmrUgMM0sYM= 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=1ZpanQL7fJ5Imrl94t4mOv+0fifiSCixQTFhocGBbW4=; b=fOZCatg8391mLoQou33UZHULYNf87HP3tVzhpq6miCEMLqs4Z6/mxGrQpOujWt56Ui X7ykkEwvJ12Wufm2uZViCpEThvbAuXXrd6tfChsxsLMF0GFDSMChinugbOl2UQr9egdw TVZkHOj5/6uyCY/Mrkx5O2sDSI0ahIcU/7/0cR7owfSWsHzEsj5GM88JtjWIVz3n7VZ5 6rbUGWUiIfP71KI6LAhMJWm+Uy6J+JsM32H9ePetiCfGWKbTfb7OKjPl98A0TocL6Xi9 XJuS0QzPk3M9gRp0rFsWPXcBwKC2hOQ0JkDBpMR2Q23l8b4HDG7nq4W6ZlIPn9s52IMW cqVg== X-Gm-Message-State: AOAM530GXywGYsx16roiDXATvT8nz6wpuQddWogaSUupwJoNbtILD1DS a+g/91h+rjNqDvemQfXC97kMhHxAQcHU7XhFeYA= X-Google-Smtp-Source: ABdhPJw2h5c4zdUcGZ78mpbeC0SBjTxZpnoDxhDxUh5JVaET5E2PcNH3LuY85ojHtFIPvRhzxbLyIw== X-Received: by 2002:a05:6402:d4c:b0:410:a415:fd95 with SMTP id ec12-20020a0564020d4c00b00410a415fd95mr19607234edb.288.1649425425680; Fri, 08 Apr 2022 06:43:45 -0700 (PDT) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com. [209.85.221.53]) by smtp.gmail.com with ESMTPSA id d7-20020a50cd47000000b004187eacb4d6sm10574463edj.37.2022.04.08.06.43.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 06:43:44 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id d3so12910138wrb.7 for ; Fri, 08 Apr 2022 06:43:42 -0700 (PDT) X-Received: by 2002:adf:e591:0:b0:206:1202:214 with SMTP id l17-20020adfe591000000b0020612020214mr14896572wrm.342.1649425421934; Fri, 08 Apr 2022 06:43:41 -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> <225d2c0a-42ec-28ad-688c-e7e9e2035ee1@quicinc.com> In-Reply-To: From: Doug Anderson Date: Fri, 8 Apr 2022 06:43:28 -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: Abhinav Kumar , "Sankeerth Billakanti (QUIC)" , quic_kalyant , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , quic_vproddut , David Airlie , linux-arm-msm , "Kuogee Hsieh (QUIC)" , freedreno , dri-devel , "bjorn.andersson@linaro.org" , Sean Paul , "Aravind Venkateswaran (QUIC)" , Stephen Boyd , Sean Paul , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Hi, On Fri, Apr 8, 2022 at 5:20 AM Dmitry Baryshkov wrote: > > > I guess my thought was that in DP you could still create the AUX bus > > at probe time. Then for DP you just return an instant "transfer > > failed" from the AUX bus if HPD isn't asserted. For eDP (as discussed > > elsewhere) when we try to do an AUX transfer then we delay until HPD > > is there. > > I think panel-edp would already handle the delay, so we do not need to > have this logic in the DP driver. There's a whole discussion about this between Stephen and me in patch #5 ("drm/msm/dp: wait for hpd high before any sink interaction"). Basically: * If panel HPD is hooked up to the dedicated HPD pin on the eDP controller then the panel driver doesn't have a way to read it. * We can't leverage the existing "HPD" query functions in DRM because those indicate whether a panel is _physically_ connected. For eDP, it always is. For now the rule is that the AUX transfer function is in charge of waiting for HPD for eDP if the dedicated HPD pin is used. If we want to re-invent this we could, but that system works, isn't _too_ ugly, and we're already making big enough changes in this series. > > So we can still acquire resources (clocks, PHY, io maps, etc) at probe > > time for DP and create the AUX bus, right? It will just return > > "-ENODEV" if HPD isn't asserted and you're DP? > > Yes, please. I still suppose that we'd need a separate case to > power_on eDP's PHY during the probe time. Maybe I'm mistaken here. I think the ideal way is to do it like Kieran's proposal for sn65dsi86: https://lore.kernel.org/r/20220317131250.1481275-4-kieran.bingham+renesas@ideasonboard.com/ * When enabling HPD (physical hot plug detect) in the hpd_enable() callback you do a pm_runtime_get(). You do the pm_runtime_put_autosuspend() when disabling. This is only used for DP since we only provide DRM_BRIDGE_OP_HPD for DP, not for eDP. * We do a pm_runtime_get() / pm_runtime_put_autosuspend() in the AUX transfer routine. While holding the pm_runtime reference we check HPD. For DP we return immediately if HPD isn't asserted. For eDP, we delay. * We do the pm_runtime_get() in pre_enable and the pm_runtime_put() in post_disable. For DP this will add a 2nd refcount (since we probably were holding the reference for HPD). For eDP this will cause us to power on. * If there's any other time we need to read HW registers, and we aren't guaranteed to already have a pm_runtime reference (like during probe), we can do a temporary pm_runtime_get() / pm_runtime_put_autosuspend(). From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C423EC433F5 for ; Fri, 8 Apr 2022 13:43:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E46B010F1CC; Fri, 8 Apr 2022 13:43:47 +0000 (UTC) Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by gabe.freedesktop.org (Postfix) with ESMTPS id 20BAC10E1BA for ; Fri, 8 Apr 2022 13:43:47 +0000 (UTC) Received: by mail-ed1-x530.google.com with SMTP id v15so70257edb.12 for ; Fri, 08 Apr 2022 06:43:47 -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=1ZpanQL7fJ5Imrl94t4mOv+0fifiSCixQTFhocGBbW4=; b=ocU4WzdvqVtDrF+QNMkeIFKSbQDrw614kxrKDCXUNEPj0TcZTn2VF33O7pzWeuQcUi /kpIefrRb+tIPM7KdnbR0CjVrj0C7uFD+iwBJMThlUaqxYgu/HgyrOL3xZXxjwikkwPM /w5y4+LqxJFClA/AFhhdE9da2MRmrUgMM0sYM= 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=1ZpanQL7fJ5Imrl94t4mOv+0fifiSCixQTFhocGBbW4=; b=v/KmCiHSlNjYbL9D3hE10OIXmfwGkQAs4Z/mvchUd7CBb7ft802h4hbpDcLsnALB41 vnWTNTQVc5yX67AW19y/G/j4cFQcb5bptO1nNjad2epjmiWIKJOJEBlHwBwIca5L1DYt m33lp9XERa3/B71TU6kZp73XmUSnKYQ6tkLZOzak5+krNdNhFO3Yi/3qgFDvl0m2mYZV c88Z84s8OAqAukggz4kD9XIsDKlM1kR9olzYxZr7kku24SDMfU9Yv+D3n+9EFJ2bsgAP C7xqYXVe+GnQY+S8WQkGp0csUwN2Twvgt7VX12IAa4LaKQOdVTrOHvXDOb3du0OjQHUm ldzA== X-Gm-Message-State: AOAM532VyflaFh1Nn3+u8IuSuePjA9LMsQuVA3OHZF8SebCvgoCcvPC3 YKc7sGY9MDgq7Iq5mCGT1BEa6yhv+pKPPC60UfA= X-Google-Smtp-Source: ABdhPJz5YXpByaSRtnDB24iec7QfFVQRzcoSY4SfjZiJvguq+zxYd9A2wKE8jwjaRMezaKtzrE9uTQ== X-Received: by 2002:a05:6402:909:b0:416:6f3c:5c1d with SMTP id g9-20020a056402090900b004166f3c5c1dmr19376922edz.108.1649425425287; Fri, 08 Apr 2022 06:43:45 -0700 (PDT) Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com. [209.85.221.49]) by smtp.gmail.com with ESMTPSA id a8-20020a170906244800b006e859d92386sm410075ejb.104.2022.04.08.06.43.42 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 08 Apr 2022 06:43:43 -0700 (PDT) Received: by mail-wr1-f49.google.com with SMTP id u3so12942493wrg.3 for ; Fri, 08 Apr 2022 06:43:42 -0700 (PDT) X-Received: by 2002:adf:e591:0:b0:206:1202:214 with SMTP id l17-20020adfe591000000b0020612020214mr14896572wrm.342.1649425421934; Fri, 08 Apr 2022 06:43:41 -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> <225d2c0a-42ec-28ad-688c-e7e9e2035ee1@quicinc.com> In-Reply-To: From: Doug Anderson Date: Fri, 8 Apr 2022 06:43:28 -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 Content-Type: text/plain; charset="UTF-8" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: quic_kalyant , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "Sankeerth Billakanti \(QUIC\)" , quic_vproddut , David Airlie , linux-arm-msm , Stephen Boyd , Abhinav Kumar , dri-devel , "Kuogee Hsieh \(QUIC\)" , Sean Paul , Sean Paul , "Aravind Venkateswaran \(QUIC\)" , "bjorn.andersson@linaro.org" , freedreno , LKML Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, On Fri, Apr 8, 2022 at 5:20 AM Dmitry Baryshkov wrote: > > > I guess my thought was that in DP you could still create the AUX bus > > at probe time. Then for DP you just return an instant "transfer > > failed" from the AUX bus if HPD isn't asserted. For eDP (as discussed > > elsewhere) when we try to do an AUX transfer then we delay until HPD > > is there. > > I think panel-edp would already handle the delay, so we do not need to > have this logic in the DP driver. There's a whole discussion about this between Stephen and me in patch #5 ("drm/msm/dp: wait for hpd high before any sink interaction"). Basically: * If panel HPD is hooked up to the dedicated HPD pin on the eDP controller then the panel driver doesn't have a way to read it. * We can't leverage the existing "HPD" query functions in DRM because those indicate whether a panel is _physically_ connected. For eDP, it always is. For now the rule is that the AUX transfer function is in charge of waiting for HPD for eDP if the dedicated HPD pin is used. If we want to re-invent this we could, but that system works, isn't _too_ ugly, and we're already making big enough changes in this series. > > So we can still acquire resources (clocks, PHY, io maps, etc) at probe > > time for DP and create the AUX bus, right? It will just return > > "-ENODEV" if HPD isn't asserted and you're DP? > > Yes, please. I still suppose that we'd need a separate case to > power_on eDP's PHY during the probe time. Maybe I'm mistaken here. I think the ideal way is to do it like Kieran's proposal for sn65dsi86: https://lore.kernel.org/r/20220317131250.1481275-4-kieran.bingham+renesas@ideasonboard.com/ * When enabling HPD (physical hot plug detect) in the hpd_enable() callback you do a pm_runtime_get(). You do the pm_runtime_put_autosuspend() when disabling. This is only used for DP since we only provide DRM_BRIDGE_OP_HPD for DP, not for eDP. * We do a pm_runtime_get() / pm_runtime_put_autosuspend() in the AUX transfer routine. While holding the pm_runtime reference we check HPD. For DP we return immediately if HPD isn't asserted. For eDP, we delay. * We do the pm_runtime_get() in pre_enable and the pm_runtime_put() in post_disable. For DP this will add a 2nd refcount (since we probably were holding the reference for HPD). For eDP this will cause us to power on. * If there's any other time we need to read HW registers, and we aren't guaranteed to already have a pm_runtime reference (like during probe), we can do a temporary pm_runtime_get() / pm_runtime_put_autosuspend().