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

Revert "drm/ttm: Add a flag to allow drivers to skip clear-on-free"

Remove TTM_TT_FLAG_CLEARED_ON_FREE now that XE stopped using this
flag.

This reverts commit decbfaf06db05fa1f9b33149ebb3c145b44e878f.

Cc: Christian König <christian.koenig@amd.com>
Cc: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240828083635.23601-2-nirmoy.das@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>

authored by

Nirmoy Das and committed by
Lucas De Marchi
789e5159 7546a820

+8 -16
+7 -11
drivers/gpu/drm/ttm/ttm_pool.c
··· 222 222 } 223 223 224 224 /* Give pages into a specific pool_type */ 225 - static void ttm_pool_type_give(struct ttm_pool_type *pt, struct page *p, 226 - bool cleared) 225 + static void ttm_pool_type_give(struct ttm_pool_type *pt, struct page *p) 227 226 { 228 227 unsigned int i, num_pages = 1 << pt->order; 229 228 230 - if (!cleared) { 231 - for (i = 0; i < num_pages; ++i) { 232 - if (PageHighMem(p)) 233 - clear_highpage(p + i); 234 - else 235 - clear_page(page_address(p + i)); 236 - } 229 + for (i = 0; i < num_pages; ++i) { 230 + if (PageHighMem(p)) 231 + clear_highpage(p + i); 232 + else 233 + clear_page(page_address(p + i)); 237 234 } 238 235 239 236 spin_lock(&pt->lock); ··· 394 397 pgoff_t start_page, pgoff_t end_page) 395 398 { 396 399 struct page **pages = &tt->pages[start_page]; 397 - bool cleared = tt->page_flags & TTM_TT_FLAG_CLEARED_ON_FREE; 398 400 unsigned int order; 399 401 pgoff_t i, nr; 400 402 ··· 407 411 408 412 pt = ttm_pool_select_type(pool, caching, order); 409 413 if (pt) 410 - ttm_pool_type_give(pt, *pages, cleared); 414 + ttm_pool_type_give(pt, *pages); 411 415 else 412 416 ttm_pool_free_page(pool, caching, order, *pages); 413 417 }
+1 -5
include/drm/ttm/ttm_tt.h
··· 85 85 * fault handling abuses the DMA api a bit and dma_map_attrs can't be 86 86 * used to assure pgprot always matches. 87 87 * 88 - * TTM_TT_FLAG_CLEARED_ON_FREE: Set this if a drm driver handles 89 - * clearing backing store 90 - * 91 88 * TTM_TT_FLAG_PRIV_POPULATED: TTM internal only. DO NOT USE. This is 92 89 * set by TTM after ttm_tt_populate() has successfully returned, and is 93 90 * then unset when TTM calls ttm_tt_unpopulate(). ··· 94 97 #define TTM_TT_FLAG_EXTERNAL BIT(2) 95 98 #define TTM_TT_FLAG_EXTERNAL_MAPPABLE BIT(3) 96 99 #define TTM_TT_FLAG_DECRYPTED BIT(4) 97 - #define TTM_TT_FLAG_CLEARED_ON_FREE BIT(5) 98 100 99 - #define TTM_TT_FLAG_PRIV_POPULATED BIT(6) 101 + #define TTM_TT_FLAG_PRIV_POPULATED BIT(5) 100 102 uint32_t page_flags; 101 103 /** @num_pages: Number of pages in the page array. */ 102 104 uint32_t num_pages;