From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.19]) (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 5F3173CAE81 for ; Mon, 13 Apr 2026 13:06:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776085570; cv=none; b=G9/DoYt6rcFsr8E6ThamAOK4ld1QomYTBvHH6KehAQiQyllhITQRGtj5PvCbeuoTklyRZlN2SPGRAoyMQmXQsy+s/iCVp9iWEt8gx90uLcJ0yAeovqbTCOjsFPTjFjZfIvkDBwNSbgTpvio5GSGWR3OXKhNxVoVA3ZJ/akCsPzo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776085570; c=relaxed/simple; bh=m1GPLNSP07gTZEdCOrDIkYV5h1LGGTFSBOSRoqBTE9M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=TmGtD9+aYx3qY2hCJyvXU2a+bt074eYRrYM/ZMHe49hg/hDZ+xLWrVTj+bs7btaOD3qtqRu9iuwCwCIsvB9t5LmXUFqdGVSwVr3zRy/F8OLbmid5HebQSPf24yzIBQ1QiKU2q7vODg5aCFH449b3BcOR9aIy5LDK34v/Gc1fOiY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=EUuZmZib; arc=none smtp.client-ip=198.175.65.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="EUuZmZib" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1776085568; x=1807621568; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=m1GPLNSP07gTZEdCOrDIkYV5h1LGGTFSBOSRoqBTE9M=; b=EUuZmZibt5qOTeEHOj8Ya/a8UyrnzJ53p4xjOTR2ePxO15AmYKU4hPA0 tyLRu1Z4kgey8xDRl6AAdZadA1/X66MibGkfij7XFeoxvdqbghbKjxb3U mfSzne+MhzB0hmbXnpWSMBYbUChkO8Kcny3f+5+ZAj6Mycd1BHD4uOptQ wS14aCzp9kZiDEugVWvnL51NXHWyvS3ZcADppoCrTO4loicAtW3AEyUDu ux/9HBUOSv6FXB0IGVh8WMNV2DFb4CsPM9NlLgP7W3ZvxYZolgQxCAQWy iVKZeiwcqNsyVM/6rUs/FvNT8eb3hYGwxb2BuK/FwH0jlJlD1DCeMjup0 g==; X-CSE-ConnectionGUID: ajnq9LxuRQiyGboHMhZAYg== X-CSE-MsgGUID: ZfXor8MjQva3W6SYPd3A1w== X-IronPort-AV: E=McAfee;i="6800,10657,11758"; a="76926674" X-IronPort-AV: E=Sophos;i="6.23,177,1770624000"; d="scan'208";a="76926674" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by orvoesa111.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2026 06:06:07 -0700 X-CSE-ConnectionGUID: XTvhLMeDSvSBM281Sg4XIw== X-CSE-MsgGUID: Tk8VfxcDR0yDidSuU528tQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,177,1770624000"; d="scan'208";a="231507270" Received: from slindbla-desk.ger.corp.intel.com (HELO localhost) ([10.245.246.182]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2026 06:05:57 -0700 From: Jani Nikula To: Kory Maincent 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 In-Reply-To: <20260413143402.76f5c3c9@kmaincent-XPS-13-7390> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs Bertel Jungin Aukio 5, 02600 Espoo, Finland 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> Date: Mon, 13 Apr 2026 16:05:53 +0300 Message-ID: <9f4bb4501c4885f432cbe9b6a10b7d27e40b0876@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On Mon, 13 Apr 2026, Kory Maincent wrote: > 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 completes >> > 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_mutex)); >> > >> > - if (!intel_display_device_enabled(display)) >> > + if (!intel_display_device_enabled(display)) { >> > + drm_connector_dp_reset_link_train_properties(_connector); >> > return connector_status_disconnected; >> > + } >> > >> > if (!intel_display_driver_check_access(display)) >> > return connector->base.status; >> > @@ -6388,6 +6391,8 @@ intel_dp_detect(struct drm_connector *_connector, >> > >> > intel_dp_tunnel_disconnect(intel_dp); >> > >> > + drm_connector_dp_reset_link_train_properties(_connector); >> > + >> > goto out_unset_edid; >> > } >> > >> > @@ -7162,10 +7167,12 @@ intel_dp_init_connector(struct intel_digital_port >> > *dig_port, struct intel_connector *connector) >> > { >> > struct intel_display *display = to_intel_display(dig_port); >> > + struct drm_connector_dp_link_train_caps link_caps; >> > struct intel_dp *intel_dp = &dig_port->dp; >> > struct intel_encoder *encoder = &dig_port->base; >> > struct drm_device *dev = encoder->base.dev; >> > enum port port = encoder->port; >> > + u32 *rates; >> > int type; >> > >> > if (drm_WARN(dev, dig_port->max_lanes < 1, >> > @@ -7213,8 +7220,25 @@ intel_dp_init_connector(struct intel_digital_port >> > *dig_port, type == DRM_MODE_CONNECTOR_eDP ? "eDP" : "DP", >> > encoder->base.base.id, encoder->base.name); >> > >> > - 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 = DRM_DP_1LANE | DRM_DP_2LANE | DRM_DP_4LANE; >> > + link_caps.nrates = intel_dp->num_source_rates; >> > + rates = kzalloc_objs(*rates, intel_dp->num_source_rates); >> > + if (!rates) >> > + goto fail; >> > + >> > + for (int i = 0; i < intel_dp->num_source_rates; i++) >> > + rates[i] = intel_dp->source_rates[i]; >> > + >> > + link_caps.rates = rates; >> > + link_caps.dsc = true; >> >> You have a source, you have a sink, and you have a link between the two. >> >> Source rates do not reflect the link rates common between source and >> sink. >> >> 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? 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. If you need to know the source caps, then they need to be presented separately. Moreover, the source does not unconditionally support DSC. See intel_dp_has_dsc(). BR, Jani. -- Jani Nikula, Intel