From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtpout-03.galae.net (smtpout-03.galae.net [185.246.85.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 719E23B0AF1 for ; Mon, 13 Apr 2026 12:34:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.246.85.4 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776083660; cv=none; b=pJz+Iz1or1hFKHY+yquHm9taD5k5OY5S/0SbWukupP5ptE7UM3t+gRBZ84gqkKcF3UYcnrfdUYiYzCs3kU0+u4qIyo1aNsk0l6RdqBn8l7mPyrprdZsbwiDQZs1iGvF4gsshvcFu+kYEMYWbPswMnEcvleLTUIEQEapPSPhIkMo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776083660; c=relaxed/simple; bh=DucKXMipsTyaSGGm0GwjL+Zja6HlYasbwurH2hC+5zs=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=okuKsSV6xFwijHIQOIZsi5Hyhg34kI7h8Dda1MYIk1khuiOq7Zu+mrhLMT2jJ7en232h8ynU6vLUoRQqbzZqdV4vxnymPR81IEXL1H9WVH9zhUWwVmBFwG4hulfA44KcOMgjmMceQKnoDZQ5JFSEFVJJchwlCzRR4aWr6mvlT1I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=syyNFaz4; arc=none smtp.client-ip=185.246.85.4 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="syyNFaz4" Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id 9BD954E4296E; Mon, 13 Apr 2026 12:34:15 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id 6D14A5FFB9; Mon, 13 Apr 2026 12:34:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 10AAC10450229; Mon, 13 Apr 2026 14:34:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1776083654; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=W8Wq0XFDTnCET+9d1u1+KkWzNdxSiwKVtLFGfiPbxXY=; b=syyNFaz4M5CS3w/qw5wtQg2RUzkQnw7q8wpoWJoj2F/6PjYErOhqgA15EFQePTJFBA4UUF LSoYPrX+6nQZSqeG+B4U4C4xWZ1ulEKEh0Ey4sQyQWMzsQ6tAryHHJei5nGcYHXOoxDecC MEHdbtnzQcIZmpBy0guw4bo6EI9a3soHuL6Iia5wgs5TjoAu7fZyVJG+ga+5ODGi/+U2VG 5Hif4ZnGHGfMoRaK7RFojvStP0nVD+NWuhg11+AM9pkSYzPTLZPJvgxhSIVupZBkt6H3R8 zRfNZdNIdvMsN5cINpliwzzvjzglbX6zYtJZaEhq4n3qR6E/vUiX3TK/CIPkKw== Date: Mon, 13 Apr 2026 14:34:02 +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: <20260413143402.76f5c3c9@kmaincent-XPS-13-7390> In-Reply-To: References: <20260409-feat_link_cap-v1-0-7069e8199ce2@bootlin.com> <20260409-feat_link_cap-v1-10-7069e8199ce2@bootlin.com> Organization: bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) 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=UTF-8 Content-Transfer-Encoding: quoted-printable X-Last-TLS-Session-Version: TLSv1.3 On Fri, 10 Apr 2026 19:26:53 +0300 Jani Nikula wrote: > On Thu, 09 Apr 2026, Kory Maincent wrote: > > 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 complet= es > > 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_training.= c | > > 25 +++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) > > > > 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 *_connector, > > drm_WARN_ON(display->drm, > > !drm_modeset_is_locked(&display->drm->mode_config.connection_mut= ex)); > > =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 *_connector, > > =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_po= rt > > *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 two. >=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. At init, we are reporting the capabilities of the source. So we list every 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? Regards, --=20 K=C3=B6ry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com