Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3104508lqt; Tue, 23 Apr 2024 10:20:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXKComqK5JCXij6kWupSaZJ4T2ldJE6Y9RyHYWz4RLnw7s9RZJWSjxnFjp5ponJM6Wt9LppmRAUZINTD9DWtPJKG1YXQeSMEQtsPSQtjw== X-Google-Smtp-Source: AGHT+IHBx4KUZzirJwJxJehQvQkjnNia7O/62zsutNX448tHiXhn2jDnt8R3EdU+FNW8t7KyvSA3 X-Received: by 2002:a17:903:22c4:b0:1e4:47bf:6926 with SMTP id y4-20020a17090322c400b001e447bf6926mr149966plg.4.1713892856438; Tue, 23 Apr 2024 10:20:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713892856; cv=pass; d=google.com; s=arc-20160816; b=rB9jhbo8Yz+3fdBBKn90QdRrnHhGRkJFkLSvGGvCT3CutdH19cduJjSozooVOviA3d q51JzRXEqWiDyTvOzbFkuqcfJmW56Md8BAjvKcISHLPWGpjXSYCy88M5//2iLroLEMNd 2wT7JHW5otZWua4b2NwMyuCFsblWFWC04ymZMGMD+7H39boRWw/8oymJ4hg3dvdOe0iS um1xqg7fh7UzweGDeJ/Zt6aQKO9k2ccVcw8Uk6qPQ6bBNyDGh+bQ1a54FvO03dyvJSLa Sy24QG6uJWt6o89arWvX5LpEMo2EL8de6vSfkz7pjA0dV8wo46Lre7UTCMnd2JbIc6uy 82Pg== 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=fefHnXEFrbmBIUDCc82fL50d6Bt9DvNDq0SHN2U6tZQ=; fh=y/ZWbFXBmP32xuuB2aPYQ037wxAyEGcK3dXjHSf7t2w=; b=oOn1KgEQtfEe9fN1Pb0JcpcODXQolWXRcjnH+DcPkLPGkvLD/QYKtCW3bsoSlXQ6Mr B2lG0sQBpsSoTWu3KXk5bJwxeGXgAGF1CZfDgUTGo/aUHfOhAko8tMjEB8b+AzFsi7/5 kismY8V+qCOJGHPiyjnxGpp/1GRN0UFR00AXPhVOkP2AyN1OeWDxVncbDb57rGof+0Rs 0tjPEpvO6O/eIfLOkq9J8J7Ku9/dOATfKbx7SB9/D3E/iw9lqtBxkov2U46LW4sTTfzQ 7EqiWX21e9Y0eOazyLD9MdMP7FF8UqdtFF2jAWUlhUE+0UVAC53or3HJLxFqUgKnUObZ /zQA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=LLTjMLGe; 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-155653-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155653-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 q5-20020a17090311c500b001e26423844csi10290383plh.59.2024.04.23.10.20.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 10:20:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-155653-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=LLTjMLGe; 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-155653-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-155653-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 48DD22844E4 for ; Tue, 23 Apr 2024 17:20:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0B77013D8BB; Tue, 23 Apr 2024 17:19:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="LLTjMLGe" Received: from out-172.mta0.migadu.com (out-172.mta0.migadu.com [91.218.175.172]) (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 BC47213E40E for ; Tue, 23 Apr 2024 17:19:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713892762; cv=none; b=s5GmV7vFmCLtIaOX+EpG7PLrs5BrBEHFbYF+D3Y1LC6sMjaXbQ3gvjd8AQWNQRKGZYVo46rdu4giK7wQJLJAqOV9IyXJUTR8ysXyZprG17cYPMqn4lWgVk+XfrHu4kGlmpfeg2jcWqyOCz8CqARc4hzpcecZ32o3k4E5AjtQJYU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713892762; c=relaxed/simple; bh=fjb4FrppOIo0qcDq2yb6XcO5NxeNrkDyh1kECq7BnMs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FLnK77U2qn9H7EYsVTzvoVbw3BjA8I7WfYDuYES8CMj27hdwnFBSLPBuFdb7JCEuexgKXKJu5nWWGA4alYT3b25miiEDpn2nYhHcMsB7GJpvieEB0ZtxjsQjCIdhVYomEnt0QsOPp360OtH65KO6G7nfKG2Bo5xC1I2zf6+mZdQ= 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=LLTjMLGe; arc=none smtp.client-ip=91.218.175.172 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=1713892757; 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=fefHnXEFrbmBIUDCc82fL50d6Bt9DvNDq0SHN2U6tZQ=; b=LLTjMLGenW1CYv4kPsXi6igBzHxp//fCs1p9Rq24+X5yiYSr5lmkAaU7S3XVGFvysVuDpu ZrCa1oLi58iTV+PXbWKKQfiyKHQ63VhpF0C4FEDV5PPlGhq6HTDV0crLVoytpj6JlnPl2I xuv+M9q6XOVQjBc5FsEHPQMy52A+H6M= From: Sean Anderson To: Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org Cc: Daniel Vetter , linux-arm-kernel@lists.infradead.org, Michal Simek , linux-kernel@vger.kernel.org, David Airlie , Tomi Valkeinen , Sean Anderson Subject: [PATCH v4 04/13] drm: zynqmp_dp: Adjust training values per-lane Date: Tue, 23 Apr 2024 13:18:50 -0400 Message-Id: <20240423171859.3953024-5-sean.anderson@linux.dev> In-Reply-To: <20240423171859.3953024-1-sean.anderson@linux.dev> References: <20240423171859.3953024-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 fdea1a9710de..79afe4358d06 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