Bug 17231 - When user requests a WC mapping libpciaccess doesn't set up the MTRR
Summary: When user requests a WC mapping libpciaccess doesn't set up the MTRR
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: Lib/pciaccess (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-20 15:48 UTC by Tomas Carnecky
Modified: 2010-08-09 13:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Tomas Carnecky 2008-08-20 15:48:24 UTC
The offending code is in pci_device_linux_sysfs_map_range():

    /* For WC mappings, try sysfs resourceN_wc file first */
    if ((map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE) &&
	!pci_device_linux_sysfs_map_range_wc(dev, map))
	    return 0;

pci_device_linux_sysfs_map_range_wc() does not set up the MTRR, and when the user later unmaps the memory, libpciaccess complains:

error setting MTRR (base = 0xXXX, size = 0xYYY, type = 1) Invalid argument (22)


Does the kernel set up the MTRR (or PAT in newer kernls) when libpciaccess maps from the resourceN_wc file? Or is the mapping uncached because libpciaccess fails to set up the MTRR? I'm just wondering if the missing MTRR entry might explain the awfully slow opengl I get with xorg from git master.
Comment 1 Adam Jackson 2010-08-09 13:10:51 UTC
Fixed in newer libpciaccess, i believe.


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.