0469-drm-vc4-Replace-HDMI-force-connected-with-an-EDID-pr.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. From 2a12837fa5ce42d748662fe8fcfd486df98a3513 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. The force-connected started out because I didn't know how to read the
  6. HPD pin successfully, which required the hpd_active_low check and
  7. getting the correct active level into the DTs. It stayed because we
  8. don't have the Pi3's HPD line exposed to Linux, so this was the only
  9. way to bring up graphics on it.
  10. However, with the DSI panel support now present, users want to be able
  11. to run DSI-only systems, and forcing HDMI on is interfering with
  12. default screen configurations. Work around the Pi3's missing HPD by
  13. probing the DDC on I2C and see if it's present at all.
  14. Signed-off-by: Eric Anholt <eric@anholt.net>
  15. ---
  16. drivers/gpu/drm/vc4/vc4_hdmi.c | 5 +++--
  17. 1 file changed, 3 insertions(+), 2 deletions(-)
  18. --- a/drivers/gpu/drm/vc4/vc4_hdmi.c
  19. +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
  20. @@ -166,8 +166,6 @@ vc4_hdmi_connector_detect(struct drm_con
  21. struct drm_device *dev = connector->dev;
  22. struct vc4_dev *vc4 = to_vc4_dev(dev);
  23. - return connector_status_connected;
  24. -
  25. if (vc4->hdmi->hpd_gpio) {
  26. if (gpio_get_value_cansleep(vc4->hdmi->hpd_gpio) ^
  27. vc4->hdmi->hpd_active_low)
  28. @@ -176,6 +174,9 @@ vc4_hdmi_connector_detect(struct drm_con
  29. return connector_status_disconnected;
  30. }
  31. + if (drm_probe_ddc(vc4->hdmi->ddc))
  32. + return connector_status_connected;
  33. +
  34. if (HDMI_READ(VC4_HDMI_HOTPLUG) & VC4_HDMI_HOTPLUG_CONNECTED)
  35. return connector_status_connected;
  36. else