Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/ttm: remove cpu_address member from ttm_tt

Patch 3d50d4dcb0 exposed the CPU address of DMA-allocated pages as
returned by dma_alloc_coherent because Nouveau on Tegra needed it.

This is not required anymore - as there were no other users for it,
remove it and save some memory for everyone.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Alexandre Courbot and committed by
Alex Deucher
af1f85dd 0aa3e2d0

+2 -9
-2
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
··· 858 858 if (count) { 859 859 d_page = list_first_entry(&pool->free_list, struct dma_page, page_list); 860 860 ttm->pages[index] = d_page->p; 861 - ttm_dma->cpu_address[index] = d_page->vaddr; 862 861 ttm_dma->dma_address[index] = d_page->dma; 863 862 list_move_tail(&d_page->page_list, &ttm_dma->pages_list); 864 863 r = 0; ··· 988 989 INIT_LIST_HEAD(&ttm_dma->pages_list); 989 990 for (i = 0; i < ttm->num_pages; i++) { 990 991 ttm->pages[i] = NULL; 991 - ttm_dma->cpu_address[i] = 0; 992 992 ttm_dma->dma_address[i] = 0; 993 993 } 994 994
+2 -5
drivers/gpu/drm/ttm/ttm_tt.c
··· 57 57 { 58 58 ttm->ttm.pages = drm_calloc_large(ttm->ttm.num_pages, 59 59 sizeof(*ttm->ttm.pages) + 60 - sizeof(*ttm->dma_address) + 61 - sizeof(*ttm->cpu_address)); 62 - ttm->cpu_address = (void *) (ttm->ttm.pages + ttm->ttm.num_pages); 63 - ttm->dma_address = (void *) (ttm->cpu_address + ttm->ttm.num_pages); 60 + sizeof(*ttm->dma_address)); 61 + ttm->dma_address = (void *) (ttm->ttm.pages + ttm->ttm.num_pages); 64 62 } 65 63 66 64 #ifdef CONFIG_X86 ··· 242 244 243 245 drm_free_large(ttm->pages); 244 246 ttm->pages = NULL; 245 - ttm_dma->cpu_address = NULL; 246 247 ttm_dma->dma_address = NULL; 247 248 } 248 249 EXPORT_SYMBOL(ttm_dma_tt_fini);
-2
include/drm/ttm/ttm_bo_driver.h
··· 133 133 * struct ttm_dma_tt 134 134 * 135 135 * @ttm: Base ttm_tt struct. 136 - * @cpu_address: The CPU address of the pages 137 136 * @dma_address: The DMA (bus) addresses of the pages 138 137 * @pages_list: used by some page allocation backend 139 138 * ··· 142 143 */ 143 144 struct ttm_dma_tt { 144 145 struct ttm_tt ttm; 145 - void **cpu_address; 146 146 dma_addr_t *dma_address; 147 147 struct list_head pages_list; 148 148 };