Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7075963ybi; Thu, 13 Jun 2019 09:09:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqzbBXe+e9vzR+5vJufaBQv7nftYkamQeg18NWTuVeJ5ByxnYW4dd2unwNohYosQSsQC932T X-Received: by 2002:a17:90a:1ac5:: with SMTP id p63mr6279413pjp.25.1560442185517; Thu, 13 Jun 2019 09:09:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442185; cv=none; d=google.com; s=arc-20160816; b=eT2RTWGi4dd93QdnjcTwpE/q02UlZR346btTjbSv/HAdyiFTwVV3BthKCsvsgYQreV Ltm9ECDZUR/SuzGUoR9I9ll0uVO9cNnb5zNPK2XSAF22tM2ukm2DGZtAWY3X0NRYRYpz 85urFK5Si7CfXKh2DYs9H2UjeDozB4rdB4xIuE+g47ZEqsArdr5anhjNgkJLaESMlNcb ECVxiXZWi9XCjOs/04A0wsCIIP6D1V7li/1DmTFRZuBRKNg88NOLyT51MWKJcdfmecGU em7gIrq8I98NSIHqAdmBvwGXGQ5wvf/tO5sehYQowCQ1RtyVLc4nq6krLAvVGsNAyaHk 8EgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=JtPBhFf/yIxMa38Qt1b1qQOzSggcCfHVTpyxdTKxuDQ=; b=XXFFpk+WKhM+taZs1hGfVMNjg2gwSzPoBaxFBdXWmnaqykgAKW+wvXsBhiDX79DSP+ azlSMLoOo6dtvpVplmIj4KzJ678LRBbC7RpG2fyo3I5pz5GuMJ6OPuT2sbcdhfJSoI9f 9dNb7mww3VICnr112VtThkZo7CpS7tXEPWLnkCI03TqXp2oNrjq2ykzdlFrTP49nCSH5 XY7o9VShZC8wXXWcq1VYorsiHvLMaXPzOr1c5jL5R3VitBcma38jm2CQnHjNZrUZplVp IR1z4PY+s9igUG826+SovdTHtXL+r2Ey89P2/mrHN8mGUqyZ9/oj9fdbqt+5IJe9dl0V /GpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i+8S2E0G; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si93147pjt.70.2019.06.13.09.09.29; Thu, 13 Jun 2019 09:09:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=i+8S2E0G; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390701AbfFMQIM (ORCPT + 99 others); Thu, 13 Jun 2019 12:08:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:34008 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731293AbfFMIpQ (ORCPT ); Thu, 13 Jun 2019 04:45:16 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6FC5020851; Thu, 13 Jun 2019 08:45:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560415515; bh=RyQfi8PifalqsZTXPrVVALQ1aLa+4Pwc5y07uBkObAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=i+8S2E0Gr+a5W6xQ7ZEqFhD+poyJgE4wLMHm8cNdje6O0Alg36uGzudKMHzqqemZt EFEEhgptgRqbLpUjZ2OgE6aPKRx7iNTBTMH+xQd2CtHuDBmPMPD6UtZdZNySLALsDy g6SExICAZkt9b0UtU2glfJn2pOhPKA4RcTaefKf0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ben Skeggs , Sasha Levin Subject: [PATCH 5.1 029/155] drm/nouveau/disp/dp: respect sink limits when selecting failsafe link configuration Date: Thu, 13 Jun 2019 10:32:21 +0200 Message-Id: <20190613075654.544378169@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190613075652.691765927@linuxfoundation.org> References: <20190613075652.691765927@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 13d03e9daf70dab032c03dc172e75bb98ad899c4 ] Where possible, we want the failsafe link configuration (one which won't hang the OR during modeset because of not enough bandwidth for the mode) to also be supported by the sink. This prevents "link rate unsupported by sink" messages when link training fails. Signed-off-by: Ben Skeggs Signed-off-by: Sasha Levin --- drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c index 5f301e632599..818d21bd28d3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/disp/dp.c @@ -365,8 +365,15 @@ nvkm_dp_train(struct nvkm_dp *dp, u32 dataKBps) * and it's better to have a failed modeset than that. */ for (cfg = nvkm_dp_rates; cfg->rate; cfg++) { - if (cfg->nr <= outp_nr && cfg->nr <= outp_bw) - failsafe = cfg; + if (cfg->nr <= outp_nr && cfg->nr <= outp_bw) { + /* Try to respect sink limits too when selecting + * lowest link configuration. + */ + if (!failsafe || + (cfg->nr <= sink_nr && cfg->bw <= sink_bw)) + failsafe = cfg; + } + if (failsafe && cfg[1].rate < dataKBps) break; } -- 2.20.1