Message ID | yunsjpt7fjo.fsf@aiko.keithp.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tue, Jul 26, 2011 at 1:54 AM, Keith Packard <keithp@keithp.com> wrote: > From 59b920597999381fab70c485c161dd50590e561a Mon Sep 17 00:00:00 2001 > From: Keith Packard <keithp@keithp.com> > Date: Mon, 25 Jul 2011 22:37:51 -0700 > Subject: [PATCH] Revert and fix "drm/i915/dp: remove DPMS mode tracking from > DP" > > This reverts commit 885a50147f00a8a80108904bf58a18af357717f3. > > We actually *do* need to track DPMS state so that on hotplug, we don't > retrain the link until DPMS is disabled. > > intel_dp->output_reg = output_reg; > + intel_dp->dpms_mode = -1; Should that be some actual mode constant instead of -1? In any case, this patch, applied manually on top of the struct_mutex fix, seems to work. xset dpms force off turns the display off briefly (presumably X or GNOME helpfully turns it back on), but if I let the display turn off on its own, it comes back. There's still an obnoxious bug, though: I use audio over DP, and when the display turns off, the attached speaker crackles loudly for a second or two. I don't think it's a hardware problem with the monitor, because if I just pull the plug it doesn't make any noise. Should the driver do something to drop the audio link before turning off the DP link as a whole? --Andy
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 9f134d2..4493641 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -50,6 +50,7 @@ struct intel_dp { bool has_audio; int force_audio; uint32_t color_range; + int dpms_mode; uint8_t link_bw; uint8_t lane_count; uint8_t dpcd[8]; @@ -1011,6 +1012,8 @@ static void intel_dp_commit(struct drm_encoder *encoder) if (is_edp(intel_dp)) ironlake_edp_backlight_on(dev); + + intel_dp->dpms_mode = DRM_MODE_DPMS_ON; } static void @@ -1045,6 +1048,7 @@ intel_dp_dpms(struct drm_encoder *encoder, int mode) if (is_edp(intel_dp)) ironlake_edp_backlight_on(dev); } + intel_dp->dpms_mode = mode; } /* @@ -1591,6 +1595,9 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) static void intel_dp_check_link_status(struct intel_dp *intel_dp) { + if (intel_dp->dpms_mode != DRM_MODE_DPMS_ON) + return; + if (!intel_dp->base.base.crtc) return; @@ -1939,6 +1946,7 @@ intel_dp_init(struct drm_device *dev, int output_reg) return; intel_dp->output_reg = output_reg; + intel_dp->dpms_mode = -1; intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); if (!intel_connector) {