Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2428724imj; Mon, 18 Feb 2019 05:57:39 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib8buO+5myDZ17UG0OIezBZwvxDwHEnxpfftmwvrI0g3QzezCwMNjVEw+jxIBlLyOxQSVRy X-Received: by 2002:a65:654d:: with SMTP id a13mr19221190pgw.320.1550498258976; Mon, 18 Feb 2019 05:57:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550498258; cv=none; d=google.com; s=arc-20160816; b=c/gRuFTgY72pgy6fhzB7gg1HW6PP2kTHVSwNtPjcc5K7EZ/RngbEEIYc9ABo6FetbC PGOvKRGoicpCnttnk9hhqRlBw9kWwMynevUVvN5rtN1ctbmH/ytUaFh3yKlmzF966DbN XyA4tfUGBdW46+iDRvIu7DqHaDp8sfZeOh7nelYpf6HmW2MNd7ryyydsWDeOsK0rhfpA RFlnrj+eMldGpURyJlfPt7ppyZ4+QMS9/r08U3ra3z86BKDazXXHwCmwQNm/Du/zIqM0 h+RnqlVLCGH51/BrIUeODPykSMVoVBHI/2B5HWvt5N0i3jiV8j8ToNTqEeMNg6nHv4OS MxhQ== 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=YNNow4Y/1f3BvEqXOYdDBkndA8F9U3yZ+dOmmZ2OXsQ=; b=PILKyLDXuqQI4pVQtoBJFT5sHXo9Q3Fjr887BU85Xz4H3QQy4GlaJuU/7rZzCYoydT w9AGeH4zlXmkuoeO1tEbQHmOZavZkQrwGNu5G1A4+QyiVO2v0/JBcjxOUQGKYWHl6G6u 6RtGtAaeyLuuhOCCfksPY6dCSRCVqpbYc+RIY+A3axpcdtE70mAtC435oBw0By8rclh1 qHzVHKouZpMwPDHo6TbKALB1FnGkchSFbgYddWX0bTHR2s7Xty+AFB/Slih//RKo9CLM ei0I4B8MIyC1cWaoHrcdtH6igrQZOc1Vk3oLt3FcpfNTtpjNgCyXtY9UHYg7v8ljOD4/ ztjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u+lc3mNB; 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 b17si11219989pfc.0.2019.02.18.05.57.23; Mon, 18 Feb 2019 05:57:38 -0800 (PST) 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=u+lc3mNB; 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 S2387803AbfBRN43 (ORCPT + 99 others); Mon, 18 Feb 2019 08:56:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:36622 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731605AbfBRN40 (ORCPT ); Mon, 18 Feb 2019 08:56:26 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.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 85B692077B; Mon, 18 Feb 2019 13:56:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550498186; bh=ohsIW6zQ/cdIRurcypAawJ+EmnUbDKAiLDjusAxAOLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u+lc3mNB/GRZfE7euTf+R7uw32ehioAikcXNNdDn3BPEaRDLivctIr01+5g7zItI7 A6s2SU4z00KxL+/E0JI4lNi5EoFrRkGoCqDRudSkyPeu0gOqI0sRktuLTO3GRL6I0u Sf3jSLup/DzHPfOtzd+Ij+ZoTk+09Jkr4jlUNRuo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tomi Valkeinen , Andrzej Hajda , Sasha Levin Subject: [PATCH 4.14 30/62] drm/bridge: tc358767: reject modes which require too much BW Date: Mon, 18 Feb 2019 14:43:36 +0100 Message-Id: <20190218133508.539016488@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190218133505.801423074@linuxfoundation.org> References: <20190218133505.801423074@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 51b9e62eb6950c762162ab7eb8390990179be067 ] The current driver accepts any videomode with pclk < 154MHz. This is not correct, as with 1 lane and/or 1.62Mbps speed not all videomodes can be supported. Add code to reject modes that require more bandwidth that is available. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-6-tomi.valkeinen@ti.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/tc358767.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index 24bb6bfa36f3..792a2548d3bb 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -1112,10 +1112,20 @@ static bool tc_bridge_mode_fixup(struct drm_bridge *bridge, static int tc_connector_mode_valid(struct drm_connector *connector, struct drm_display_mode *mode) { + struct tc_data *tc = connector_to_tc(connector); + u32 req, avail; + u32 bits_per_pixel = 24; + /* DPI interface clock limitation: upto 154 MHz */ if (mode->clock > 154000) return MODE_CLOCK_HIGH; + req = mode->clock * bits_per_pixel / 8; + avail = tc->link.base.num_lanes * tc->link.base.rate; + + if (req > avail) + return MODE_BAD; + return MODE_OK; } -- 2.19.1