Skip to content

Commit 789e515

Browse files
nirmoylucasdemarchi
authored andcommitted
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 decbfaf. Cc: Christian König <[email protected]> Cc: Himal Prasad Ghimiray <[email protected]> Cc: Lucas De Marchi <[email protected]> Cc: Matthew Auld <[email protected]> Cc: Matthew Brost <[email protected]> Cc: Thomas Hellström <[email protected]> Signed-off-by: Nirmoy Das <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 7546a82 commit 789e515

File tree

2 files changed

+8
-16
lines changed

2 files changed

+8
-16
lines changed

drivers/gpu/drm/ttm/ttm_pool.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,15 @@ static void ttm_pool_unmap(struct ttm_pool *pool, dma_addr_t dma_addr,
222222
}
223223

224224
/* 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)
227226
{
228227
unsigned int i, num_pages = 1 << pt->order;
229228

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));
237234
}
238235

239236
spin_lock(&pt->lock);
@@ -397,7 +394,6 @@ static void ttm_pool_free_range(struct ttm_pool *pool, struct ttm_tt *tt,
397394
pgoff_t start_page, pgoff_t end_page)
398395
{
399396
struct page **pages = &tt->pages[start_page];
400-
bool cleared = tt->page_flags & TTM_TT_FLAG_CLEARED_ON_FREE;
401397
unsigned int order;
402398
pgoff_t i, nr;
403399

@@ -411,7 +407,7 @@ static void ttm_pool_free_range(struct ttm_pool *pool, struct ttm_tt *tt,
411407

412408
pt = ttm_pool_select_type(pool, caching, order);
413409
if (pt)
414-
ttm_pool_type_give(pt, *pages, cleared);
410+
ttm_pool_type_give(pt, *pages);
415411
else
416412
ttm_pool_free_page(pool, caching, order, *pages);
417413
}

include/drm/ttm/ttm_tt.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,6 @@ struct ttm_tt {
8585
* fault handling abuses the DMA api a bit and dma_map_attrs can't be
8686
* used to assure pgprot always matches.
8787
*
88-
* TTM_TT_FLAG_CLEARED_ON_FREE: Set this if a drm driver handles
89-
* clearing backing store
90-
*
9188
* TTM_TT_FLAG_PRIV_POPULATED: TTM internal only. DO NOT USE. This is
9289
* set by TTM after ttm_tt_populate() has successfully returned, and is
9390
* then unset when TTM calls ttm_tt_unpopulate().
@@ -97,9 +94,8 @@ struct ttm_tt {
9794
#define TTM_TT_FLAG_EXTERNAL BIT(2)
9895
#define TTM_TT_FLAG_EXTERNAL_MAPPABLE BIT(3)
9996
#define TTM_TT_FLAG_DECRYPTED BIT(4)
100-
#define TTM_TT_FLAG_CLEARED_ON_FREE BIT(5)
10197

102-
#define TTM_TT_FLAG_PRIV_POPULATED BIT(6)
98+
#define TTM_TT_FLAG_PRIV_POPULATED BIT(5)
10399
uint32_t page_flags;
104100
/** @num_pages: Number of pages in the page array. */
105101
uint32_t num_pages;

0 commit comments

Comments
 (0)