brcm2708: update linux 4.4 patches to latest version
[openwrt/staging/wigyori.git] / target / linux / brcm2708 / patches-4.4 / 0469-drm-vc4-Replace-HDMI-force-connected-with-an-EDID-pr.patch
1 From 24e0c9aecebc158105c71f5f17b54a66c88c30f6 Mon Sep 17 00:00:00 2001
2 From: Eric Anholt <eric@anholt.net>
3 Date: Fri, 12 Aug 2016 10:57:41 -0700
4 Subject: [PATCH] drm/vc4: Replace HDMI force-connected with an EDID probe.
5
6 The force-connected started out because I didn't know how to read the
7 HPD pin successfully, which required the hpd_active_low check and
8 getting the correct active level into the DTs. It stayed because we
9 don't have the Pi3's HPD line exposed to Linux, so this was the only
10 way to bring up graphics on it.
11
12 However, with the DSI panel support now present, users want to be able
13 to run DSI-only systems, and forcing HDMI on is interfering with
14 default screen configurations. Work around the Pi3's missing HPD by
15 probing the DDC on I2C and see if it's present at all.
16
17 Signed-off-by: Eric Anholt <eric@anholt.net>
18 ---
19 drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +++--
20 1 file changed, 3 insertions(+), 2 deletions(-)
21
22 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
23 +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
24 @@ -166,8 +166,6 @@ vc4_hdmi_connector_detect(struct drm_con
25 struct drm_device *dev = connector->dev;
26 struct vc4_dev *vc4 = to_vc4_dev(dev);
27
28 - return connector_status_connected;
29 -
30 if (vc4->hdmi->hpd_gpio) {
31 if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^
32 vc4->hdmi->hpd_active_low)
33 @@ -176,6 +174,9 @@ vc4_hdmi_connector_detect(struct drm_con
34 return connector_status_disconnected;
35 }
36
37 + if (drm_probe_ddc(vc4->hdmi->ddc))
38 + return connector_status_connected;
39 +
40 if (HDMI_READ(VC4_HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED)
41 return connector_status_connected;
42 else