Bug 32606

Summary: xf86-video-r128 fails to restore video mode on exit
Product: xorg Reporter: Michael Lorenz <macallan>
Component: Driver/rage128Assignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium CC: jeremyhu, mrmazda
Version: unspecifiedKeywords: patch
Hardware: All   
OS: All   
Whiteboard: 2011BRB_Reviewed
i915 platform: i915 features:
Attachments:
Description Flags
restore PLL selection, also save PLL0 none

Description Michael Lorenz 2010-12-23 06:01:24 UTC
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.
Comment 1 Jeremy Huddleston Sequoia 2011-10-17 00:49:25 UTC
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.
Comment 2 Felix Miata 2013-02-19 05:57:36 UTC
I think this describes one problem I see on:
Rage Mobility M3 AGP 2x (rev 02)
Server 1.13.2
xf86-video-r128-6.9.1-2.1.1.i586
openSUSE 12.3RC1+

Also, keyboard dies at X exit. Several Xorg.0.log files at:
http://fm.no-ip.com/Tmp/Linux/Xorg/os123r128/
Comment 3 Felix Miata 2013-02-19 07:07:06 UTC
'Disable "DRI2"" made this go away for me.
Comment 4 Connor Behan 2015-03-04 06:33:13 UTC
Fixed by xf86-video-r128 commit 8c7daa148796a037ae2518154345719a735833c3.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.