So if you have read this far congratulations! In the end this is a summary of my conclusions, and apparent fix:
==================================================================================================== ==========================================
On a Haswell system with an Intel HD 4400 as the integrated card in a hybrid system X freezes (moveable mouse cursor but either black screen or frozen image of desktop at time of freeze) often when the user locks the screen (inactivity or otherwise) or closes the lid. The desktop (in 13.10 at least) can be recovered by switching to a tty and back( e.g. ctrl+alt+fn1, followed by ctl+alt+fn7). In 12.04 I needed to restart completely from tty.
This bug occurs because pxpress loads the intel driver with the "AccelMethod" "UXA" option. You can verify this is the cause by using a minimal (intel only) `xorg.conf` (even before fglrx drivers are installed) with just
Code:
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "UXA" # (mode fglrx uses) I can see the bug
# Option "AccelMethod" "SNA" #(default) no bug!
EndSection
and you should reproduce the bug with a few attempts at closing lid/locking screen. Whereas with the change to ` Option "AccelMethod" "SNA"` there is no bug anymore ("SNA" is the default anyway). So this a bug in the intel driver when UXA is selected on a Haswell system it seems.
How to fix
Create (or edit) the DRI config file `~/.drirc` containing
Code:
<device screen="0" driver="dri2">
<application name="Default">
<option name="vblank_mode" value="0"/>
</application>
</device>
This turns off "vsync" for the Intel card (the mode that attempts to make your gfx card sync its framerate with that of the display to avoid tearing, rather than racing ahead at its intrinsic higher framerate).
Now even when pxpress loads the intel driver in "UXA" mode, the bug should not be reproducible.
It would be a better solution if it were possible to tell pxpress to load intel driver with SNA mode directly, but I have no idea if this is possible, maybe it is hardcoded into the drivers.