From patchwork Thu Oct 24 16:45:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11210297 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7B25F13B1 for ; Thu, 24 Oct 2019 16:46:38 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 634AC21906 for ; Thu, 24 Oct 2019 16:46:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 634AC21906 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B9C7E6E504; Thu, 24 Oct 2019 16:46:32 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D87E6E4D4 for ; Thu, 24 Oct 2019 16:46:25 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id q130so3103407wme.2 for ; Thu, 24 Oct 2019 09:46:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B2W0FUjPFjz/awt2KiXk3+qz+ONZRc0nBTwMiyV54YE=; b=rqH4GmvsLwBM+LGgTZtwPjtZT9wYTL1/VD8zs+/qjXLlYdcAQZCCJv1IbHtc2v1jjP bBcQaN8SrdyFoGipP50OSW6MDtKexHXafLMyJSQKCrI6L8NWYo24LPDF6vaYdsPA+U7X 9gxSufSc+RJN/CuT8G7OklQIykFklOYyDmvD7NwHx2za6TCCHRvTJUltkiGXlnkPKQrQ Ite/hyGpq/cWCtmNFruoRYVp6f3Exq939rYyEOM1iYJYM/9rZyg5OnpJ6NLM/JYyerjX 6+HAu2MgRJyCpaNh+Z7+74pqq7rrWk/qhmnwqQWBAH6749gbnuG+XpjlV2g5sEkPucRQ 0jyQ== X-Gm-Message-State: APjAAAWH2f/c+l5La8mM4BejkbPFCU0m6pojjib8NHJji0FwCbriUTcR PoQxxJDq/MH+WVwKVspkiBk= X-Google-Smtp-Source: APXvYqxRLZqfWu7td7gUGEzqcirQWei2SphFbGYqxcMNzUSvJoh7xEu7DmzUZV66IsIrwU9mrFFljQ== X-Received: by 2002:a05:600c:22ce:: with SMTP id 14mr5564498wmg.71.1571935582454; Thu, 24 Oct 2019 09:46:22 -0700 (PDT) Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) by smtp.gmail.com with ESMTPSA id 1sm8264544wrr.16.2019.10.24.09.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 09:46:21 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH 20/32] drm/tegra: sor: Filter eDP rates Date: Thu, 24 Oct 2019 18:45:22 +0200 Message-Id: <20191024164534.132764-21-thierry.reding@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191024164534.132764-1-thierry.reding@gmail.com> References: <20191024164534.132764-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B2W0FUjPFjz/awt2KiXk3+qz+ONZRc0nBTwMiyV54YE=; b=Q7lVozVpvsSTvFjEghbOMjRYPRm8HJdTP4vBJd8u6LuWruyy4l/JjXD0mDO4V75JPb KD4qjgDfkz4FRnzJEsFdApLQ88eHvMgjPcggfqoeb2GbHLH92tEzAvc8eQCzZru295bD svNytTmSU+TjO3HzO7H+MPF02EepoF1gMro+cttUch/03GmbLCH3OkeIYlSwYdZVKzdC 42pTM4N0Ws0Y7AFWX5xNx6cFCyVw8e/iroQCQQeP5qg5nk9z+9Y7hW+zhjwfDVV3CPYG N4siyklA0c2LjZsT3j4EL4A1r4wsoEinLmljbD7PQVVLYWnEmIadE84Qz0Q5IkeJ9Qf+ uUNw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding The SOR found on Tegra SoCs does not support all the rates potentially advertised by eDP 1.4. Make sure that the rates that are not supported are filtered out. Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/sor.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 2023244ad328..9e6a1ab7ef65 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -605,6 +605,30 @@ static struct clk *tegra_clk_sor_pad_register(struct tegra_sor *sor, return clk; } +static void tegra_sor_filter_rates(struct tegra_sor *sor) +{ + struct drm_dp_link *link = &sor->link; + unsigned int i; + + /* Tegra only supports RBR, HBR and HBR2 */ + for (i = 0; i < link->num_rates; i++) { + switch (link->rates[i]) { + case 1620000: + case 2700000: + case 5400000: + break; + + default: + DRM_DEBUG_KMS("link rate %lu kHz not supported\n", + link->rates[i]); + link->rates[i] = 0; + break; + } + } + + drm_dp_link_update_rates(link); +} + static int tegra_sor_power_up_lanes(struct tegra_sor *sor, unsigned int lanes) { unsigned long timeout; @@ -1897,6 +1921,8 @@ static void tegra_sor_edp_enable(struct drm_encoder *encoder) if (err < 0) dev_err(sor->dev, "failed to probe eDP link: %d\n", err); + tegra_sor_filter_rates(sor); + err = drm_dp_link_choose(&sor->link, mode, info); if (err < 0) dev_err(sor->dev, "failed to choose link: %d\n", err);