From 433d413257d70267c279d0392697459b0d1568aa Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 12 Feb 2011 10:33:12 +0000 Subject: [PATCH] drm/i915/dp: Sanity check eDP existence Some hardware claims to have both an LVDS panel and an eDP output. Whilst this may be true in a rare case, more often it is just broken hardware. If we see an eDP device we know that it must be connected and so we can confirm its existence with a simple probe. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=34165 Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=24822 Signed-off-by: Chris Wilson --- drivers/gpu/drm/i915/intel_dp.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 65959a2..876970e 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1834,6 +1834,16 @@ intel_dp_init(struct drm_device *dev, int output_reg) if (output_reg == DP_A || is_pch_edp(intel_dp)) { type = DRM_MODE_CONNECTOR_eDP; intel_encoder->type = INTEL_OUTPUT_EDP; + + /* confirm the existence of the device with a simple probe */ + if (intel_dp_aux_native_read(intel_dp, + 0x000, intel_dp->dpcd, + sizeof (intel_dp->dpcd)) + != sizeof(intel_dp->dpcd)) { + kfree(intel_dp); + kfree(intel_connector); + return; + } } else { type = DRM_MODE_CONNECTOR_DisplayPort; intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT; -- 1.7.2.3