[Intel-gfx] gem clflush optimization for media encoding

Keith Packard keithp at keithp.com
Wed Jun 22 06:13:37 CEST 2011


On Wed, 22 Jun 2011 11:13:09 +0800, "Zou, Nanhai" <nanhai.zou at intel.com> wrote:

> 	If I upload input buffer with movnti or movntdq (bypass cache) +
> 	sfence(clear write combine buffer) in the end, clflush should
> 	not be needed.

Alas, neither of these will flush existing cached data, so you must
still use clflush to ensure that the data makes it out to memory. All
that they do is avoid consuming additional cache lines.

You want to use a write combining mapping, which should give you full
bandwidth access to memory without hitting any caches. You can use the GTT
mapping as the aperture is configured for write combining access, or we
can figure out how to make PAT work.

> 	Since it is CPU read only surface, clflush in not needed at all.

You'd still have to invalidate cache lines using clflush to avoid using
stale data in the CPU cache.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20110621/c2cecb19/attachment.sig>


More information about the Intel-gfx mailing list