From patchwork Fri Oct 30 16:47:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 7528201 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 377069F2F7 for ; Fri, 30 Oct 2015 16:47:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57C2A20776 for ; Fri, 30 Oct 2015 16:47:45 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 81E6820773 for ; Fri, 30 Oct 2015 16:47:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A2D56ED17; Fri, 30 Oct 2015 09:47:43 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id D95D76ED17 for ; Fri, 30 Oct 2015 09:47:40 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP; 30 Oct 2015 09:47:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,219,1444719600"; d="scan'208";a="838983872" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by orsmga002.jf.intel.com with SMTP; 30 Oct 2015 09:47:37 -0700 Received: by stinkbox (sSMTP sendmail emulation); Fri, 30 Oct 2015 18:47:36 +0200 From: ville.syrjala@linux.intel.com To: intel-gfx@lists.freedesktop.org Date: Fri, 30 Oct 2015 18:47:36 +0200 Message-Id: <1446223656-27792-1-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.4.10 MIME-Version: 1.0 Cc: Ander Conselvan de Oliveira Subject: [Intel-gfx] [PATCH] drm/i915: Fall back to zero vswing/preemph if the sink doesn't like the last good values X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ville Syrjälä My Lenovo STM STDP3100 miniDP->VGA dongle doesn't seem to like it when we try to start link training with non-zero vswing/preemphasis. So when the initial link training DPCD write fails, retry it with zero values. Fixes a bunch of errors like so: [drm:intel_dp_start_link_train [i915]] *ERROR* failed to enable link training Cc: Mika Kahola Cc: Sivakumar Thulasimani Cc: Ander Conselvan de Oliveira Fixes: 5fa836a9d859 ("drm/i915: DP link training optimization") Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_dp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index ba4cbf5..9529a6e 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -3750,10 +3750,17 @@ intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp) DP |= DP_PORT_EN; +again: /* clock recovery */ if (!intel_dp_reset_link_train(intel_dp, &DP, DP_TRAINING_PATTERN_1 | DP_LINK_SCRAMBLING_DISABLE)) { + if (intel_dp->train_set_valid) { + DRM_DEBUG_KMS("Sink rejected link training request, trying again with zero values\n"); + intel_dp->train_set_valid = false; + goto again; + } + DRM_ERROR("failed to enable link training\n"); return; }