[PATCH 06/11] drm/ttm: test for dma_address array allocation failure

2011-11-03 Thread j.gli...@gmail.com
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 2dd45ca..58ea7dc 100644 --- a/drivers

[PATCH 07/11] drm/ttm: merge ttm_backend and ttm_tt

2011-11-03 Thread j.gli...@gmail.com
From: Jerome Glisse ttm_backend will exist only and only with a ttm_tt, and ttm_tt will be of interesting use only when bind to a backend. Thus to avoid code & data duplication btw the two merge them. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/nouveau/nouveau_bo.c| 14 ++- drivers/

[PATCH 08/11] drm/ttm: introduce callback for ttm_tt populate & unpopulate

2011-11-03 Thread j.gli...@gmail.com
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. Signed-off-by: Jerome Glisse

[PATCH 09/11] ttm: Provide DMA aware TTM page pool code.

2011-11-03 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

[PATCH 10/11] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-03 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 11/11] drm/radeon/kms: Enable the TTM DMA pool if swiotlb is on

2011-11-03 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. CC: Dave Airlie CC: Alex Deucher Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Jerome Glisse

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator [FULL]

2011-11-07 Thread j.gli...@gmail.com
Ok so here is full patchset, including nouveau support, Ben if you could review (if change to nouveau in patch 7 are correct then others change to nouveau are more than likely 100% correct :)). So been tested on R7XX,EVERGREEN,CAICOS,CAYMAN with SWIOTLB. Also tested on NV50. I still need to test A

[PATCH 01/12] drm/ttm: remove userspace backed ttm object support

2011-11-07 Thread j.gli...@gmail.com
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/d

[PATCH 02/12] drm/ttm: remove split btw highmen and lowmem page

2011-11-07 Thread j.gli...@gmail.com
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 03/12] drm/ttm: remove unused backend flags field

2011-11-07 Thread j.gli...@gmail.com
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 insertions(+), 3 deletions(-) diff

[PATCH 04/12] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-07 Thread j.gli...@gmail.com
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 files changed, 4 insertions(+), 1

[PATCH 05/12] drm/ttm: convert page allocation to use page ptr array instead of list V3

2011-11-07 Thread j.gli...@gmail.com
From: Jerome Glisse Use the ttm_tt page ptr array for page allocation, move the list to array unwinding into the page allocation functions. V2 split the fix to use ttm put page as a separate fix properly fill pages array when TTM_PAGE_FLAG_ZERO_ALLOC is not set V3 Added back page_count()==1 chec

[PATCH 06/12] drm/ttm: test for dma_address array allocation failure

2011-11-07 Thread j.gli...@gmail.com
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 2dd45ca..58ea7dc 100644 --- a/drivers

[PATCH 07/12] drm/ttm: merge ttm_backend and ttm_tt

2011-11-07 Thread j.gli...@gmail.com
From: Jerome Glisse ttm_backend will exist only and only with a ttm_tt, and ttm_tt will be of interesting use only when bind to a backend. Thus to avoid code & data duplication btw the two merge them. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk --- drivers/gpu/drm/nouveau/

[PATCH 08/12] drm/ttm: introduce callback for ttm_tt populate & unpopulate

2011-11-07 Thread j.gli...@gmail.com
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. Signed-off-by: Jerome Glisse

[PATCH 09/12] ttm: Provide DMA aware TTM page pool code.

2011-11-07 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

[PATCH 10/12] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-07 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 11/12] drm/radeon/kms: Enable the TTM DMA pool if swiotlb is on

2011-11-07 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. CC: Dave Airlie CC: Alex Deucher Signed-off-by: Konrad Rzeszutek Wilk Reviewed-by: Jerome Glisse

[PATCH 12/12] nouveau/ttm/dma: Enable the TTM DMA pool if device can only do 32-bit DMA.

2011-11-07 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk If the card is capable of more than 32-bit, then use the default TTM page pool code which allocates from anywhere in the memory. Note: If the 'ttm.no_dma' parameter is set, the override is ignored and the default TTM pool is used. CC: Ben Skeggs CC: Francisco Jerez

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator

2011-11-09 Thread j.gli...@gmail.com
So i did an overhaul of ttm_memory, i believe the simplification i did make sense. See patch 5 for a longer explanation. Thomas with the ttm_memory change the allocation of pages won't happen if the accounting report that we are going over the limit and bo shrinker failed to free any memory to mak

[PATCH 01/13] drm/ttm: remove userspace backed ttm object support

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thoma

