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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9C252F34C52 for ; Mon, 13 Apr 2026 13:34:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GYaQojvqqAmTaFc2r//pM6g2cNBpH+AdNC99hFURePc=; b=Su7GLKGVhbI3B0HsGKtA4Bh7nA tUivtpaYBUBhL6GAwRG2FaO8JzFehCkkuwD/R8NL2peSVSAu/caWvNZU7IIKMA8r08EU8t6lGLyH5 RgwlhY1ql0fxoFOJpLv2BkJ1xzoEp8ozO8vHWEDvmPNyus5JOqaaTy4nGMoUNJFfvpHKQhdeditEd OaIA7lyszfNJHimpIkXtPGgp75nbBsKa+I3zPso69MockpB1DTyKukgjAuKMeBqzPfLYyn/YdBy31 DjZxyr5OrwWvVeWIYWH/6mN8sbHdmo+CaJlcPPuKAk7/ssI7MeY6dyui2okp40ioTIWkUbX7l+Brb 97choGPQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1wCHRF-0000000Fl2i-0LuY; Mon, 13 Apr 2026 13:34:53 +0000 Received: from smtpout-04.galae.net ([185.171.202.116]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1wCHRB-0000000Fl27-2gWD; Mon, 13 Apr 2026 13:34:52 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id 7FCAEC5B19E; Mon, 13 Apr 2026 13:35:23 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BFD485FFB9; Mon, 13 Apr 2026 13:34:46 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 542DA10450269; Mon, 13 Apr 2026 15:34:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1776087284; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=GYaQojvqqAmTaFc2r//pM6g2cNBpH+AdNC99hFURePc=; b=UBlFv0L0dIrTDLFrHJ6AR6fjUWd5FGU51aCoKmodlXc91vSu30CTpaq77qe43I5z8Ij4F7 xSolDTIMyHTumOqBeL1e/r8KRYxvmXIlin63yLXpD5hqa7jvydQjn6fHn3tY4Nr72a+avf oas5O8iYBEsns5nyTVHLxtE3Fqv/WIPHaRj3R64m9YbVq5ImripMcd9BQMLoL+3qlEpgVV /PwJM7nEtnERZfvejw1vvfFdILb4+uK5b9jAvWqKV4v8p9CFCvnmWFIXk0jo9A7zeV9Rf7 YTrnOtba1yrds4A34vOxaI3expBXDTl1CAzp2iVK8OWZLENf6BEC7BH4JxRkHg== Date: Mon, 13 Apr 2026 15:34:36 +0200 From: Kory Maincent To: Jani Nikula Cc: Rodrigo Vivi , Joonas Lahtinen , Tvrtko Ursulin , David Airlie , Simona Vetter , Dave Airlie , Jesse Barnes , Eric Anholt , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Chun-Kuang Hu , Philipp Zabel , Matthias Brugger , AngeloGioacchino Del Regno , Chris Wilson , Thomas Petazzoni , Mark Yacoub , Sean Paul , Louis Chauvet , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Simona Vetter Subject: Re: [PATCH RFC 10/12] drm/i915/display/dp: Adopt dp_connector helpers to expose link training state Message-ID: <20260413153436.2a08be28@kmaincent-XPS-13-7390> In-Reply-To: <9f4bb4501c4885f432cbe9b6a10b7d27e40b0876@intel.com> References: <20260409-feat_link_cap-v1-0-7069e8199ce2@bootlin.com> <20260409-feat_link_cap-v1-10-7069e8199ce2@bootlin.com> <20260413143402.76f5c3c9@kmaincent-XPS-13-7390> <9f4bb4501c4885f432cbe9b6a10b7d27e40b0876@intel.com> Organization: bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260413_063449_827856_14E94C8F X-CRM114-Status: GOOD ( 34.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 13 Apr 2026 16:05:53 +0300 Jani Nikula wrote: > On Mon, 13 Apr 2026, Kory Maincent wrote: > > On Fri, 10 Apr 2026 19:26:53 +0300 > > Jani Nikula wrote: > > =20 > >> On Thu, 09 Apr 2026, Kory Maincent wrote: = =20 > >> > Switch the i915 DP connector initialization from drmm_connector_init= () > >> > to drmm_connector_dp_init(), providing the source link capabilities > >> > (supported lane counts, link rates, DSC support, voltage swing and > >> > pre-emphasis levels). > >> > > >> > Add intel_dp_report_link_train() to collect the negotiated link > >> > parameters (rate, lane count, DSC enable, per-lane voltage swing and > >> > pre-emphasis) and report them via > >> > drm_connector_dp_set_link_train_properties() once link training comp= letes > >> > successfully. > >> > > >> > Reset the link training properties via > >> > drm_connector_dp_reset_link_train_properties() when the connector is > >> > reported as disconnected or when the display device is disabled, so > >> > the exposed state always reflects the current link status. > >> > > >> > Signed-off-by: Kory Maincent > >> > --- > >> > drivers/gpu/drm/i915/display/intel_dp.c | 31 > >> > +++++++++++++++++++--- .../gpu/drm/i915/display/intel_dp_link_traini= ng.c > >> > | 25 +++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletio= ns(-) > >> > > >> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c > >> > b/drivers/gpu/drm/i915/display/intel_dp.c index > >> > 2af64de9c81de..641406bdc0cc9 100644 --- > >> > a/drivers/gpu/drm/i915/display/intel_dp.c +++ > >> > b/drivers/gpu/drm/i915/display/intel_dp.c @@ -45,6 +45,7 @@ > >> > #include > >> > #include > >> > #include > >> > +#include > >> > #include > >> > #include > >> > #include > >> > @@ -6337,8 +6338,10 @@ intel_dp_detect(struct drm_connector *_connec= tor, > >> > drm_WARN_ON(display->drm, > >> > !drm_modeset_is_locked(&display->drm->mode_config.connection_= mutex)); > >> > =20 > >> > - if (!intel_display_device_enabled(display)) > >> > + if (!intel_display_device_enabled(display)) { > >> > + > >> > drm_connector_dp_reset_link_train_properties(_connector); return > >> > connector_status_disconnected; > >> > + } > >> > =20 > >> > if (!intel_display_driver_check_access(display)) > >> > return connector->base.status; > >> > @@ -6388,6 +6391,8 @@ intel_dp_detect(struct drm_connector *_connect= or, > >> > =20 > >> > intel_dp_tunnel_disconnect(intel_dp); > >> > =20 > >> > + > >> > drm_connector_dp_reset_link_train_properties(_connector); + > >> > goto out_unset_edid; > >> > } > >> > =20 > >> > @@ -7162,10 +7167,12 @@ intel_dp_init_connector(struct intel_digital= _port > >> > *dig_port, struct intel_connector *connector) > >> > { > >> > struct intel_display *display =3D to_intel_display(dig_port); > >> > + struct drm_connector_dp_link_train_caps link_caps; > >> > struct intel_dp *intel_dp =3D &dig_port->dp; > >> > struct intel_encoder *encoder =3D &dig_port->base; > >> > struct drm_device *dev =3D encoder->base.dev; > >> > enum port port =3D encoder->port; > >> > + u32 *rates; > >> > int type; > >> > =20 > >> > if (drm_WARN(dev, dig_port->max_lanes < 1, > >> > @@ -7213,8 +7220,25 @@ intel_dp_init_connector(struct intel_digital_= port > >> > *dig_port, type =3D=3D DRM_MODE_CONNECTOR_eDP ? "eDP" : "DP", > >> > encoder->base.base.id, encoder->base.name); > >> > =20 > >> > - drmm_connector_init(dev, &connector->base, > >> > &intel_dp_connector_funcs, > >> > - type, &intel_dp->aux.ddc); > >> > + intel_dp_set_source_rates(intel_dp); > >> > + link_caps.nlanes =3D DRM_DP_1LANE | DRM_DP_2LANE | DRM_DP_4LANE; > >> > + link_caps.nrates =3D intel_dp->num_source_rates; > >> > + rates =3D kzalloc_objs(*rates, intel_dp->num_source_rates); > >> > + if (!rates) > >> > + goto fail; > >> > + > >> > + for (int i =3D 0; i < intel_dp->num_source_rates; i++) > >> > + rates[i] =3D intel_dp->source_rates[i]; > >> > + > >> > + link_caps.rates =3D rates; > >> > + link_caps.dsc =3D true; =20 > >>=20 > >> You have a source, you have a sink, and you have a link between the tw= o. > >>=20 > >> Source rates do not reflect the link rates common between source and > >> sink. > >>=20 > >> DSC depends on source and sink, and it's not statically "true" for > >> either, and depends on a bunch of things. =20 > > > > At init, we are reporting the capabilities of the source. So we list ev= ery > > link rates that the source can achieve and we report that the source is= DSC > > capable which it is IIUC the code. Or maybe I am missing something? =20 >=20 > IMO link caps is the intersection of the source and sink caps. If the > sink is unknown, i.e. its caps are the empty set, then the link caps > should also be the empty set. Ok thanks, I am rather new to the DiplayPort world so thank you for sharing your knowledge. IIUC currently the drivers are not testing all the capabilities of the link, they try the more "powerful" link and decrease the link parameters until it works right? So there is currently no way to now the full capabilities betw= een a sink and a source. > If you need to know the source caps, then they need to be presented > separately. With DRM properties we can see possible values and the value set.=20 My though was that the possible value are matching the source capabilities = and value set was the one negotiated between the source and the sink. This was straightforward to me but it indeed can confuse between source capabilities and link capabilities. Have you a better idea? > Moreover, the source does not unconditionally support DSC. See > intel_dp_has_dsc(). Indeed thanks, I need to investigate that function. Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com