From patchwork Tue Nov 24 10:42:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1405448 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CgLHQ6XBxz9sVN; Tue, 24 Nov 2020 21:44:18 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1khVny-0003Sr-0x; Tue, 24 Nov 2020 10:44:14 +0000 Received: from mail-pg1-f193.google.com ([209.85.215.193]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1khVnf-0003FQ-5d for kernel-team@lists.ubuntu.com; Tue, 24 Nov 2020 10:43:55 +0000 Received: by mail-pg1-f193.google.com with SMTP id m9so17108710pgb.4 for ; Tue, 24 Nov 2020 02:43:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YFxQhbav+FAM3TZlMTwxvQLeU77pVoLXUZ3L49ikRcI=; b=ZZy6ZQkBCDjUKXDv/gwKf+JYhGQMgQc/zgTyEgg660dXukzPackqiFR85+hzezkMIz dX5krRuLWYug8afKtkSlIH141FFXt5hG8z4yKQMdWVKGqmd7PvVL5jIcXCGLkb+4Timi KMqhetkzUe7kEx8z9RZ8YeY3ePyf+YiQ6D2oAHIS4rVJRK10XshAiFpB7pAdcx/fgJua eNDBjTBZh1sB1H5srx3o3JSM33axflLwHLK0fyhfU8I2ezeVOvgRNqpAhoI8CoTMdbrW sDfWIgIg9ZyVIu0XVY3xDMjsJ639m1fnNypcrAs6GSZyTZm1bpo3cCnh0APiB/nMXoNk 1qLg== X-Gm-Message-State: AOAM533WDCxZUBoyfuNGuHqQuKnB16z+jL/gCOWRIwQ1ch2++rZuE0yf 0AZ8IEz0GXuQYV08CNKTKsnWCQvBkLpMOg== X-Google-Smtp-Source: ABdhPJxYV6mp3d3KB3F5McQOgJp8UGMKK9N3v5u4GTCeJtiNMvOfZP35unoKJecDkmDPCuwLW8qfvA== X-Received: by 2002:a63:1d55:: with SMTP id d21mr3161563pgm.324.1606214632084; Tue, 24 Nov 2020 02:43:52 -0800 (PST) Received: from localhost (61-220-137-37.HINET-IP.hinet.net. [61.220.137.37]) by smtp.gmail.com with ESMTPSA id t10sm14461325pfq.110.2020.11.24.02.43.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 02:43:51 -0800 (PST) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 14/38][SRU][G/H] drm/i915: Fix DP_TRAIN_MAX_{PRE_EMPHASIS, SWING}_REACHED handling Date: Tue, 24 Nov 2020 18:42:49 +0800 Message-Id: <20201124104313.421860-15-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201124104313.421860-1-vicamo.yang@canonical.com> References: <20201124104313.421860-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.215.193; envelope-from=vicamo@gmail.com; helo=mail-pg1-f193.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Ville Syrjälä BugLink: https://bugs.launchpad.net/bugs/1903969 The DP spec says: "The transmitter shall support at least three levels of voltage swing (Levels 0, 1, and 2). If only three levels of voltage swing are supported (VOLTAGE SWING SET field (bits 1:0) are programmed to 10 (Level 2)), this bit shall be set to 1, and cleared in all other cases. If all four levels of voltage swing are supported (VOLTAGE SWING SET field (bits 1:0) are programmed to 11 (Level 3)), this bit shall be set to 1,and cleared in all other cases." Let's follow that exactly instead of the current apporach where we can set those also for vswing/preemph levels 0 or 1 (or 2 when the platform max is 3). Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20200512174145.3186-7-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak (cherry picked from commit 3625a1f5bf6ba47fbd903be1d63dade9a48e8e72) Signed-off-by: You-Sheng Yang --- drivers/gpu/drm/i915/display/intel_dp_link_training.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c index b9e4ee2dbddc..2493142a70e9 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c +++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c @@ -67,8 +67,9 @@ void intel_dp_get_adjust_train(struct intel_dp *intel_dp, if (p >= preemph_max) p = preemph_max | DP_TRAIN_MAX_PRE_EMPHASIS_REACHED; - voltage_max = min(intel_dp->voltage_max(intel_dp), - dp_voltage_max(p)); + v = min(v, dp_voltage_max(p)); + + voltage_max = intel_dp->voltage_max(intel_dp); if (v >= voltage_max) v = voltage_max | DP_TRAIN_MAX_SWING_REACHED;