From nobody Wed Feb 11 02:26:58 2026 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) (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 008CE15572B for ; Mon, 22 Apr 2024 18:46:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713811570; cv=none; b=AAujn9osjL0NvU4YzxuwLv5vvrHHAsqP7EhL6rFnJn+1fFPYpbKzSE4GoCS+RYxAmOGSKmqSiXgniPYs26XB/3kU9s3PgBEBanA9fYmbux3hP1cCz3IFDrgaqttgktUx441TwkfneilI3VOj5SCH1Rp+WyrLFGha+p6O8ACIUGo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713811570; c=relaxed/simple; bh=ZCJNB35wygvJm4ZdpNB7+Vnq3rPQcMK2kkpJ5I9upe8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cfCb+bFDl9ZpN60wKamijkx3mxfuSbhXD3bbQxXW50YhQPw92mK6EOW35o0pB5BoeskLqpDXBz45eYK/+EtTti2d2dNHcX/DhOWo3Oh0EVoRQNzCB4UEuBM6uyuHeT8IZ2koecunnexabd4ATuGBahjz6Z+J1HM76taoHpDyIR4= 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=kZuQ4Ylo; arc=none smtp.client-ip=91.218.175.180 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="kZuQ4Ylo" 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=1713811567; 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=5nrF6VDUIPcZsD4wFuWM8MT9Kja3bZUkY7wxu3RiboM=; b=kZuQ4YloMXzcrRf5AwuW90zYmaJssVI9kiPfHyL5pMj6/RZUXG2W0id0oXFxJlKM5g6B4L Ql50xuUwcVdsqEHwSsm3g//Puz9ZlB54vosZZZ4nuy4Rzq1SFttnqOqolRdjjYIaEM4aay dUg61JMc6w1fZ75GUosIdRn7YLQ8DVg= From: Sean Anderson To: Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org Cc: David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Michal Simek , Sean Anderson , Tomi Valkeinen Subject: [PATCH v3 04/13] drm: zynqmp_dp: Adjust training values per-lane Date: Mon, 22 Apr 2024 14:45:44 -0400 Message-Id: <20240422184553.3573009-5-sean.anderson@linux.dev> In-Reply-To: <20240422184553.3573009-1-sean.anderson@linux.dev> References: <20240422184553.3573009-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 Reviewed-by: Tomi Valkeinen --- (no changes since v1) 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