aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/bcm27xx/patches-5.10/950-0601-drm-vc4-hdmi-Rely-on-interrupts-to-handle-hotplug.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 10:54:34 +0200
committerÁlvaro Fernández Rojas <noltari@gmail.com>2021-08-21 19:07:07 +0200
commit8299d1f057439f94c6a4412e2e5c5082b82a30c9 (patch)
tree1bf678d61f11f7394493be464c7876e496f7faed /target/linux/bcm27xx/patches-5.10/950-0601-drm-vc4-hdmi-Rely-on-interrupts-to-handle-hotplug.patch
parent33b6885975ce376ff075362b7f0890326043111b (diff)
downloadupstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.gz
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.tar.bz2
upstream-8299d1f057439f94c6a4412e2e5c5082b82a30c9.zip
bcm27xx: add kernel 5.10 support
Rebased RPi foundation patches on linux 5.10.59, removed applied and reverted patches, wireless patches and defconfig patches. bcm2708: boot tested on RPi B+ v1.2 bcm2709: boot tested on RPi 4B v1.1 4G bcm2711: boot tested on RPi 4B v1.1 4G Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm27xx/patches-5.10/950-0601-drm-vc4-hdmi-Rely-on-interrupts-to-handle-hotplug.patch')
-rw-r--r--target/linux/bcm27xx/patches-5.10/950-0601-drm-vc4-hdmi-Rely-on-interrupts-to-handle-hotplug.patch78
1 files changed, 78 insertions, 0 deletions
diff --git a/target/linux/bcm27xx/patches-5.10/950-0601-drm-vc4-hdmi-Rely-on-interrupts-to-handle-hotplug.patch b/target/linux/bcm27xx/patches-5.10/950-0601-drm-vc4-hdmi-Rely-on-interrupts-to-handle-hotplug.patch
new file mode 100644
index 0000000000..6f0c4fa930
--- /dev/null
+++ b/target/linux/bcm27xx/patches-5.10/950-0601-drm-vc4-hdmi-Rely-on-interrupts-to-handle-hotplug.patch
@@ -0,0 +1,78 @@
+From 263d69b2c6ff1d1de6c3788d1b01760d4a1ebd9d Mon Sep 17 00:00:00 2001
+From: Maxime Ripard <maxime@cerno.tech>
+Date: Thu, 29 Apr 2021 11:08:52 +0200
+Subject: [PATCH] drm/vc4: hdmi: Rely on interrupts to handle hotplug
+
+DRM currently polls for the HDMI connector status every 10s, which can
+be an issue when we connect/disconnect a display quickly or the device
+on the other end only issues a hotplug pulse (for example on EDID
+change).
+
+Switch the driver to rely on the internal controller logic for the
+BCM2711/RPi4.
+
+Signed-off-by: Maxime Ripard <maxime@cerno.tech>
+---
+ drivers/gpu/drm/vc4/vc4_hdmi.c | 44 ++++++++++++++++++++++++++++++++++
+ 1 file changed, 44 insertions(+)
+
+--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
++++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
+@@ -1689,6 +1689,46 @@ static int vc4_hdmi_audio_init(struct vc
+
+ }
+
++static irqreturn_t vc4_hdmi_hpd_irq_thread(int irq, void *priv)
++{
++ struct vc4_hdmi *vc4_hdmi = priv;
++ struct drm_device *dev = vc4_hdmi->connector.dev;
++
++ if (dev)
++ drm_kms_helper_hotplug_event(dev);
++
++ return IRQ_HANDLED;
++}
++
++static int vc4_hdmi_hotplug_init(struct vc4_hdmi *vc4_hdmi)
++{
++ struct platform_device *pdev = vc4_hdmi->pdev;
++ struct device *dev = &pdev->dev;
++ int ret;
++
++ if (vc4_hdmi->variant->external_irq_controller) {
++ ret = devm_request_threaded_irq(dev,
++ platform_get_irq_byname(pdev, "hpd-connected"),
++ NULL,
++ vc4_hdmi_hpd_irq_thread, IRQF_ONESHOT,
++ "vc4 hdmi hpd connected", vc4_hdmi);
++ if (ret)
++ return ret;
++
++ ret = devm_request_threaded_irq(dev,
++ platform_get_irq_byname(pdev, "hpd-removed"),
++ NULL,
++ vc4_hdmi_hpd_irq_thread, IRQF_ONESHOT,
++ "vc4 hdmi hpd disconnected", vc4_hdmi);
++ if (ret)
++ return ret;
++
++ connector->polled = DRM_CONNECTOR_POLL_HPD;
++ }
++
++ return 0;
++}
++
+ #ifdef CONFIG_DRM_VC4_HDMI_CEC
+ static irqreturn_t vc4_cec_irq_handler_rx_thread(int irq, void *priv)
+ {
+@@ -2303,6 +2343,10 @@ static int vc4_hdmi_bind(struct device *
+ if (ret)
+ goto err_destroy_encoder;
+
++ ret = vc4_hdmi_hotplug_init(vc4_hdmi);
++ if (ret)
++ goto err_destroy_conn;
++
+ ret = vc4_hdmi_cec_init(vc4_hdmi);
+ if (ret)
+ goto err_destroy_conn;