mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 05:34:13 +08:00
drm/i915: Require digital monitor on HDMI ports for detect
HDMI and DVI both require DDC/EDID on monitors, so use that to know when a monitor is connected as the hot-plug pins are shared with SDVO and DisplayPort Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
52dc7d32b8
commit
aa93d632c4
@ -31,6 +31,7 @@
|
||||
#include "drmP.h"
|
||||
#include "drm.h"
|
||||
#include "drm_crtc.h"
|
||||
#include "drm_edid.h"
|
||||
#include "intel_drv.h"
|
||||
#include "i915_drm.h"
|
||||
#include "i915_drv.h"
|
||||
@ -129,20 +130,26 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
intel_hdmi_sink_detect(struct drm_connector *connector)
|
||||
static enum drm_connector_status
|
||||
intel_hdmi_edid_detect(struct drm_connector *connector)
|
||||
{
|
||||
struct intel_output *intel_output = to_intel_output(connector);
|
||||
struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
|
||||
struct edid *edid = NULL;
|
||||
enum drm_connector_status status = connector_status_disconnected;
|
||||
|
||||
edid = drm_get_edid(&intel_output->base,
|
||||
&intel_output->ddc_bus->adapter);
|
||||
if (edid != NULL) {
|
||||
hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
|
||||
kfree(edid);
|
||||
hdmi_priv->has_hdmi_sink = false;
|
||||
if (edid) {
|
||||
if (edid->digital) {
|
||||
status = connector_status_connected;
|
||||
hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
|
||||
}
|
||||
intel_output->base.display_info.raw_edid = NULL;
|
||||
kfree(edid);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
@ -154,11 +161,7 @@ igdng_hdmi_detect(struct drm_connector *connector)
|
||||
/* FIXME hotplug detect */
|
||||
|
||||
hdmi_priv->has_hdmi_sink = false;
|
||||
intel_hdmi_sink_detect(connector);
|
||||
if (hdmi_priv->has_hdmi_sink)
|
||||
return connector_status_connected;
|
||||
else
|
||||
return connector_status_disconnected;
|
||||
return intel_hdmi_edid_detect(connector);
|
||||
}
|
||||
|
||||
static enum drm_connector_status
|
||||
@ -201,10 +204,9 @@ intel_hdmi_detect(struct drm_connector *connector)
|
||||
return connector_status_unknown;
|
||||
}
|
||||
|
||||
if ((I915_READ(PORT_HOTPLUG_STAT) & bit) != 0) {
|
||||
intel_hdmi_sink_detect(connector);
|
||||
return connector_status_connected;
|
||||
} else
|
||||
if ((I915_READ(PORT_HOTPLUG_STAT) & bit) != 0)
|
||||
return intel_hdmi_edid_detect(connector);
|
||||
else
|
||||
return connector_status_disconnected;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user