[PATCH 02/13] drm/ttm: remove split btw highmen and lowmem page

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 03/13] drm/ttm: remove unused backend flags field

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 inser

[PATCH 04/13] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 fi

[PATCH 05/13] drm/ttm: overhaul memory accounting

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse This is an overhaul of the ttm memory accounting. This tries to keep the same global behavior while removing the whole zone concept. It keeps a distrinction for dma32 so that we make sure that ttm don't starve the dma32 zone. There is 3 threshold for memory allocation : - max

[PATCH 06/13] drm/ttm: convert page allocation to use page ptr array instead of list V4

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse Use the ttm_tt page ptr array for page allocation, move the list to array unwinding into the page allocation functions. V2 split the fix to use ttm put page as a separate fix properly fill pages array when TTM_PAGE_FLAG_ZERO_ALLOC is not set V3 Added back page_count()==1 chec

[PATCH 07/13] drm/ttm: test for dma_address array allocation failure

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 303bbb

[PATCH 08/13] drm/ttm: merge ttm_backend and ttm_tt V2

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse ttm_backend will exist only and only with a ttm_tt, and ttm_tt will be of interesting use only when bind to a backend. Thus to avoid code & data duplication btw the two merge them. V2 Rebase on top of memory accountign overhaul Signed-off-by: Jerome Glisse Reviewed-by: Konr

[PATCH 09/13] drm/ttm: introduce callback for ttm_tt populate & unpopulate V2

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. V2 Rebase on top of memory a

[PATCH 10/13] ttm: Provide DMA aware TTM page pool code. V5

2011-11-09 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

[PATCH 11/13] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-09 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 12/13] drm/radeon/kms: Enable the TTM DMA pool if swiotlb is on V2

2011-11-09 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. V2 force dma32 if we fail to set bigger dma mask CC: Dave Airlie CC: Alex Deucher Signed-off-by: K

[PATCH 13/13] drm/nouveau: enable the TTM DMA pool on 32-bit DMA only device V2

2011-11-09 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk If the card is capable of more than 32-bit, then use the default TTM page pool code which allocates from anywhere in the memory. Note: If the 'ttm.no_dma' parameter is set, the override is ignored and the default TTM pool is used. V2 use pci_set_consistent_dma_mask

Isolate dma information from ttm_tt

2011-11-09 Thread j.gli...@gmail.com
This apply on top of the ttm_tt & backend merge patchset. Cheers, Jerome

[PATCH 14/14] drm/ttm: isolate dma data from ttm_tt

2011-11-09 Thread j.gli...@gmail.com
From: Jerome Glisse Move dma data to a superset ttm_dma_tt structure which herit from ttm_tt. This allow driver that don't use dma functionalities to not have to waste memory for it. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/nouveau/nouveau_bo.c | 18 + drivers/gpu/drm/nou

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator V4

2011-11-10 Thread j.gli...@gmail.com
So squeezed all to avoid any memory accouting messing, seems to work ok so far. Cheers, Jerome

[PATCH 01/13] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-10 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 02/13] drm/ttm: remove userspace backed ttm object support

2011-11-10 Thread j.gli...@gmail.com
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thoma

[PATCH 03/13] drm/ttm: remove split btw highmen and lowmem page

2011-11-10 Thread j.gli...@gmail.com
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 04/13] drm/ttm: remove unused backend flags field

2011-11-10 Thread j.gli...@gmail.com
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 inser

[PATCH 05/13] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-10 Thread j.gli...@gmail.com
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 fi

[PATCH 06/13] drm/ttm: test for dma_address array allocation failure

2011-11-10 Thread j.gli...@gmail.com
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 3fb4c6

[PATCH 07/13] drm/ttm: page allocation use page array instead of list

2011-11-10 Thread j.gli...@gmail.com
From: Jerome Glisse Use the ttm_tt pages array for pages allocations, move the list unwinding into the page allocation functions. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 85 +- drivers/gpu/drm/ttm/ttm_tt.c | 36 +++

[PATCH 09/13] drm/ttm: introduce callback for ttm_tt populate & unpopulate V4

2011-11-10 Thread j.gli...@gmail.com
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. V2 Rebase on top of memory a

[PATCH 08/13] drm/ttm: merge ttm_backend and ttm_tt V4

2011-11-10 Thread j.gli...@gmail.com
From: Jerome Glisse ttm_backend will exist only and only with a ttm_tt, and ttm_tt will be of interesting use only when bind to a backend. Thus to avoid code & data duplication btw the two merge them. V2 Rebase on top of memory accounting overhaul V3 Rebase on top of more memory accounting chang

