Home Home > GIT Browse > SLE12-SP4-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-02-21 09:09:54 +0100
committerTakashi Iwai <tiwai@suse.de>2019-02-21 09:10:05 +0100
commit3ae509c5d9ae3f0b53356de60866f484f37d4cbf (patch)
tree8247130b40ba33699d591117a527db3d50debda5
parentf50a2104283924b0744911adee0a7d6b8270e2a4 (diff)
drm/bridge: tc358767: reject modes which require too much BW
(bsc#1051510).
-rw-r--r--patches.drm/drm-bridge-tc358767-reject-modes-which-require-too-m.patch47
-rw-r--r--series.conf1
2 files changed, 48 insertions, 0 deletions
diff --git a/patches.drm/drm-bridge-tc358767-reject-modes-which-require-too-m.patch b/patches.drm/drm-bridge-tc358767-reject-modes-which-require-too-m.patch
new file mode 100644
index 0000000000..7674711122
--- /dev/null
+++ b/patches.drm/drm-bridge-tc358767-reject-modes-which-require-too-m.patch
@@ -0,0 +1,47 @@
+From 51b9e62eb6950c762162ab7eb8390990179be067 Mon Sep 17 00:00:00 2001
+From: Tomi Valkeinen <tomi.valkeinen@ti.com>
+Date: Thu, 3 Jan 2019 13:59:52 +0200
+Subject: [PATCH] drm/bridge: tc358767: reject modes which require too much BW
+Git-commit: 51b9e62eb6950c762162ab7eb8390990179be067
+Patch-mainline: v5.0-rc2
+References: bsc#1051510
+
+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 <tomi.valkeinen@ti.com>
+Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
+Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
+Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-6-tomi.valkeinen@ti.com
+Acked-by: Takashi Iwai <tiwai@suse.de>
+
+---
+ drivers/gpu/drm/bridge/tc358767.c | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- 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
+ 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;
+ }
+
diff --git a/series.conf b/series.conf
index b04c5cbb42..1c7a14b507 100644
--- a/series.conf
+++ b/series.conf
@@ -20241,6 +20241,7 @@
patches.drm/drm-bridge-tc358767-add-defines-for-DP1_SRCCTRL-PHY_.patch
patches.drm/drm-bridge-tc358767-fix-single-lane-configuration.patch
patches.drm/drm-bridge-tc358767-fix-initial-DP0-1_SRCCTRL-value.patch
+ patches.drm/drm-bridge-tc358767-reject-modes-which-require-too-m.patch
patches.drivers/ACPI-power-Skip-duplicate-power-resource-references-.patch
patches.arch/x86-modpost-replace-last-remnants-of-retpoline-with-config_retpoline.patch
patches.fixes/rbd-don-t-return-0-on-unmap-if-rbd_dev_flag_removing-is-set.patch