Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp2479946lqt; Mon, 22 Apr 2024 11:52:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVFvqXE5w5ODrmOM1kV2tIY5juwoUVI+f/tB2jquBm8o/5mPM5NVcTmDZ0QnuiSG4Qe3Aq9Es0sktgc0O1jVFv+wZj50exURZeC14nSbw== X-Google-Smtp-Source: AGHT+IFlIS/qiQ3kCwWUTATiMdoPVcXbMshKQydQJXm3UHduv/EDC6cUwKUc1Oe0Si5gIPxXM/b2 X-Received: by 2002:a05:6870:a799:b0:235:3d0:2bd4 with SMTP id x25-20020a056870a79900b0023503d02bd4mr13185854oao.31.1713811970543; Mon, 22 Apr 2024 11:52:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713811970; cv=pass; d=google.com; s=arc-20160816; b=oP9lBcP3/Jwp2g6HnvvFLMFCYrnZHhp33aGUAWVKmnOanF/I7GnIML3IRGEjd+pzyU tEYQraT3gjFukMvTMuZ7otI9vZZ41F31R1QP8fqmEcSadbUlX+IBfW2+URQW1RQx9NjV t4GODUVSvCojP//C4E6lgk/KE1OOdQ1YJ0BIDRKOBqejV1bdhK/DTqA64qHHzIZ9Cwl0 odt9+QNACuWn9nc6UYJbsjmFhnALDtDVWFE7AkmfXSG5x5Xtg6PLfm7lvVT9jmmsQpLC oWtm1yf2cbVvJ68xPE8oQEWFuoZovlNhy2nwRd0/8ighABYYESIweLIAGW0h+HhqXLeH dcxw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=5nrF6VDUIPcZsD4wFuWM8MT9Kja3bZUkY7wxu3RiboM=; fh=3r1arNYgv7QEwd0QV3w8a3IWeT6TRoRmM3gOl1i9Hac=; b=ApzjI66UmRe25zWnteO8QR+QtxkOGloeKxEQucEwW+B20qjstP/KrLBJwd4g1o7BWy Tckg/EdTwq9lF2gpev9VH9AgfhyGWmYq2ry5YSJd6u9zgyr+24mFAiNaKvlXHOuo8yZm JRtTpAL/HENHZJ6J0ZxkSB6OkiDx2mBJM8hN84X+6r4hsBaz7Pt4ml7mgesbrpL6k4oI CQptIdSg3j3xLmcCCzqZRiDNv3a5lHbegz7LShXLejgUeH2evTvlel/ej2CU0jRBwPtv EUuVXF89f3tjM8QmyqLuVlU9ZTu4s5l5HUkmIZq9Xw/oLF+fBk9VmAN+LkjTCa/Fr2Er Xm9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kZuQ4Ylo; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-153860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153860-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id i17-20020a632211000000b005e858f5a418si8048885pgi.808.2024.04.22.11.52.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Apr 2024 11:52:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-153860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=kZuQ4Ylo; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-153860-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-153860-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id B7508B241EC for ; Mon, 22 Apr 2024 18:47:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 68479155A46; Mon, 22 Apr 2024 18:46:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="kZuQ4Ylo" 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 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: 8bit X-Migadu-Flow: FLOW_OUT 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 = dp->train_set; - u8 voltage = 0, preemphasis = 0; u8 i; for (i = 0; i < dp->mode.lane_cnt; i++) { - u8 v = drm_dp_get_adjust_request_voltage(link_status, i); - u8 p = drm_dp_get_adjust_request_pre_emphasis(link_status, i); + u8 voltage = drm_dp_get_adjust_request_voltage(link_status, i); + u8 preemphasis = + drm_dp_get_adjust_request_pre_emphasis(link_status, i); - if (v > voltage) - voltage = v; + if (voltage >= DP_TRAIN_VOLTAGE_SWING_LEVEL_3) + voltage |= DP_TRAIN_MAX_SWING_REACHED; - if (p > preemphasis) - preemphasis = p; - } + if (preemphasis >= DP_TRAIN_PRE_EMPH_LEVEL_2) + preemphasis |= DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; - if (voltage >= DP_TRAIN_VOLTAGE_SWING_LEVEL_3) - voltage |= DP_TRAIN_MAX_SWING_REACHED; - - if (preemphasis >= DP_TRAIN_PRE_EMPH_LEVEL_2) - preemphasis |= DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; - - for (i = 0; i < dp->mode.lane_cnt; i++) train_set[i] = voltage | preemphasis; + } } /** -- 2.35.1.1320.gc452695387.dirty