[PATCH 10/13] drm/ttm: provide dma aware ttm page pool code V7

2011-11-10 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

[PATCH 11/13] drm/radeon/kms: enable the ttm dma pool if swiotlb is on V3

2011-11-10 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. V2 force dma32 if we fail to set bigger dma mask V3 Rebase on top of no memory account changes (where

[PATCH 13/13] drm/ttm: isolate dma data from ttm_tt V2

2011-11-10 Thread j.gli...@gmail.com
From: Jerome Glisse Move dma data to a superset ttm_dma_tt structure which herit from ttm_tt. This allow driver that don't use dma functionalities to not have to waste memory for it. V2 Rebase on top of no memory account changes (where/when is my delorean when i need it ?) Signed-off-by: Jer

[PATCH 12/13] drm/nouveau: enable the ttm dma pool when swiotlb is active V3

2011-11-10 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk If the card is capable of more than 32-bit, then use the default TTM page pool code which allocates from anywhere in the memory. Note: If the 'ttm.no_dma' parameter is set, the override is ignored and the default TTM pool is used. V2 use pci_set_consistent_dma_mask V

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator V5

2011-11-11 Thread j.gli...@gmail.com
So attached is updated serie of patch with fixes for swaping issue that also impacted memory accounting. Last patch fix memory accounting for radeon & nouveau. I think it's ready to go into drm-next, patchset is against linus tree as there is thing there not in next that conflict. (in radeon iirc)

[PATCH 01/14] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-11 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 02/14] drm/ttm: remove userspace backed ttm object support

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thoma

[PATCH 03/14] drm/ttm: remove split btw highmen and lowmem page

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 04/14] drm/ttm: remove unused backend flags field

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 inser

[PATCH 05/14] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 fi

[PATCH 06/14] drm/ttm: test for dma_address array allocation failure

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 90527a

[PATCH 07/14] drm/ttm: page allocation use page array instead of list

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse Use the ttm_tt pages array for pages allocations, move the list unwinding into the page allocation functions. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 85 +- drivers/gpu/drm/ttm/ttm_tt.c | 36 +++

[PATCH 08/14] drm/ttm: merge ttm_backend and ttm_tt V5

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse ttm_backend will only exist with a ttm_tt, and ttm_tt will only be of interest when bound to a backend. Merge them to avoid code and data duplication. V2 Rebase on top of memory accounting overhaul V3 Rebase on top of more memory accounting changes V4 Rebase on top of no memo

[PATCH 09/14] drm/ttm: introduce callback for ttm_tt populate & unpopulate V4

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. V2 Rebase on top of memory a

[PATCH 10/14] drm/ttm: provide dma aware ttm page pool code V8

2011-11-11 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

[PATCH 11/14] drm/radeon/kms: enable the ttm dma pool if swiotlb is on V3

2011-11-11 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. V2 force dma32 if we fail to set bigger dma mask V3 Rebase on top of no memory account changes (where

[PATCH 12/14] drm/nouveau: enable the ttm dma pool when swiotlb is active V3

2011-11-11 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk If the card is capable of more than 32-bit, then use the default TTM page pool code which allocates from anywhere in the memory. Note: If the 'ttm.no_dma' parameter is set, the override is ignored and the default TTM pool is used. V2 use pci_set_consistent_dma_mask V

[PATCH 13/14] drm/ttm: isolate dma data from ttm_tt V3

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse Move dma data to a superset ttm_dma_tt structure which herit from ttm_tt. This allow driver that don't use dma functionalities to not have to waste memory for it. V2 Rebase on top of no memory account changes (where/when is my delorean when i need it ?) V3 Make sure page l

[PATCH 14/14] drm/ttm: simplify memory accounting for ttm user

2011-11-11 Thread j.gli...@gmail.com
From: Jerome Glisse Provide helper function to compute the kernel memory size needed for each buffer object. Move all the accounting inside ttm, simplifying driver and avoiding code duplication accross them. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/nouveau/nouveau_bo.c |6 +++-

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator V6

2011-11-16 Thread j.gli...@gmail.com
Respin some of the patch with syntax/typo fix + patch 10 with proper memory accounting of page being free. Cheers, Jerome

[PATCH 01/14] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-16 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 02/14] drm/ttm: remove userspace backed ttm object support

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thoma

[PATCH 03/14] drm/ttm: remove split btw highmen and lowmem page

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 04/14] drm/ttm: remove unused backend flags field

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 inser

[PATCH 05/14] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 fi

[PATCH 06/14] drm/ttm: test for dma_address array allocation failure

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 90527a

