Bug 21303 - [i945] acceleration loss when restarting X
Summary: [i945] acceleration loss when restarting X
Status: RESOLVED INVALID
Alias: None
Product: xorg
Classification: Unclassified
Component: Driver/intel (show other bugs)
Version: 7.4 (2008.09)
Hardware: Other All
: medium normal
Assignee: Jesse Barnes
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on:
Blocks:
 
Reported: 2009-04-20 10:15 UTC by incubusss
Modified: 2009-10-05 10:44 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg log after (22.67 KB, text/plain)
2009-04-20 10:15 UTC, incubusss
no flags Details
Xorg log before restart (25.41 KB, text/plain)
2009-04-20 10:17 UTC, incubusss
no flags Details
Xorg log before restart (20.14 KB, text/plain)
2009-04-21 19:05 UTC, incubusss
no flags Details
Xorg log after restart (20.14 KB, text/plain)
2009-04-21 19:05 UTC, incubusss
no flags Details
Set MTRR even w/WC PCI resources (1.60 KB, patch)
2009-04-28 18:07 UTC, Jesse Barnes
no flags Details | Splinter Review
xorglog after X restart (20.14 KB, application/octet-stream)
2009-06-06 16:59 UTC, incubusss
no flags Details

Description incubusss 2009-04-20 10:15:17 UTC
Created attachment 24973 [details]
Xorg log after

kernel 2.6.29.1, X server 1.6.1, intel driver 2.7.0, and EXA acceleration

At first X start, acceleration is normal. Then if X is restarted, I loose it (glxgears reports half the expected FPS, games are extremely slow).

Seems to be related to mtrr :

Before :
reg00: base=0x000000000 (    0MB), size= 1024MB, count=1: write-back
reg01: base=0x03f700000 ( 1015MB), size=    1MB, count=1: uncachable
reg02: base=0x03f800000 ( 1016MB), size=    8MB, count=1: uncachable
reg03: base=0x0c0000000 ( 3072MB), size=  256MB, count=1: write-combining

After :
reg00: base=0x000000000 (    0MB), size= 1024MB, count=1: write-back
reg01: base=0x03f700000 ( 1015MB), size=    1MB, count=1: uncachable
reg02: base=0x03f800000 ( 1016MB), size=    8MB, count=1: uncachable

After restarting, there is this error in xorg log:

(WW) intel(0): ESR is 0x00000001, instruction error
(WW) intel(0): Existing errors found in hardware state.
Comment 1 incubusss 2009-04-20 10:17:23 UTC
Created attachment 24974 [details]
Xorg log before restart
Comment 2 Jesse Barnes 2009-04-21 18:26:53 UTC
Yeah, your MTRRs look like they're getting broken.  But what's also weird about your config is that GEM isn't getting initialized at all.  Why are you using the fake bufmgr?  It's going to give you pretty poor performance in general...
Comment 3 Jesse Barnes 2009-04-21 18:27:28 UTC
Also, we're removing EXA support (for many reasons, including performance), so please re-open if you can reproduce this with UXA.
Comment 4 incubusss 2009-04-21 19:03:07 UTC
Gem is disabled for i945 and i8xx cards with stock Mandriva 2.6.29.1 kernel due to extremely poor performance when combining them (patch http://svn.mandriva.com/cgi-bin/viewvc.cgi/packages/cooker/kernel/releases/2.6.29.1/4mnb2/PATCHES/patches/gpu-drm-i915-no-gem-if-no-tiling.patch?view=markup).

Anyway, I've tried with a vanilla 2.6.30rc2-git6 kernel using gem and UXA and I've got exactly the same behavior. I reopen the bug report, edit it and add updated logs.

# lspci -vvv
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
	Subsystem: Lenovo Device 3800
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
	Latency: 0
	Capabilities: [e0] Vendor Specific Information <?>
	Kernel driver in use: agpgart-intel

00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03) (prog-if 00 [VGA controller])
	Subsystem: Lenovo Device 3801
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 16
	Region 0: Memory at d0200000 (32-bit, non-prefetchable) [size=512K]
	Region 1: I/O ports at 1800 [size=8]
	Region 2: Memory at c0000000 (32-bit, prefetchable) [size=256M]
	Region 3: Memory at d0300000 (32-bit, non-prefetchable) [size=256K]
	Expansion ROM at <unassigned> [disabled]
	Capabilities: [90] MSI: Mask- 64bit- Count=1/1 Enable-
		Address: 00000000  Data: 0000
	Capabilities: [d0] Power Management version 2
		Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-
	Kernel modules: intelfb

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
	Subsystem: Lenovo Device 3801
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Region 0: Memory at d0280000 (32-bit, non-prefetchable) [size=512K]
	Capabilities: [d0] Power Management version 2
		Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
		Status: D0 PME-Enable- DSel=0 DScale=0 PME-


 
