From 33e429b9f14f4032fcb486ff691cde9811f5d178 Mon Sep 17 00:00:00 2001 From: Mika Kahola Date: Tue, 20 Jun 2017 15:23:40 +0300 Subject: [RFC PATCH] drm/i915: DisplayPort branch device without OUI support Let's add DisplayPort branch device without OUI support to the list of DP quirks. There are DisplayPort to VGA adapters out there that does not wake up from the sleep when hotplug occurs. At least, one of the these devices does not support OUI so let's disable DPMS for these devices. For now, let's limit this only for DPCD 1.1 devices. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101044 Signed-off-by: Mika Kahola --- drivers/gpu/drm/drm_dp_helper.c | 2 ++ drivers/gpu/drm/i915/intel_dp.c | 8 +++++++- include/drm/drm_dp_helper.h | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 213fb83..39f41c6 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -1218,6 +1218,8 @@ struct dpcd_quirk { #define OUI(first, second, third) { (first), (second), (third) } static const struct dpcd_quirk dpcd_quirk_list[] = { + /* skip DPMS for branch devices with no OUI support */ + { OUI(0x00, 0x00, 0x00), true, BIT(DP_DPCD_QUIRK_SKIP_DPMS) }, /* Analogix 7737 needs reduced M and N at HBR2 link rates */ { OUI(0x00, 0x22, 0xb9), true, BIT(DP_DPCD_QUIRK_LIMITED_M_N) }, }; diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index bca4ac1..11148cd 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -2649,6 +2649,8 @@ static void intel_disable_dp(struct intel_encoder *encoder, { struct intel_dp *intel_dp = enc_to_intel_dp(&encoder->base); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); + bool hpd_quirk = drm_dp_has_quirk(&intel_dp->desc, + DP_DPCD_QUIRK_SKIP_DPMS); if (old_crtc_state->has_audio) intel_audio_codec_disable(encoder); @@ -2660,7 +2662,11 @@ static void intel_disable_dp(struct intel_encoder *encoder, * ensure that we have vdd while we switch off the panel. */ intel_edp_panel_vdd_on(intel_dp); intel_edp_backlight_off(old_conn_state); - intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); + + /* keep HPD working for DP branch device */ + if (!hpd_quirk || intel_dp->dpcd[DP_DPCD_REV] > 0x11) + intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF); + intel_edp_panel_off(intel_dp); /* disable the port before the pipe on g4x */ diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h index b17476a..454dd03 100644 --- a/include/drm/drm_dp_helper.h +++ b/include/drm/drm_dp_helper.h @@ -1117,6 +1117,7 @@ enum drm_dp_quirk { * to 16 bits. */ DP_DPCD_QUIRK_LIMITED_M_N, + DP_DPCD_QUIRK_SKIP_DPMS, }; /** -- 2.7.4