summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Robinson <pbrobinson@gmail.com>2020-04-03 12:42:34 +0100
committerPeter Robinson <pbrobinson@gmail.com>2020-04-03 12:42:34 +0100
commit49ac3a29168c35996898d1ea3feee70d4d0952aa (patch)
tree04cbd3c256420ba9baf7ff59abfed476c0fe67b9
parenta17a09f6bc6562051c5cc9f0161d0d929b552cf3 (diff)
downloadkernel-49ac3a29168c35996898d1ea3feee70d4d0952aa.tar.gz
kernel-49ac3a29168c35996898d1ea3feee70d4d0952aa.tar.xz
kernel-49ac3a29168c35996898d1ea3feee70d4d0952aa.zip
Raspberry Pi HDMI mode validation fix
-rw-r--r--drm-vc4-Fix-HDMI-mode-validation.patch65
-rw-r--r--kernel.spec5
2 files changed, 70 insertions, 0 deletions
diff --git a/drm-vc4-Fix-HDMI-mode-validation.patch b/drm-vc4-Fix-HDMI-mode-validation.patch
new file mode 100644
index 000000000..224c8fa27
--- /dev/null
+++ b/drm-vc4-Fix-HDMI-mode-validation.patch
@@ -0,0 +1,65 @@
+From patchwork Thu Mar 26 12:20:01 2020
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: drm/vc4: Fix HDMI mode validation
+From: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+X-Patchwork-Id: 358980
+Message-Id: <20200326122001.22215-1-nsaenzjulienne@suse.de>
+To: Eric Anholt <eric@anholt.net>,
+ Daniel Vetter <daniel.vetter@ffwll.ch>
+Cc: Stefan Wahren <stefan.wahren@i2se.com>, f.fainelli@gmail.com,
+ Dave Stevenson <dave.stevenson@raspberrypi.com>,
+ David Airlie <airlied@linux.ie>, linux-kernel@vger.kernel.org,
+ dri-devel@lists.freedesktop.org, maxime@cerno.tech,
+ Nicolas Saenz Julienne <nsaenzjulienne@suse.de>,
+ linux-rpi-kernel@lists.infradead.org
+Date: Thu, 26 Mar 2020 13:20:01 +0100
+
+Current mode validation impedes setting up some video modes which should
+be supported otherwise. Namely 1920x1200@60Hz.
+
+Fix this by lowering the minimum HDMI state machine clock to pixel clock
+ratio allowed.
+
+Fixes: 32e823c63e90 ("drm/vc4: Reject HDMI modes with too high of clocks")
+Reported-by: Stefan Wahren <stefan.wahren@i2se.com>
+Suggested-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
+Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
+Reviewed-by: Maxime Ripard <mripard@kernel.org>
+---
+ drivers/gpu/drm/vc4/vc4_hdmi.c | 20 ++++++++++++++++----
+ 1 file changed, 16 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
+index cea18dc15f77..340719238753 100644
+--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
+@@ -681,11 +681,23 @@ static enum drm_mode_status
+ vc4_hdmi_encoder_mode_valid(struct drm_encoder *crtc,
+ const struct drm_display_mode *mode)
+ {
+- /* HSM clock must be 108% of the pixel clock. Additionally,
+- * the AXI clock needs to be at least 25% of pixel clock, but
+- * HSM ends up being the limiting factor.
++ /*
++ * As stated in RPi's vc4 firmware "HDMI state machine (HSM) clock must
++ * be faster than pixel clock, infinitesimally faster, tested in
++ * simulation. Otherwise, exact value is unimportant for HDMI
++ * operation." This conflicts with bcm2835's vc4 documentation, which
++ * states HSM's clock has to be at least 108% of the pixel clock.
++ *
++ * Real life tests reveal that vc4's firmware statement holds up, and
++ * users are able to use pixel clocks closer to HSM's, namely for
++ * 1920x1200@60Hz. So it was decided to have leave a 1% margin between
++ * both clocks. Which, for RPi0-3 implies a maximum pixel clock of
++ * 162MHz.
++ *
++ * Additionally, the AXI clock needs to be at least 25% of
++ * pixel clock, but HSM ends up being the limiting factor.
+ */
+- if (mode->clock > HSM_CLOCK_FREQ / (1000 * 108 / 100))
++ if (mode->clock > HSM_CLOCK_FREQ / (1000 * 101 / 100))
+ return MODE_CLOCK_HIGH;
+
+ return MODE_OK;
diff --git a/kernel.spec b/kernel.spec
index 768f59205..281fc8849 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -828,6 +828,8 @@ Patch311: USB-pci-quirks-Add-Raspberry-Pi-4-quirk.patch
Patch312: bcm2835-irqchip-Quiesce-IRQs-left-enabled-by-bootloader.patch
# https://patchwork.kernel.org/patch/11420129/
Patch313: ARM-dts-bcm2711-Move-emmc2-into-its-own-bus.patch
+# https://patchwork.freedesktop.org/patch/358980/
+Patch314: drm-vc4-Fix-HDMI-mode-validation.patch
# Tegra bits
# https://www.spinics.net/lists/linux-tegra/msg48152.html
@@ -2993,6 +2995,9 @@ fi
#
#
%changelog
+* Fri Apr 3 2020 Peter Robinson <pbrobinson@fedoraproject.org>
+- Raspberry Pi HDMI mode validation fix
+
* Thu Apr 02 2020 Jeremy Cline <jcline@redhat.com> - 5.6.2-300
- Linux v5.6.2