[PATCH 07/14] drm/ttm: page allocation use page array instead of list

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse Use the ttm_tt pages array for pages allocations, move the list unwinding into the page allocation functions. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 85 +- drivers/gpu/drm/ttm/ttm_tt.c | 36 +++

[PATCH 08/14] drm/ttm: merge ttm_backend and ttm_tt V5

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse ttm_backend will only exist with a ttm_tt, and ttm_tt will only be of interest when bound to a backend. Merge them to avoid code and data duplication. V2 Rebase on top of memory accounting overhaul V3 Rebase on top of more memory accounting changes V4 Rebase on top of no memo

[PATCH 09/14] drm/ttm: introduce callback for ttm_tt populate & unpopulate V4

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. V2 Rebase on top of memory a

[PATCH 10/14] drm/ttm: provide dma aware ttm page pool code V9

2011-11-16 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

[PATCH 11/14] drm/radeon/kms: enable the ttm dma pool if swiotlb is on V4

2011-11-16 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. V2 force dma32 if we fail to set bigger dma mask V3 Rebase on top of no memory account changes (where

[PATCH 12/14] drm/nouveau: enable the ttm dma pool when swiotlb is active V3

2011-11-16 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk If the card is capable of more than 32-bit, then use the default TTM page pool code which allocates from anywhere in the memory. Note: If the 'ttm.no_dma' parameter is set, the override is ignored and the default TTM pool is used. V2 use pci_set_consistent_dma_mask V

[PATCH 13/14] drm/ttm: isolate dma data from ttm_tt V4

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse Move dma data to a superset ttm_dma_tt structure which herit from ttm_tt. This allow driver that don't use dma functionalities to not have to waste memory for it. V2 Rebase on top of no memory account changes (where/when is my delorean when i need it ?) V3 Make sure page l

[PATCH 14/14] drm/ttm: simplify memory accounting for ttm user

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse Provide helper function to compute the kernel memory size needed for each buffer object. Move all the accounting inside ttm, simplifying driver and avoiding code duplication accross them. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/nouveau/nouveau_bo.c |6 +++-

[PATCH] drm/radeon: introduce a sub allocator and convert ib pool to it

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse Somewhat specializaed sub-allocator designed to perform sub-allocation for command buffer not only for current cs ioctl but for future command submission ioctl as well. Patch also convert current ib pool to use the sub allocator. Idea is that ib poll buffer can be share with o

[PATCH] drm/radeon: introduce a sub allocator and convert ib pool to it

2011-11-16 Thread j.gli...@gmail.com
From: Jerome Glisse Somewhat specializaed sub-allocator designed to perform sub-allocation for command buffer not only for current cs ioctl but for future command submission ioctl as well. Patch also convert current ib pool to use the sub allocator. Idea is that ib poll buffer can be share with o

[PATCH] drm/ttm: pass buffer object for bind/unbind callback

2011-11-17 Thread j.gli...@gmail.com
From: Jerome Glisse ttm_tt is always associated with a buffer object, pass it in bind/unbind callback to make life easier for driver. Main objective is for driver supporting virtual address space. For such driver each buffer object can be several virtual address space but ttm is unaware of this.

[PATCH] drm/ttm: callback move_notify any time bo placement change

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse Previously we were calling back move_notify in error path when the bo is returned to it's original position or when destroy the bo. When destroying the bo set the new mem placement as NULL when calling back in the driver. Updating nouveau to deal with NULL placement properly.

[PATCH] drm/ttm: callback move_notify any time bo placement change v2

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse Previously we were calling back move_notify in error path when the bo is returned to it's original position or when destroy the bo. When destroying the bo set the new mem placement as NULL when calling back in the driver. Updating nouveau to deal with NULL placement properly.

[PATCH] drm/ttm: callback move_notify any time bo placement change v3

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse Previously we were calling back move_notify in error path when the bo is returned to it's original position or when destroy the bo. When destroying the bo set the new mem placement as NULL when calling back in the driver. Updating nouveau to deal with NULL placement properly.

ttm: merge ttm_backend & ttm_tt, introduce ttm dma allocator V7

2011-11-18 Thread j.gli...@gmail.com
Important fix to patch 14, fix accounting of ghost bo. When creating a ghost bo we don't account it, so set its acc_size to 0 so that when ghost is release we don't overfree. I wonder how i didn't run into this before. Patch are also at http://people.freedesktop.org/~glisse/ttmdma/ Cheers, Jero

[PATCH 01/14] swiotlb: Expose swiotlb_nr_tlb function to modules

2011-11-18 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk As a mechanism to detect whether SWIOTLB is enabled or not. We also fix the spelling - it was swioltb instead of swiotlb. CC: FUJITA Tomonori [v1: Ripped out swiotlb_enabled] Signed-off-by: Konrad Rzeszutek Wilk --- drivers/xen/swiotlb-xen.c |2 +- include/linu

[PATCH 02/14] drm/ttm: remove userspace backed ttm object support

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse This was never use in none of the driver, properly using userspace page for bo would need more code (vma interaction mostly). Removing this dead code in preparation of ttm_tt & backend merge. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thoma

[PATCH 03/14] drm/ttm: remove split btw highmen and lowmem page

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse Split btw highmem and lowmem page was rendered useless by the pool code. Remove it. Note further cleanup would change the ttm page allocation helper to actualy take an array instead of relying on list this could drasticly reduce the number of function call in the common case o

[PATCH 04/14] drm/ttm: remove unused backend flags field

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse This field is not use by any of the driver just drop it. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/radeon/radeon_ttm.c |1 - include/drm/ttm/ttm_bo_driver.h |2 -- 2 files changed, 0 inser

[PATCH 05/14] drm/ttm: use ttm put pages function to properly restore cache attribute

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse On failure we need to make sure the page we free has wb cache attribute. Do this pas call the proper ttm page helper function. Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |5 - 1 fi

[PATCH 06/14] drm/ttm: test for dma_address array allocation failure

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse Signed-off-by: Jerome Glisse Reviewed-by: Konrad Rzeszutek Wilk Reviewed-by: Thomas Hellstrom --- drivers/gpu/drm/ttm/ttm_tt.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 90527a

[PATCH 07/14] drm/ttm: page allocation use page array instead of list

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse Use the ttm_tt pages array for pages allocations, move the list unwinding into the page allocation functions. Signed-off-by: Jerome Glisse --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 85 +- drivers/gpu/drm/ttm/ttm_tt.c | 36 +++

[PATCH 08/14] drm/ttm: merge ttm_backend and ttm_tt V5

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse ttm_backend will only exist with a ttm_tt, and ttm_tt will only be of interest when bound to a backend. Merge them to avoid code and data duplication. V2 Rebase on top of memory accounting overhaul V3 Rebase on top of more memory accounting changes V4 Rebase on top of no memo

[PATCH 09/14] drm/ttm: introduce callback for ttm_tt populate & unpopulate V4

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse Move the page allocation and freeing to driver callback and provide ttm code helper function for those. Most intrusive change, is the fact that we now only fully populate an object this simplify some of code designed around the page fault design. V2 Rebase on top of memory a

[PATCH 10/14] drm/ttm: provide dma aware ttm page pool code V9

2011-11-18 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk In TTM world the pages for the graphic drivers are kept in three different pools: write combined, uncached, and cached (write-back). When the pages are used by the graphic driver the graphic adapter via its built in MMU (or AGP) programs these pages in. The programming

[PATCH 11/14] drm/radeon/kms: enable the ttm dma pool if swiotlb is on V4

2011-11-18 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk With the exception that we do not handle the AGP case. We only deal with PCIe cards such as ATI ES1000 or HD3200 that have been detected to only do DMA up to 32-bits. V2 force dma32 if we fail to set bigger dma mask V3 Rebase on top of no memory account changes (where

[PATCH 12/14] drm/nouveau: enable the ttm dma pool when swiotlb is active V3

2011-11-18 Thread j.gli...@gmail.com
From: Konrad Rzeszutek Wilk If the card is capable of more than 32-bit, then use the default TTM page pool code which allocates from anywhere in the memory. Note: If the 'ttm.no_dma' parameter is set, the override is ignored and the default TTM pool is used. V2 use pci_set_consistent_dma_mask V

[PATCH 13/14] drm/ttm: isolate dma data from ttm_tt V4

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse Move dma data to a superset ttm_dma_tt structure which herit from ttm_tt. This allow driver that don't use dma functionalities to not have to waste memory for it. V2 Rebase on top of no memory account changes (where/when is my delorean when i need it ?) V3 Make sure page l

[PATCH 14/14] drm/ttm: simplify memory accounting for ttm user v2

2011-11-18 Thread j.gli...@gmail.com
From: Jerome Glisse Provide helper function to compute the kernel memory size needed for each buffer object. Move all the accounting inside ttm, simplifying driver and avoiding code duplication accross them. v2 fix accounting of ghost object, one would have thought that i would have run into

<    1   2   3   4   >