Subject: fixes for i915 AGP
To: None <tech-x11@netbsd.org>
From: Blair Sadewitz <blair.sadewitz@gmail.com>
List: tech-x11
Date: 05/14/2007 17:25:36
------=_Part_119251_27319497.1179177936480
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
The attached patch does the following:
-- Sets the AGP aperture based upon its actual size, not the MSAC bit.
-- Allows for the 10-page allocation xf86-video-intel-2.0 wants.
-- Allows for up to 64MB of stolen memory, should the adapter want it.
Mine only ever seems to want 8MB, though.
Also, anyone who has a "DVMT" option in their BIOS (or anything
resembling "dynamic" memory allocation) should set this to "off" or
"fixed". If this is not done, you *will* experience crashes in X--at
least with a 945GM (I have tested this extensively on an Intel D945GTP
motherboard).
There's also new DRM memory manager code which would help with
performance if it were merged in.
Right now, the performance is lackluster to say the least, i.e. slower
than my Radeon X800GTO *without* DRI. The advantage, of course, is
the CPU utilization.
If those with i915s could please test this, I'd appreciate it, as I'd
like to see if it breaks anything. Otherwise, it will probably just
be committed at some point.
Regards,
--Blair
------=_Part_119251_27319497.1179177936480
Content-Type: application/octet-stream; name="i915-fixups.patch"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="i915-fixups.patch"
SW5kZXg6IGFncHJlZy5oCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT0KUkNTIGZpbGU6IC9jdnNyb290L3NyYy9zeXMvZGV2
L3BjaS9hZ3ByZWcuaCx2CnJldHJpZXZpbmcgcmV2aXNpb24gMS4xMQpkaWZmIC11IC1yMS4xMSBh
Z3ByZWcuaAotLS0gYWdwcmVnLmgJMjcgTWFyIDIwMDcgMDA6MzQ6MTYgLTAwMDAJMS4xMQorKysg
YWdwcmVnLmgJMjggQXByIDIwMDcgMTg6NDU6NDIgLTAwMDAKQEAgLTIyMSw5ICsyMjEsOCBAQAog
I2RlZmluZSBBR1BfSTkxNV9HVFRBRFIJCQkweDFjCiAj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