From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 86F86217670 for ; Thu, 9 Jan 2025 12:10:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736424622; cv=none; b=M54NFxdmwEpAShzLxYC3dbY5Wy0znyLvX/t/hKGiuAsTW+8W4A6emovfCm/vq5cVHyHr0oNPotrJKHqMYtAwQJgwD+nXCJ054AlCRWNncTh8Dfare7gUx8fYWO+wNvNbZ3wG19IYw3zuK16PDWJ8oal8Dg+8e4C/5w4Ch8VTCEo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736424622; c=relaxed/simple; bh=yw80//erKtIihCTfLejyupKTzJ5/n78i0rH/c2Vn88A=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uEl9LXxE/bhfZkadzCT1485OL2PKAj9ObmOvg8Qx7suenFAdSnm4rmjD+sHwXw8g6EK84ikuwUsPibED+fRlzOUEqtWbwr4CMSt94pywaALh2p3eOAi/fb9+VZ7mIMcQ0KLIchJ55ov58WAx1H9V1CIgzp6DWNXUdSV7zagS11Q= 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=CPGBoty+; arc=none smtp.client-ip=209.85.128.53 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="CPGBoty+" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-436202dd7f6so10619465e9.0 for ; Thu, 09 Jan 2025 04:10:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1736424619; x=1737029419; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ScDEvNBMi9Yu3n8HTIx1zSceI6fYU9kCdn5rYgIhGU8=; b=CPGBoty+ygH9gBegbx0nxyEe8oXvZlHqg7o1/gC/4mgYGJHLqarZzTJ/hhjro28nno Vi/eR2vSWPnLWw015buz+cvt3kIhLZtlCRUO26I55YqxAjCkUxt8Qeix6TPyYj9HWROu RmSVVd8HOpLpzP3MzFz2/QuM/8F5D5rYrrcESQOYJD3uML79miHCBuexyZLR1T8v9q/W Q1V0UaNfJIu48ovc0lFW3seqj5bSeow7HL/K7tLI549aCQYUE9uYHkcjRpE9/pZPtDjR cRTj5PhNXqWM+E3Vn0WzAs1vP7R0B2ve3iHvl0EKSoDbaqEPnNn0jt9LbL45Ord+FE+l ZB3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736424619; x=1737029419; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ScDEvNBMi9Yu3n8HTIx1zSceI6fYU9kCdn5rYgIhGU8=; b=ZUK6NsUy0RNhaBeB4W5djZ3Ca8Xvoxl9q7wEDouuU8AKqZnBf1K4chAJPSDQlsqRW9 T+8rkqARkaZtL3tPJ7sDJzTr6bKYwlMEBOZedYqTlNeEfofsz5u55D6oc+n50/AcOZrK TZkEuoWn2exI8sQmpYUFPBb3GIngwGtibYnHFWIBYGDsTfWrcNuR3R9NyNHw0bFpLx6h CMKLOZk5wrFjtmIjtDMNDclYzIV4/9R6ZJt8D7pvep/yHS38NaUg5XGE83ZkypZpke41 HNYTdXFUb/LpNJ0k0GiLlsU++4LXDCYR9BHTfOspbD9+SBuyhgWc0G8DcaxWNZcAtx6B 4D/g== X-Forwarded-Encrypted: i=1; AJvYcCVb3sPwIf1zzalY73ZC5mxPbCXzpCYelYidU8VK90joI+FZT5q6sNBEbsQ9jWo5mkynyVcJnbqZdFYYoGE=@vger.kernel.org X-Gm-Message-State: AOJu0Yy4xcIqmz4SjOGRwKEFtvcdTg8QvUPm8Vtu34yOMZQH+WCUvQi9 muokT7qbcbIGZuurjdxi/0WhgzJxII0qtWmEYKFpnz0/uAdKcUvfsfqkb+ivrPA= X-Gm-Gg: ASbGncvfHhsayrLTyVvCUpq5EvBez2Quwyk2veXrRhR/a83xAJ1ibnJfwfsMzmIYU7+ yK58gPj48xfQE/35hhLFoiViMHFP7zv/9wIsGS3+DvepVkAkl4FnP337EPBIyj/4M7M8zgGxGp0 U0JoIznd+VSIK8lpoeZaWfG0pvNSLF2uYQRYK911ethoZJ2fXv8dKL9eoshRuJ3FpTuY9Z8xujN kHiVwTEl+JwB5w3uclsL5jMgfX+25sCZCu5A+WvsrG9kGluRY9n1Ng= X-Google-Smtp-Source: AGHT+IG8rp+QX8v4S4fqKATVXk+QD/aEvAPXmO9Bulu0mN6QuKMDbLW3pqUmFSzB7pw+E5Uf11Sy2A== X-Received: by 2002:a05:600c:46ce:b0:436:6ddf:7a27 with SMTP id 5b1f17b1804b1-436e27072a7mr53497435e9.23.1736424618831; Thu, 09 Jan 2025 04:10:18 -0800 (PST) Received: from linaro.org ([86.121.162.10]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-436e2da63eesm53042595e9.3.2025.01.09.04.10.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jan 2025 04:10:18 -0800 (PST) Date: Thu, 9 Jan 2025 14:10:16 +0200 From: Abel Vesa To: Abhinav Kumar Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Karol Herbst , Lyude Paul , Danilo Krummrich , Jani Nikula , Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , Rob Clark , Dmitry Baryshkov , Sean Paul , Marijn Suijten , Bjorn Andersson , Konrad Dybcio , Johan Hovold , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, Johan Hovold Subject: Re: [PATCH v4 4/4] drm/msm/dp: Add support for LTTPR handling Message-ID: References: <20250108-drm-dp-msm-add-lttpr-transparent-mode-set-v4-0-918949bc2e3a@linaro.org> <20250108-drm-dp-msm-add-lttpr-transparent-mode-set-v4-4-918949bc2e3a@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On 25-01-08 14:57:41, Abhinav Kumar wrote: > > > On 1/8/2025 6:31 AM, Abel Vesa wrote: > > Link Training Tunable PHY Repeaters (LTTPRs) are defined in DisplayPort > > 1.4a specification. As the name suggests, these PHY repeaters are > > capable of adjusting their output for link training purposes. > > > > According to the DisplayPort standard, LTTPRs have two operating > > modes: > > - non-transparent - it replies to DPCD LTTPR field specific AUX > > requests, while passes through all other AUX requests > > - transparent - it passes through all AUX requests. > > > > Switching between this two modes is done by the DPTX by issuing > > an AUX write to the DPCD PHY_REPEATER_MODE register. > > > > The msm DP driver is currently lacking any handling of LTTPRs. > > This means that if at least one LTTPR is found between DPTX and DPRX, > > the link training would fail if that LTTPR was not already configured > > in transparent mode. > > > > The section 3.6.6.1 from the DisplayPort v2.0 specification mandates > > that before link training with the LTTPR is started, the DPTX may place > > the LTTPR in non-transparent mode by first switching to transparent mode > > and then to non-transparent mode. This operation seems to be needed only > > on first link training and doesn't need to be done again until device is > > unplugged. > > > > It has been observed on a few X Elite-based platforms which have > > such LTTPRs in their board design that the DPTX needs to follow the > > procedure described above in order for the link training to be successful. > > > > So add support for reading the LTTPR DPCD caps to figure out the number > > of such LTTPRs first. Then, for platforms (or Type-C dongles) that have > > at least one such an LTTPR, set its operation mode to transparent mode > > first and then to non-transparent, just like the mentioned section of > > the specification mandates. > > > > Tested-by: Johan Hovold > > Reviewed-by: Dmitry Baryshkov > > Reviewed-by: Johan Hovold > > Signed-off-by: Abel Vesa > > --- > > drivers/gpu/drm/msm/dp/dp_display.c | 17 +++++++++++++++++ > > 1 file changed, 17 insertions(+) > > > > diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c > > index 24dd37f1682bf5016bb0efbeb44489061deff060..ad09daa4c8ab5c0eb67890509b94e72820bab870 100644 > > --- a/drivers/gpu/drm/msm/dp/dp_display.c > > +++ b/drivers/gpu/drm/msm/dp/dp_display.c > > @@ -107,6 +107,8 @@ struct msm_dp_display_private { > > struct msm_dp_event event_list[DP_EVENT_Q_MAX]; > > spinlock_t event_lock; > > + u8 lttpr_caps[DP_LTTPR_COMMON_CAP_SIZE]; > > + > > The reason downstream stored it panel is to read it first in dp_panel's > read_sink_caps and call lttpr_init if drm_dp_lttpr_count() is non-zero. > > But here it looks like msm_dp_display_lttpr_init() internally handles this > for us. So no need to store this? Replied to Bjorn already about this and why I thought it was a good idea to add it. But will drop in the next version. > > > bool wide_bus_supported; > > struct msm_dp_audio *audio; > > @@ -367,12 +369,27 @@ static int msm_dp_display_send_hpd_notification(struct msm_dp_display_private *d > > return 0; > > } > > +static void msm_dp_display_lttpr_init(struct msm_dp_display_private *dp) > > +{ > > + int rc; > > + > > + if (drm_dp_read_lttpr_common_caps(dp->aux, dp->panel->dpcd, > > + dp->lttpr_caps)) > > + return; > > + > > + rc = drm_dp_lttpr_init(dp->aux, drm_dp_lttpr_count(dp->lttpr_caps)); > > + if (rc) > > + DRM_ERROR("failed to set LTTPRs transparency mode, rc=%d\n", rc); > > +} > > + > > static int msm_dp_display_process_hpd_high(struct msm_dp_display_private *dp) > > { > > struct drm_connector *connector = dp->msm_dp_display.connector; > > const struct drm_display_info *info = &connector->display_info; > > int rc = 0; > > + msm_dp_display_lttpr_init(dp); > > + > > Can you pls move this call after msm_dp_panel_read_sink_caps()? > > If msm_dp_panel_read_sink_caps() fails there is no need to call > msm_dp_display_lttpr_init(). Sure. > > > > rc = msm_dp_panel_read_sink_caps(dp->panel, connector); > > if (rc) > > goto end; > > Thanks for reviewing! Abel