Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-02-01 Thread Jerome Glisse
On Mon, Feb 1, 2010 at 6:46 PM, Luca Barbieri wrote: >> Idea is to mask all move which involve TT (AGP) with the agp_caching_mask, >> it's easy to do in radeon ttm layer code and i believe it's easy to do >> in nouveau >> too. On non AGP you set agp_caching_mask to UC|WC|CACHED. > > Sure, but isn'

Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-02-01 Thread Jerome Glisse
On Mon, Feb 1, 2010 at 5:26 PM, Luca Barbieri wrote: > I see a problem with this. > > If you have uncached TT (e.g. AGP) you want to get uncached for > TT->SYSTEM, but you want cached for VRAM->SYSTEM. > If you set SYSTEM to uncached, then VRAM->SYSTEM will broken, and if > you set SYSTEM to cache

Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-02-01 Thread Luca Barbieri
> Your patch remove the consistency of caching attribute and make move btw > non fixed area different than others move, while driver can already achieve > so. It is already different, because TTM does it by changing the page attributes, as opposed to copying data. Thus, it is useful to preserve th

Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-02-01 Thread Luca Barbieri
> Idea is to mask all move which involve TT (AGP) with the agp_caching_mask, > it's easy to do in radeon ttm layer code and i believe it's easy to do > in nouveau > too. On non AGP you set agp_caching_mask to UC|WC|CACHED. Sure, but isn't that uglier and much more ad-hoc that the patch I proposed?

Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-02-01 Thread Luca Barbieri
I see a problem with this. If you have uncached TT (e.g. AGP) you want to get uncached for TT->SYSTEM, but you want cached for VRAM->SYSTEM. If you set SYSTEM to uncached, then VRAM->SYSTEM will broken, and if you set SYSTEM to cached, TT->SYSTEM will be broken. If you set to uncached | cached, VR

Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-02-01 Thread Luca Barbieri
> If you set to uncached | cached, VRAM->SYSTEM will still be broken > because it will choose uncached. Assuming VRAM is uncached and not WC of course. The reasoning still holds if you replace all instances of "uncached" with WC. ---

Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-02-01 Thread Thomas Hellstrom
Jerome Glisse wrote: > On Mon, Feb 01, 2010 at 11:35:21AM +1000, Dave Airlie wrote: > >> On Thu, Jan 28, 2010 at 7:26 PM, Luca Barbieri >> wrote: >> >>> Currently TTM tries to preserve the previous caching even for moves >>> between unrelated memory spaces. >>> >>> This results for instan

Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-02-01 Thread Jerome Glisse
On Mon, Feb 01, 2010 at 11:35:21AM +1000, Dave Airlie wrote: > On Thu, Jan 28, 2010 at 7:26 PM, Luca Barbieri wrote: > > Currently TTM tries to preserve the previous caching even for moves > > between unrelated memory spaces. > > > > This results for instance in moves from VRAM to PCIE GART changi

Re: [PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-01-31 Thread Dave Airlie
On Thu, Jan 28, 2010 at 7:26 PM, Luca Barbieri wrote: > Currently TTM tries to preserve the previous caching even for moves > between unrelated memory spaces. > > This results for instance in moves from VRAM to PCIE GART changing > system memory to WC state needlessly. > > This patch changes TTM t

[PATCH] drm/ttm: Only try to preserve caching in moves in the same space

2010-01-28 Thread Luca Barbieri
Currently TTM tries to preserve the previous caching even for moves between unrelated memory spaces. This results for instance in moves from VRAM to PCIE GART changing system memory to WC state needlessly. This patch changes TTM to only try to preserve caching if moving from system/TT to system/T