All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH v3 01/12] drm/ttm: stop setting page->index for the ttm_tt
@ 2021-09-15 18:59 ` Matthew Auld
  0 siblings, 0 replies; 47+ messages in thread
From: Matthew Auld @ 2021-09-15 18:59 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, Thomas Hellström, Christian König

In commit:

commit 58aa6622d32af7d2c08d45085f44c54554a16ed7
Author: Thomas Hellstrom <thellstrom@vmware.com>
Date:   Fri Jan 3 11:47:23 2014 +0100

    drm/ttm: Correctly set page mapping and -index members

we started setting the page->mapping and page->index to point to the
virtual address space, if the pages were faulted with TTM. Apparently
this was needed for core-mm to able to reverse lookup the virtual
address given the struct page, and potentially unmap it from the page
tables. However as pointed out by Thomas, since we are now using
PFN_MAP, instead of say PFN_MIXED, this should no longer be the case.

There was also apparently some usecase in vmwgfx which needed this for
dirty tracking, but that also doesn't appear to be the case anymore, as
pointed out by Thomas.

We still need keep the page->mapping for now, since that is still needed
for different reasons, but we try to address that in the next patch.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Christian König <christian.koenig@amd.com>
---
 drivers/gpu/drm/ttm/ttm_bo_vm.c | 2 --
 drivers/gpu/drm/ttm/ttm_tt.c    | 4 +---
 2 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_vm.c b/drivers/gpu/drm/ttm/ttm_bo_vm.c
index f56be5bc0861..906ec8a1bf5a 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_vm.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_vm.c
@@ -346,8 +346,6 @@ vm_fault_t ttm_bo_vm_fault_reserved(struct vm_fault *vmf,
 			} else if (unlikely(!page)) {
 				break;
 			}
-			page->index = drm_vma_node_start(&bo->base.vma_node) +
-				page_offset;
 			pfn = page_to_pfn(page);
 		}
 
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index dae52433beeb..1cc04c224988 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -367,10 +367,8 @@ static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
 	if (ttm->page_flags & TTM_PAGE_FLAG_SG)
 		return;
 
-	for (i = 0; i < ttm->num_pages; ++i) {
+	for (i = 0; i < ttm->num_pages; ++i)
 		(*page)->mapping = NULL;
-		(*page++)->index = 0;
-	}
 }
 
 void ttm_tt_unpopulate(struct ttm_device *bdev, struct ttm_tt *ttm)
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2021-09-16 13:46 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-09-15 18:59 [Intel-gfx] [PATCH v3 01/12] drm/ttm: stop setting page->index for the ttm_tt Matthew Auld
2021-09-15 18:59 ` Matthew Auld
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 02/12] drm/ttm: move ttm_tt_{add, clear}_mapping into amdgpu Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-16  6:45   ` [Intel-gfx] " Christian König
2021-09-16  6:45     ` [PATCH v3 02/12] drm/ttm: move ttm_tt_{add,clear}_mapping " Christian König
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 03/12] drm/ttm: remove TTM_PAGE_FLAG_NO_RETRY Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-16  6:46   ` [Intel-gfx] " Christian König
2021-09-16  6:46     ` Christian König
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 04/12] drm/ttm: s/FLAG_SG/FLAG_EXTERNAL/ Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-16  6:50   ` [Intel-gfx] " Christian König
2021-09-16  6:50     ` Christian König
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 05/12] drm/ttm: add some kernel-doc for TTM_PAGE_FLAG_* Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-16  6:52   ` [Intel-gfx] " Christian König
2021-09-16  6:52     ` Christian König
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 06/12] drm/ttm: add TTM_PAGE_FLAG_EXTERNAL_MAPPABLE Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-16  6:55   ` [Intel-gfx] " Christian König
2021-09-16  6:55     ` Christian König
2021-09-16  9:03     ` [Intel-gfx] " Thomas Hellström
2021-09-16  9:03       ` Thomas Hellström
2021-09-16  9:58       ` [Intel-gfx] " Matthew Auld
2021-09-16  9:58         ` Matthew Auld
2021-09-16 10:06         ` [Intel-gfx] " Thomas Hellström
2021-09-16 10:06           ` Thomas Hellström
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 07/12] drm/i915/gem: Break out some shmem backend utils Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 08/12] drm/i915/ttm: add tt shmem backend Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-16 13:45   ` [Intel-gfx] " Thomas Hellström
2021-09-16 13:45     ` Thomas Hellström
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 09/12] drm/i915/ttm: use cached system pages when evicting lmem Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 10/12] drm/i915: try to simplify make_{un}shrinkable Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 11/12] drm/i915/ttm: make evicted shmem pages visible to the shrinker Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-15 18:59 ` [Intel-gfx] [PATCH v3 12/12] drm/i915/ttm: enable shmem tt backend Matthew Auld
2021-09-15 18:59   ` Matthew Auld
2021-09-15 19:32 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [v3,01/12] drm/ttm: stop setting page->index for the ttm_tt Patchwork
2021-09-15 19:34 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-09-15 20:01 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-09-16  6:47 ` [Intel-gfx] [PATCH v3 01/12] " Christian König
2021-09-16  6:47   ` Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.