Linus Torvalds wrote:
On Tue, 3 Jun 2003, Linus Torvalds wrote:
[ Finally got some debugging time for the other DRI problem I've seen, namely hugely flashing textures in tuxracer on i830, but _only_ iff MTRR
support is compiled into the kernel ]
I've got some more information, including a workaround..
I get horrible texture flashing iff:
- MTRR's are enabled (no idea why it matters, but it does. It might just be timing-related, since proper MTRR programming speeds up things by a factor of two)
- I only allocate 32MB of video memory.
I see this too (I haven't tried disabling mtrrs). It looks a lot like the driver is using the framebuffer to store texture data & getting into all sorts of troubles...
Acutally, I'm pretty sure this is entirely a userspace problem, introduced with the texmem-ification of the i830 driver.
Unlike most drivers i830 texture uploads are just memcpys to the texture area in the framebuffer (which is just agp memory). The reasoning behind this is that the usual technique of loading the texture into dma buffers & having the card upload to the framebuffer is redundant as the dma buffers would be agp memory, just like the framebuffer, so why not put the texture right where it's meant to be & avoid the extra copy.
The downside to this is synchronization: Texture memory accessed this way has to be synchronized with commands on the ring which expect to be able to access other, earlier textures at a given location in texture memory.
So, in the pre-texmem code, we had things like this:
void i830SwapOutTexObj(i830ContextPtr imesa, i830TextureObjectPtr t) { ... if (t->age > imesa->dirtyAge) imesa->dirtyAge = t->age; ... }
which kept a pretty rough idea of how long it would be necessary to sleep before texture memory we believed to be free would really no longer be accessed by queued commands.
That code seems to have disappeared post-texmem-merge.
Possibilities I see are:
- restore the old tracking code (or an improved version). This would have to go into the shared texmem.c code, right?
- be very pessimistic and sync before any texture upload
- push texture uploads through the dma command stream and live with the double copy.
Keith
Keith
------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel