From nobody Mon Feb 9 17:56:45 2026 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (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 E88AC5A0FC for ; Fri, 15 Mar 2024 23:09:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710544174; cv=none; b=O9m7aLL5KrRrF3e6BcTb+5dbyZDIyiIhhTq4ragArVp1/Qfqg4tc3wqRaL6f3fU1GKG4L1Ax+BaweavOCeMwPHrDwpsICgsmaBmLdaCjVBMTpvo+x0nyQp+KfPC3urRWCGN9QXcF4EbOzuyj4hGf716KynqwMLcd2QDdJtCQMEk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710544174; c=relaxed/simple; bh=wJuj2LnV7wTCORzUWD0e3tl+Zokc0cUCwwvLx8oI67U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=aXUxG8GKMSJRGTTFUKd5gTJlhrZcCKNcep5spKzqB8W3PypKo+yENVMWkFgwGQMZ7taHO7t5lNvhWpbouz1riAtKInS71GS6q6Za87P1kyCfnKKtEPbNJariIGLZPkietlsqD4Sk9mrUVBDj2Ji69OKmw7sUEu5YTS6DDLh8/RU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=KsbOkTNZ; arc=none smtp.client-ip=95.215.58.183 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="KsbOkTNZ" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1710544167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=R2Qeb73E854SLNNqpfgzZuZinTfxWG3SchDvt92uTCI=; b=KsbOkTNZiQeegFXVQDpqlUx8jkW8Z7Ir6x2ewKOI/CqJl/7WHHXmvqtOD63M5XhdZ1wOIl DZgfnKLuJS9QqhFmPbDKc6x874/8ClrrkRYiYl3uor0Hsyq+9vuNWNA8mq/V+LNmLZUgdh yPixMKOSoUVqdH8WGoTZ/mY3F1Gx1MQ= From: Sean Anderson To: Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org Cc: David Airlie , linux-kernel@vger.kernel.org, Michal Simek , linux-arm-kernel@lists.infradead.org, Daniel Vetter , Sean Anderson Subject: [PATCH 2/6] drm: zynqmp_dp: Adjust training values per-lane Date: Fri, 15 Mar 2024 19:09:12 -0400 Message-Id: <20240315230916.1759060-3-sean.anderson@linux.dev> In-Reply-To: <20240315230916.1759060-1-sean.anderson@linux.dev> References: <20240315230916.1759060-1-sean.anderson@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" The feedback we get from the DPRX is per-lane. Make changes using this information, instead of picking the maximum values from all lanes. This results in more-consistent training on marginal links. Signed-off-by: Sean Anderson --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp= _dp.c index 98a32e6a0459..8635b5673386 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -605,28 +605,21 @@ static void zynqmp_dp_adjust_train(struct zynqmp_dp *= dp, u8 link_status[DP_LINK_STATUS_SIZE]) { u8 *train_set =3D dp->train_set; - u8 voltage =3D 0, preemphasis =3D 0; u8 i; =20 for (i =3D 0; i < dp->mode.lane_cnt; i++) { - u8 v =3D drm_dp_get_adjust_request_voltage(link_status, i); - u8 p =3D drm_dp_get_adjust_request_pre_emphasis(link_status, i); + u8 voltage =3D drm_dp_get_adjust_request_voltage(link_status, i); + u8 preemphasis =3D + drm_dp_get_adjust_request_pre_emphasis(link_status, i); =20 - if (v > voltage) - voltage =3D v; + if (voltage >=3D DP_TRAIN_VOLTAGE_SWING_LEVEL_3) + voltage |=3D DP_TRAIN_MAX_SWING_REACHED; =20 - if (p > preemphasis) - preemphasis =3D p; - } + if (preemphasis >=3D DP_TRAIN_PRE_EMPH_LEVEL_2) + preemphasis |=3D DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; =20 - if (voltage >=3D DP_TRAIN_VOLTAGE_SWING_LEVEL_3) - voltage |=3D DP_TRAIN_MAX_SWING_REACHED; - - if (preemphasis >=3D DP_TRAIN_PRE_EMPH_LEVEL_2) - preemphasis |=3D DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; - - for (i =3D 0; i < dp->mode.lane_cnt; i++) train_set[i] =3D voltage | preemphasis; + } } =20 /** --=20 2.35.1.1320.gc452695387.dirty