On Mon, 12 Nov 2001, Eugene M. Kim wrote:
> Greetings,
>
> Question: What would be the way for a driver to flush some data in the
> CPU write cache, preferably all the way down to physical memory through
> the memory controller, but at least to the memory controller?
>
> Background: I'm trying to add XAA color-expansion blit support to the
> i8xx driver. The hardware limitation dictates that the indirect (one-
> line-at-once) mode should be used. In order to do this, the driver
> lets the XAA common layer know the address of interim buffers, let them
> be filled, then issues the actual blit command to the i8xx hardware
> which reads and uses the buffer filled by the XAA common layer.
I thought the i810 driver already supported this? I see
the code there to do it.
>
> The interim buffer is allocated in the video memory mapped into the AGP
> aperture. The problem is that the aperture has write-combining turned
> on so that not all writes go directly back to memory, and this makes it
> possible that some data written by the XAA common layer is not flushed
> out of CPU-internal write cache and seen by the memory/graphics
> controller. Result: incomplete blit.
All you need to do is flush the write combine cache.
>
> So far, it seems that I have to use some x86 assembler instruction like
> CLCACHE (we can always assume a Pentium II or better processor, because
> the driver is for i8xx chipset =p), but I'd like to know if there are
> more elegant solutions. WBINVD seems impractical because 1) it flushes
> the entire cache so the performance penalty will be obvious and 2)
> WBINVD is a privileged instruction so we must to switch to kernel mode
> before we can use it (means even more performance penalty).
>
Any load or store on uncached memory (like the graphics accelerator's
registers) will flush it.
Any locked atomic RMW instruction (xchgl).
Any port IO (write 0x3D0 or other unused port address. Expensive).
Mark.
_______________________________________________
Xpert mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/xpert