Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp1135712lqt; Tue, 19 Mar 2024 13:55:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEfwu7U60t0bQ7033tMsQU23F/jlsRVzJn8CQmiiS+NlAm/gIcdvqFtJO+PPKm7u2UKIiJ9LRt6mwgad4+9kAgSkUbtuQ7FREkB6gRdg== X-Google-Smtp-Source: AGHT+IGzZvptwzej1QPuOW6VAbwf8DRkVY4o3EdjwjuI3h11tOutr/BN1Z+0BoboFnVO7uVndkJL X-Received: by 2002:a17:906:379b:b0:a46:ce25:23c7 with SMTP id n27-20020a170906379b00b00a46ce2523c7mr3739902ejc.6.1710881722052; Tue, 19 Mar 2024 13:55:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710881722; cv=pass; d=google.com; s=arc-20160816; b=IeL3+tETeGxifQRUedHcIbjaACidZ8O27/H6P1aD5bpMMjRrfYrpaby9iM1/Tuxw9Z 6hQTn1fwNfhG3sqPRTZ4Qpn8e2eF6N0XYM6uJ7oDNqpDH0aCupR72LY/SH8DUpmFgytI 1rQpujD5ajsdnZHz0pxb9h/FJNn5E6nNQReedCfnP1Tb23/MBQQNTB5Zm6n5+laJaK7o xRDiysuBI8sxpI8i6NjDK+ub1VWlYhHWbZ/lxzmpKjVQ9L2tbbyIRNOEAfwehhlfDLCz 8dRa9A62S5G1nkbaQjr7wyb1jxMiNvzMFZUr52EJGsNVWqgvwZ2TqV5SnM+mPPQMgCVS 7QLg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=R9lnTf9V1Lw9eJy1uMCiBOkgpLy0Jis+Ein7H+Xh74g=; fh=n9uhnVb0nC7zKZTRlkgG0BtysOKwDYrPMT1EOwwG+fI=; b=l1fZn1API5FBHgAbrBewMQjsqsGxycZQcWB+ZVbKmCHVUJMdeTvVq+dM46GTwaF9g/ VW+Qg/+7+B2i1hepwNV6SCaw15ToBTV1QONlfnx2Nz+w7bfS9ZwJIXfN3Tioxd1U+Ah6 sMC9ovwvK2Q+i/97S+LVL+d8RbSKMTY9EPyZBnaCR6kN7iM7+a/jVRUftia+9dysEhK0 /rWAuS/AkGA+akIGMhr38y8LJ0FPhT8Atjgfu7dN1O0P7eKdLkTsqnOijBY0cZ1Vusvi ffyyIMaQhLfwie2dUhICKMPd7uWyOEnrs9R2IxraV0MMyjZBOXgOtPKn5RFlhZTCO0nC yUew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IpFpcyeW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-108124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i10-20020a1709064fca00b00a46dfb36484si941171ejw.809.2024.03.19.13.55.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 13:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-108124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=IpFpcyeW; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-108124-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-108124-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9B60D1F21A5E for ; Tue, 19 Mar 2024 20:55:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 488983C47C; Tue, 19 Mar 2024 20:55:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="IpFpcyeW" Received: from mail-yw1-f173.google.com (mail-yw1-f173.google.com [209.85.128.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8FA903BBC7 for ; Tue, 19 Mar 2024 20:55:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710881713; cv=none; b=PrRHN3gBjjxLUdERJykTzyqNTsv3vxxKzJEQ+KF9Tr+oBJgUv01Fynul6m9jKWtbFBtqO5EfJYm2C0yezLbj1shSkobDc9P8za48h4gTkKZmtjpqXxF6ul4ZH3K51JgR9K/dzF00iI0a1n2UiwcqESMMz9E+sAiTN+HraksPs/c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710881713; c=relaxed/simple; bh=MlH2MgOaeOcAx48Ek0uD1vpYLC44yDtt6nv+lwiHB8Y=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=Zqa4Ge/FlSRcB3bfzVWW5cQHZN2Z0R8ofNOiHBaZIiuhMKrUJQG9qOrIRKg+TOhzZ+6NAUwIBaoAZhCkYaHoE+lKqIgpUCm3KGZkr4fy04oE4E7bichs4el4hIfF809jbBrpuyay3K8Iss6CUhHfEe4vaq8lNn0gnRcftP8xFB8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=IpFpcyeW; arc=none smtp.client-ip=209.85.128.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yw1-f173.google.com with SMTP id 00721157ae682-609f4d8551eso2228737b3.1 for ; Tue, 19 Mar 2024 13:55:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1710881710; x=1711486510; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=R9lnTf9V1Lw9eJy1uMCiBOkgpLy0Jis+Ein7H+Xh74g=; b=IpFpcyeW7UbIvo/CDJuFaui7al7HhpFWuwXmOuUvQUm8+nZ9mbGBux4MUQ/V6wtT0t Bp5er0E1ic4WAVJidhdcEIXzat68dMNquEEcd+ZlNtl3B3WdZeXsrLCrQlgV3YVhNLTg 3YV8A2pDcvp9bYGVbMAx01VOh39n0q4YRks0wNX07trdCY9nuY6zRMGMa7Hm129Yt0yP 3vbP8BsAGX+YHFGM0/b1OGhYiYTTy+T6fRX2NlK4RhMwhIej7aAOTmcKTr4ELnTgVFmj AvTTk8QShK9gFCxTsgcQgvBfC+V4LskWDOVEUZbeWDFobfgbVrqAxxI5xgtmtjo6QsXO UI/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710881710; x=1711486510; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R9lnTf9V1Lw9eJy1uMCiBOkgpLy0Jis+Ein7H+Xh74g=; b=KQ40MPSqkwb+3S92NmRrbICisa2LXDg8480wD62JT6UEUH5tA8JUJ1EiDx5zYOJlkc iH3ncQqa/QJRTtjt6gwOT5/1dXehckIa5TyxqR5TuZqF0lEt9Q3zpbCq9XqAnY/6AB5j VRysQicuDsF4B3Z4Bi3+LKFVHCXljqk9W5brLb5EyjN6A+riEwuCrBDwR5s7r6op9QZa aeR59moDA+cdOfn7cIZoPEfvJeTK1AGHavzK+SCxQ2kY785oeqzIPJeq0ygk+ltvNGol JTPPyEcMOXmO6hG6KOGHcpeoUcvCkBzfZ6UqDkbhoCJyxI7dVA1nFzjHwYW2WufZxq6T QO5Q== X-Forwarded-Encrypted: i=1; AJvYcCUK1ekG5rkPIT2cAfjrnYxh6/7xDOk2XyCH1MWfHuKVEdfoZfsYAGeTcrxk4hYzN2tNZFqOMtqmNsGLvUXyKW+eXOND7EZZRBxW39e3 X-Gm-Message-State: AOJu0YwtBsNn11Z7Xj5XHnCf8U1npOsD3jUvbrDn/UoVZP8fuMxq9WIQ sypXYqpUb37eg34h/VQYiMsRK9hPQCcuUZYZCSzI1a+Bjx3mqET6nZX+qxrPJ0r4qKIclQGsIrA zVy1R7GYkWVst3SfZi819HYwW59tcTs+y7pYhJA== X-Received: by 2002:a0d:d8d2:0:b0:60a:181f:16d8 with SMTP id a201-20020a0dd8d2000000b0060a181f16d8mr2499012ywe.5.1710881710534; Tue, 19 Mar 2024 13:55:10 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240319111432.1.I521dad0693cc24fe4dd14cba0c7048d94f5b6b41@changeid> <2fa9a262-de60-2c1e-9ac3-1e478ec65bb8@quicinc.com> <977f647a-fc30-d9c9-f973-fd8bd9a4020a@quicinc.com> In-Reply-To: <977f647a-fc30-d9c9-f973-fd8bd9a4020a@quicinc.com> From: Dmitry Baryshkov Date: Tue, 19 Mar 2024 22:54:59 +0200 Message-ID: Subject: Re: [PATCH] drm/dp: Clarify that wait_hpd_asserted() is not optional for panels To: Abhinav Kumar Cc: Douglas Anderson , dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, Mikko Perttunen , Jonathan Hunter , Thierry Reding , Ankit Nautiyal , Daniel Vetter , David Airlie , Imre Deak , Jani Nikula , Maxime Ripard , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Tue, 19 Mar 2024 at 22:39, Abhinav Kumar wrote: > > > > On 3/19/2024 1:16 PM, Dmitry Baryshkov wrote: > > On Tue, 19 Mar 2024 at 21:02, Abhinav Kumar wrote: > >> > >> > >> > >> On 3/19/2024 11:35 AM, Dmitry Baryshkov wrote: > >>> On Tue, 19 Mar 2024 at 20:15, Douglas Anderson wrote: > >>>> > >>>> In response to my patch removing the "wait for HPD" logic at the > >>>> beginning of the MSM DP transfer() callback [1], we had some debate > >>>> about what the "This is an optional function" meant in the > >>>> documentation of the wait_hpd_asserted() callback. Let's clarify. > >>>> > >>>> As talked about in the MSM DP patch [1], before wait_hpd_asserted() > >>>> was introduced there was no great way for panel drivers to wait for > >>>> HPD in the case that the "built-in" HPD signal was used. Panel drivers > >>>> could only wait for HPD if a GPIO was used. At the time, we ended up > >>>> just saying that if we were using the "built-in" HPD signal that DP > >>>> AUX controllers needed to wait for HPD themselves at the beginning of > >>>> their transfer() callback. The fact that the wait for HPD at the > >>>> beginning of transfer() was awkward/problematic was the whole reason > >>>> wait_hpd_asserted() was added. > >>>> > >>>> Let's make it obvious that if a DP AUX controller implements > >>>> wait_hpd_asserted() that they don't need a loop waiting for HPD at the > >>>> start of their transfer() function. We'll still allow DP controllers > >>>> to work the old way but mark it as deprecated. > >>>> > >>>> [1] https://lore.kernel.org/r/20240315143621.v2.3.I535606f6d4f7e3e5588bb75c55996f61980183cd@changeid > >>>> > >>>> Signed-off-by: Douglas Anderson > >>>> --- > >>>> I would consider changing the docs to say that implementing > >>>> wait_hpd_asserted() is actually _required_ for any DP controllers that > >>>> want to support eDP panels parented on the DP AUX bus. The issue is > >>>> that one DP controller (tegra/dpaux.c, found by looking for those that > >>>> include display/drm_dp_aux_bus.h) does populate the DP AUX bus but > >>>> doesn't implement wait_hpd_asserted(). I'm actually not sure how/if > >>>> this work on tegra since I also don't see any delay loop for HPD in > >>>> tegra's transfer() callback. For now, I've left wait_hpd_asserted() as > >>>> optional and described the old/deprecated way things used to work > >>>> before wait_hpd_asserted(). > >>>> > >>>> include/drm/display/drm_dp_helper.h | 8 +++++++- > >>>> 1 file changed, 7 insertions(+), 1 deletion(-) > >>>> > >>>> diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h > >>>> index a62fcd051d4d..b170efa1f5d2 100644 > >>>> --- a/include/drm/display/drm_dp_helper.h > >>>> +++ b/include/drm/display/drm_dp_helper.h > >>>> @@ -422,7 +422,13 @@ struct drm_dp_aux { > >>>> * @wait_hpd_asserted: wait for HPD to be asserted > >>>> * > >>>> * This is mainly useful for eDP panels drivers to wait for an eDP > >>>> - * panel to finish powering on. This is an optional function. > >>>> + * panel to finish powering on. It is optional for DP AUX controllers > >>>> + * to implement this function but required for DP AUX endpoints (panel > >>>> + * drivers) to call it after powering up but before doing AUX transfers. > >>>> + * If a DP AUX controller does not implement this function then it > >>>> + * may still support eDP panels that use the AUX controller's built-in > >>>> + * HPD signal by implementing a long wait for HPD in the transfer() > >>>> + * callback, though this is deprecated. > >>> > >>> It doesn't cover a valid case when the panel driver handles HPD signal > >>> on its own. > >>> > >> > >> This doc is only for wait_for_hpd_asserted(). If panel driver handles > >> HPD signal on its own, this will not be called. Do we need a doc for that? > > > > This comment declares that this callback must be called by the panel > > driver: '...but required for DP AUX endpoints [...] to call it after > > powering up but before doing AUX transfers.' > > > > If we were to follow documentation changes from this patch, we'd have > > to patch panel-edp to always call wait_for_hpd_asserted, even if HPD > > GPIO is used. However this is not correct from my POV. > > > > hmmm I dont mind explicitly saying "unless the panel can independently > check the HPD state" but not required in my opinion because if panel was > capable of checking the HPD gpio (its self-capable) why would it even > call wait_for_hpd_asserted? I'm fine with the proposed change. Doug? > > I will let you and Doug discuss this but fwiw, I am fine without this > additional clarification. So the R-b stands with or without this > additional clause. > > >>>> * > >>>> * This function will efficiently wait for the HPD signal to be > >>>> * asserted. The `wait_us` parameter that is passed in says that we > >>>> -- > >>>> 2.44.0.291.gc1ea87d7ee-goog > >>>> > >>> > >>> > > > > > > -- With best wishes Dmitry