SNB LVDS goes all stripy at times with rc6 enabled
Ok, that took all evening. And, I don't have a fix, but I do know a lot more about the problem.
To recap:
On Sandybridge, sometimes, when you simultaneously change two outputs, one of them turns into stripes, or as solid color.
Here's how I reproduce it:
First, connect an external monitor to your laptop. I've seen this with HDMI and DisplayPort, but never with VGA. No, I don't know why. DisplayPort seems to reliably reproduce it for me.
$ xrandr --output DP2 --auto --output LVDS1 --auto --below DP2
The key is to place LVDS1 at a position other than 0x0 so that it will get a full mode set in the subsequence step.
Now, work around a bug in the kernel where it doesn't set crtc DPMS state in intel_crtc_mode_set (how many times do we have to fix this bug?):
$ xset dpms force off
(alternatively, apply the patch I sent out to set the DPMS state in intel_crtc_mode_set).
Finally, turn off DP2:
$ xrandr --output DP2 --off
With luck, you'll see stripes on your LVDS monitor instead of the expected image.
Knowing that things worked (at least before any DPMS fired) without the intel_crtc_mode_set DPMS fix, I set about trying to figure out how the two paths differed (with and without the DPMS fix). The differences were minimal, and I slowly hacked up the code to eliminate all of them, except for the step which actually disabled the idle CRTC which had been driving the DP port.
At this point, I had exactly matching register write sequences between the two cases, except for he addition of the DP CRTC disable, which happened right at the beginning of the mode setting sequence.
Nothing worked, except when I stopped disabling the DP CRTC.
Finally, I tried disabling fbc and rc6. Surprise! things worked perfectly now. I then isolated the effect to just rc6. With rc6 enabled, I'd get garbage on the screen. With rc6 disabled, things work correctly.
I tried holding force_wake across a few functions in intel_display.c without success; I have to assume that there's some register reads or writes which are going wrong with rc6 enabled.
Signature · 1 line
[email protected]
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 49 lines · On Wed, 27 Jul 2011 02:29:19 -0700 "Keith Packard" <[email protected]> wrote:
Ok, that took all evening. And, I don't have a fix, but I do know a lot more about the problem.
To recap:
On Sandybridge, sometimes, when you simultaneously change two outputs, one of them turns into stripes, or as solid color.
Here's how I reproduce it:
First, connect an external monitor to your laptop. I've seen this with HDMI and DisplayPort, but never with VGA. No, I don't know why. DisplayPort seems to reliably reproduce it for me.
$ xrandr --output DP2 --auto --output LVDS1 --auto --below DP2
The key is to place LVDS1 at a position other than
0x0so that it will get a full mode set in the subsequence step.Now, work around a bug in the kernel where it doesn't set crtc DPMS state in
intel_crtc_mode_set(how many times do we have to fix this bug?):$ xset dpms force off
(alternatively, apply the patch I sent out to set the DPMS state in
intel_crtc_mode_set).Finally, turn off DP2:
$ xrandr --output DP2 --off
With luck, you'll see stripes on your LVDS monitor instead of the expected image.
Knowing that things worked (at least before any DPMS fired) without the
intel_crtc_mode_setDPMS fix, I set about trying to figure out how the two paths differed (with and without the DPMS fix). The differences were minimal, and I slowly hacked up the code to eliminate all of them, except for the step which actually disabled the idle CRTC which had been driving the DP port.At this point, I had exactly matching register write sequences between the two cases, except for he addition of the DP CRTC disable, which happened right at the beginning of the mode setting sequence.
Nothing worked, except when I stopped disabling the DP CRTC.
Quoted 7 lines
Finally, I tried disabling fbc and rc6. Surprise! things worked perfectly now. I then isolated the effect to just rc6. With rc6 enabled, I'd get garbage on the screen. With rc6 disabled, things work correctly.
I tried holding
force_wakeacross a few functions inintel_display.cwithout success; I have to assume that there's some register reads or writes which are going wrong with rc6 enabled.
I tried this last week with my patch
commit 2a9852c3809f5fd03a4755381e2ef47da72d22ef
Author: Jesse Barnes <[email protected]> Date: Fri Jul 22 13:17:05 2011 -0700
drm/i915: apply timing generator bug workaround on CPT and PPT
and wasn't able to reproduce it. I may have been just getting lucky, but it's worth having you try as well. I can imagine RC6 affecting the timing generator bug...
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Quoted 1 line · Jesse Barnes
I tried this last week with my patch
So, with the intel_crtc DPMS tracking fixed, this problem can now be easily reproduced in a wide range of situations.
It does not depend on the output in question -- Jesse and I have managed to make this happen on VGA, DP, LVDS and HDMI. The only thing we haven't tested is eDP. That one would be particularly interesting as it doesn't depend on the PCH. Anyone have an SNB machine with an eDP panel and an external monitor to try?
It does not depend on the position of the outputs on the screen, all that it requires is that one output be disabled and then the other output get a new mode. Something like:
$ xrandr --output LVDS1 --pos 0x0 --mode 1024x768 --output DP2 --pos 0x0 --mode 1024x768 $ xrandr --output DP2 --off $ xrandr --output LVDS1 --auto # this assumes that LVDS1 is larger than 1024x768
The PCH reports no FDI data errors, and if you send the errant monitor the PCH-internal test signal (bit 31, register 0xf0e30 and 0xf1e30), it displays that correctly.
So, it surely looks like the CPU is sending the wrong data to the PCH in this case.
At this point, I have only two proposed ugly work-arounds:
1) Disable rc6.
2) Once a crtc is turned on, leave it on.
Neither of these is appealing for obvious reasons.
At this point, it seems like the most likely cause is in the crtc disabling code; some ordering issue or missing pieces may be scrambling some hidden internal state.
Signature · 1 line
[email protected]
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 30 lines · On Wed, 27 Jul 2011 23:08:08 -0700 Keith Packard <[email protected]> wrote:
Quoted 1 line · Jesse Barnes
I tried this last week with my patch
So, with the
intel_crtcDPMS tracking fixed, this problem can now be easily reproduced in a wide range of situations.It does not depend on the output in question -- Jesse and I have managed to make this happen on VGA, DP, LVDS and HDMI. The only thing we haven't tested is eDP. That one would be particularly interesting as it doesn't depend on the PCH. Anyone have an SNB machine with an eDP panel and an external monitor to try?
It does not depend on the position of the outputs on the screen, all that it requires is that one output be disabled and then the other output get a new mode. Something like:
$ xrandr --output LVDS1 --pos 0x0 --mode 1024x768 --output DP2 --pos 0x0 --mode 1024x768 $ xrandr --output DP2 --off $ xrandr --output LVDS1 --auto # this assumes that LVDS1 is larger than 1024x768The PCH reports no FDI data errors, and if you send the errant monitor the PCH-internal test signal (bit 31, register
0xf0e30and0xf1e30), it displays that correctly.So, it surely looks like the CPU is sending the wrong data to the PCH in this case.
At this point, I have only two proposed ugly work-arounds:
Quoted 8 lines
1) Disable rc6.
2) Once a crtc is turned on, leave it on.Neither of these is appealing for obvious reasons.
At this point, it seems like the most likely cause is in the crtc disabling code; some ordering issue or missing pieces may be scrambling some hidden internal state.
Yes this problem has me very frustrated. We still have two big open questions to answer before we really understand things:
1) why the heck does rc6 make any difference at all?
2) why does enabling the second pipe make things good again?
Theoretically, we're coming pretty close to shutting everything down after we disable the second crtc and set a mode on the first again. I wonder if an even bigger hammer (shut *everything* down and wait a few ms) would improve the situation...
I guess we have more things to try today...
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center