diff options
author | Mikko Perttunen <mperttunen@nvidia.com> | 2013-08-28 18:48:38 +0300 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2013-10-31 09:55:43 +0100 |
commit | 9f1591231aa72edd2cdad507520ad4088682262a (patch) | |
tree | 280d7b006694075d9e4c04d843d861a8d713431b | |
parent | 7d1d28aca08b974963feac19c05e0084e04db946 (diff) | |
download | blackbird-op-linux-9f1591231aa72edd2cdad507520ad4088682262a.tar.gz blackbird-op-linux-9f1591231aa72edd2cdad507520ad4088682262a.zip |
drm/tegra: hdmi: Detect DVI-only displays
Use EDID data to determine whether the display supports HDMI or DVI
only. The HDMI output used to assume to be connected to HDMI displays,
but that broke support for DVI displays that don't understand the
interspersed audio/other data.
To be on the safe side, default to DVI if no EDID data is available.
Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
[treding@nvidia.com: move detection to separate function]
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r-- | drivers/gpu/drm/tegra/hdmi.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c index ce32bfb7f86d..35a745a6a5ca 100644 --- a/drivers/gpu/drm/tegra/hdmi.c +++ b/drivers/gpu/drm/tegra/hdmi.c @@ -674,6 +674,18 @@ static void tegra_hdmi_setup_tmds(struct tegra_hdmi *hdmi, HDMI_NV_PDISP_SOR_IO_PEAK_CURRENT); } +static bool tegra_output_is_hdmi(struct tegra_output *output) +{ + struct edid *edid; + + if (!output->connector.edid_blob_ptr) + return false; + + edid = (struct edid *)output->connector.edid_blob_ptr->data; + + return drm_detect_hdmi_monitor(edid); +} + static int tegra_output_hdmi_enable(struct tegra_output *output) { unsigned int h_sync_width, h_front_porch, h_back_porch, i, rekey; @@ -686,6 +698,8 @@ static int tegra_output_hdmi_enable(struct tegra_output *output) int retries = 1000; int err; + hdmi->dvi = !tegra_output_is_hdmi(output); + pclk = mode->clock * 1000; h_sync_width = mode->hsync_end - mode->hsync_start; h_back_porch = mode->htotal - mode->hsync_end; |