Received: by 2002:ab2:6486:0:b0:1ef:eae8:a797 with SMTP id de6csp80297lqb; Fri, 15 Mar 2024 16:10:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX1NXgAXpUzxIU/JX3s58fHu7PJFQkpXqyyGFEh6k4+Gr0QWVsArzY3QCm1YItxbwUSMw0kaCI1YOuuZhNXO41AoeLsilYUzQi9NeH8ZQ== X-Google-Smtp-Source: AGHT+IE6uYHpg+4p/tRc4Zll2xrWONClKEam6aMV7k8wn+azpiPDlPUM4hfqF8Eey7sVX/jgSZja X-Received: by 2002:a05:6359:a3a4:b0:17c:33dd:9d3e with SMTP id ky36-20020a056359a3a400b0017c33dd9d3emr8366470rwc.10.1710544202251; Fri, 15 Mar 2024 16:10:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710544202; cv=pass; d=google.com; s=arc-20160816; b=gHzo7k6Cj2H3QbXnv7l37XbTjyqhH6jihnjunpW1um6Bz5cogkcHm9Pe9V1YdHssDT HCw7QBl2b+AxkCakoWEM8iKIbjLVBzEL+X7/+kUulAIs91Ajg0DaLOVlfxinHhONcH25 V5m0MkGoksKhMZTM7/Yq/ZvVB+qz02MFb8Yn0TfEhRctgT61aorrwZjYqCb7fF8qMFMW NeisPeLvrkLT9+pt/kWO9IhU7BXXoo2Tt76eKeprm4WxtR4vATPL/PuHXDGmEL367laT ntkiDlUWe05LGRGuRuqBoHM3di/3O4Xvg8Zlvw7NAzoe2tEEyYiSY+sWmxmwY1o+kga9 Ldog== 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=R2Qeb73E854SLNNqpfgzZuZinTfxWG3SchDvt92uTCI=; fh=3EK1Auh52aSLm3jgaMdARUrTIJHvAhMJYuW+2Jaood0=; b=JeAcrDYj6uRjG+yaNenYkGn0uXypAl4s6k7z8i6FRBQqNG6BjwBpANYioyPimZEWFC PTsP4fIiFz5CxZtmiH0b+0jm91/Klp6eQ+OjjF3N+4k+ZTyDMFqKWbAV0EscfI3GPbt1 W9EQvVmAefIQt2h8tmIfMG3mnxCf1kmHjabIfB7fJIVrYh19xyhHP7Cl7jCXPM4r1wMS 6vLf1zEqWoD6m+l0Yi8r637hn/Jozg0dH+/Uy6j1K3BsjmVSb0Dsf2He9r+rykLl8btr dRdRBb2ltqUS0mwpGet2sc1A6HPCbX6NFLWjDnFch1KseN5vzSTMLxIS0RnwVsFWpFnN AciQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=KsbOkTNZ; 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-104978-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104978-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id p30-20020a635b1e000000b005dcbb6b06bbsi3442943pgb.292.2024.03.15.16.10.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Mar 2024 16:10:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-104978-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=KsbOkTNZ; 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-104978-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-104978-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id E57AC28385D for ; Fri, 15 Mar 2024 23:10:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A72F95B5BD; Fri, 15 Mar 2024 23:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="KsbOkTNZ" 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 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: 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 --- 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