Comment 5 incubusss 2009-04-21 19:05:02 UTC
Created attachment 25017 [details]
Xorg log before restart
Comment 6 incubusss 2009-04-21 19:05:53 UTC
Created attachment 25018 [details]
Xorg log after restart
Comment 7 incubusss 2009-04-23 15:44:39 UTC
Using vesa, mtrr are OK.
Comment 8 Jesse Barnes 2009-04-28 18:07:42 UTC
Created attachment 25246 [details] [review]
Set MTRR even w/WC PCI resources

Can you give this libpciaccess patch a try?  It tries to set up an MTRR even if we use the WC files in sysfs (which due to a kernel bug aren't always WC).
Comment 9 incubusss 2009-04-29 05:05:21 UTC
(In reply to comment #8)
> Created an attachment (id=25246) [details]
> Set MTRR even w/WC PCI resources
> 
> Can you give this libpciaccess patch a try?  It tries to set up an MTRR even if
> we use the WC files in sysfs (which due to a kernel bug aren't always WC).
> 

This patch is already applied in the libpciaccess I use (0.10.5).
Comment 10 Jesse Barnes 2009-05-11 11:03:24 UTC
This patch should keep the X driver from removing the MTRR that the kernel installed, can you give it a try?

diff --git a/src/i830_driver.c b/src/i830_driver.c
index 1887a51..cbf0bd0 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2624,7 +2624,9 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc,
        return FALSE;
    }
 
-   i830_fixup_mtrrs(pScrn);
+   /* In a GEM config, the kernel manages MTRRs */
+   if (!pI830->memory_manager)
+       i830_fixup_mtrrs(pScrn);
 
    pI830->starting = TRUE;
    
Comment 11 incubusss 2009-05-28 22:52:48 UTC
Sorry for being late, the mail that should have warned me of a new message never reached my mail box.
I didn't know if the patch is still valid against 2.7.1 (I needed to rediff it), but it doesn't change anything unfortunately, I'm still losing reg03 after a X restart with existing errors found in hardware in the log.

I'm currently using x11 server 1.6.1.901, intel driver 2.7.1 and linux kernel 2.6.30-rc7 (mandriva cooker)

Comment 12 incubusss 2009-06-06 16:59:59 UTC
Created attachment 26502 [details]
xorglog after X restart
Comment 13 incubusss 2009-06-06 17:01:49 UTC
Still valid I've redone a test with a vanilla 2.6.30-rc8 kernel and updated the log
Comment 14 Bryce Harrington 2009-06-07 11:23:24 UTC
Jesse, a couple people have tested it on the downstream bug.  One person indicates it did not affect the issue.  The other tester was a bit ambiguous, but thought it might have helped with sound/video stuttering.
Comment 15 Jesse Barnes 2009-06-09 17:21:02 UTC
> --- Comment #14 from Bryce Harrington <bryce@canonical.com>
> 2009-06-07 11:23:24 PST --- Jesse, a couple people have tested it on
> the downstream bug.  One person indicates it did not affect the
> issue.  The other tester was a bit ambiguous, but thought it might
> have helped with sound/video stuttering.

I'll have to come up with a patch to monitor MTRR writes; we must be
clearing an MTRR somewhere but not rewriting it at the next startup.
Though I'm pretty sure if you were able to use GEM this problem would
go away...
Comment 16 Jesse Barnes 2009-08-31 11:14:10 UTC
Is this still an issue with more recent bits?
Comment 17 Jesse Barnes 2009-10-05 10:44:14 UTC
Assuming this is no longer an issue...


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.