Created attachment 41400 [details] [review]
restore PLL selection, also save PLL0
On some hardware the r128 driver won't restore the video hardware's settings on exit. The problem is that the chip has four PLLs that can be used to generate the pixel clock and the driver blindly assumes that only PLL3 is in use, so it only saves and restores PLL3 and leaves the clock select bits in R128_CLOCK_CNTL_INDEX pointing at PLL3 instead of restoring the original setting. This works as long as the kernel driver also uses PLL3 but at least on Apple hardware the firmware initializes the chip using PLL0 resulting in a messed up console when X exits.
I have seen this on NetBSD/macppc but there really isn't anything OS or PowerPC dependent in this bug.
The attached patch restores the PLL selection on exit and saves/restores PLL0 as well.
Could you please send your patch to xorg-devel? Please make sure it has your
sign-off (git commit -s). Make the patch from git with 'git format-patch
HEAD^' (assuming it is the most recent commit.
I think this describes one problem I see on:
Rage Mobility M3 AGP 2x (rev 02)
Also, keyboard dies at X exit. Several Xorg.0.log files at:
'Disable "DRI2"" made this go away for me.
Fixed by xf86-video-r128 commit 8c7daa148796a037ae2518154345719a735833c3.