seems ttm_bo_handle_move_mem not flush cache, if BO move SYS->VRAM?

april aapril03 at gmail.com
Wed Dec 1 18:49:52 PST 2010


thanks Thomas

I want to flush CPU cache, before use DMA  from system memory to VRAM.

Seems I should do this in driver move function itself.

bty,
when BO changes from cached to write-combined, CPU cache will be
flushed, and all the pages in this BO will do this.
but, may be only a small part of page's cache flush is really
needed(CPU just write to a few pages in BO).

Is there any ways to solve this?

or there's no need to do this? (clflush those pages that not in cpu
cache not cost too much?)


Thank you

2010/12/2 Thomas Hellstrom <thomas at shipmail.org>:
> On 12/01/2010 04:58 AM, april wrote:
>>
>> hi all:
>>
>> I have a question:
>>
>> If a BO in VRAM (WC) evict to SYS memory(may be cached),  and user
>> process still can access it event it is in SYS memory (may be cached)
>> .
>> when this BO volidate to VRAM,  It seems "ttm_bo_handle_move_mem"  not
>> flush cache (If evict to SYS memory with cached).
>>
>>  But flush cache is needed, If driver use DMA to handle BO
>> move(SYS->VRAM), should "ttm_bo_handle_move_mem" handle this? or
>> driver do it in "driver->move_notify" before "driver->move" called?
>>
>>
>
> April, in order to understand your proble, Can you be a bit more specific
> about.
>
> 1) Which cache should be flushed? Cpu cache or GPU cache.
>
> 2) Why should it be flushed? For CPU caches, TTM only flushes when
> transitioning the same page from cached to write-combined. If you use DMA
> from system memory to VRAM, and need to flush the system pages before
> performing the DMA operation, that should be done in the driver move
> function.
>
> /Thomas
>
>
>> Thanks
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
>
>


More information about the dri-devel mailing list