All of lore.kernel.org
 help / color / mirror / Atom feed
* (no subject)
@ 2020-09-15  2:40 Dave Airlie
  2020-09-15  2:40 ` [PATCH 1/7] drm/ttm/tt: add wrappers to set tt state Dave Airlie
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Dave Airlie @ 2020-09-15  2:40 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, bskeggs

The goal here is to make the ttm_tt object just represent a
memory backing store, and now whether the store is bound to a
global translation table. It moves binding up to the bo level.

There's a lot more work on removing the global TT from the core
of TTM, but this seems like a good start.

Dave.


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 1/7] drm/ttm/tt: add wrappers to set tt state.
  2020-09-15  2:40 Dave Airlie
@ 2020-09-15  2:40 ` Dave Airlie
  2020-09-15  2:40 ` [PATCH 2/7] drm/ttm: wrap tt destroy Dave Airlie
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Dave Airlie @ 2020-09-15  2:40 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, bskeggs

From: Dave Airlie <airlied@redhat.com>

This adds 2 getters and 4 setters, however unbound and populated
are currently the same thing, this will change, it also drops
a BUG_ON that seems not that useful.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c    |  4 +--
 drivers/gpu/drm/nouveau/nouveau_bo.c       |  4 +--
 drivers/gpu/drm/radeon/radeon_mn.c         |  2 +-
 drivers/gpu/drm/radeon/radeon_ttm.c        |  4 +--
 drivers/gpu/drm/ttm/ttm_bo_util.c          |  2 +-
 drivers/gpu/drm/ttm/ttm_page_alloc.c       |  6 ++--
 drivers/gpu/drm/ttm/ttm_page_alloc_dma.c   |  6 ++--
 drivers/gpu/drm/ttm/ttm_tt.c               | 20 ++++++--------
 drivers/gpu/drm/vmwgfx/vmwgfx_blit.c       |  4 +--
 drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c |  2 +-
 include/drm/ttm/ttm_tt.h                   | 32 +++++++++++++++++++++-
 11 files changed, 57 insertions(+), 29 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 6fc3af082f6f..568cb75900a3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1305,7 +1305,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_bo_device *bdev,
 			return -ENOMEM;
 
 		ttm->page_flags |= TTM_PAGE_FLAG_SG;
-		ttm->state = tt_unbound;
+		ttm_tt_set_populated(ttm);
 		return 0;
 	}
 
@@ -1325,7 +1325,7 @@ static int amdgpu_ttm_tt_populate(struct ttm_bo_device *bdev,
 		drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
 						 gtt->ttm.dma_address,
 						 ttm->num_pages);
-		ttm->state = tt_unbound;
+		ttm_tt_set_populated(ttm);
 		return 0;
 	}
 
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 97e1908eada0..3ab9397fac40 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -1282,14 +1282,14 @@ nouveau_ttm_tt_populate(struct ttm_bo_device *bdev,
 	struct device *dev;
 	bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
 
-	if (ttm->state != tt_unpopulated)
+	if (ttm_tt_is_populated(ttm))
 		return 0;
 
 	if (slave && ttm->sg) {
 		/* make userspace faulting work */
 		drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
 						 ttm_dma->dma_address, ttm->num_pages);
-		ttm->state = tt_unbound;
+		ttm_tt_set_populated(ttm);
 		return 0;
 	}
 
diff --git a/drivers/gpu/drm/radeon/radeon_mn.c b/drivers/gpu/drm/radeon/radeon_mn.c
index f93829f08a4d..b6293fb91030 100644
--- a/drivers/gpu/drm/radeon/radeon_mn.c
+++ b/drivers/gpu/drm/radeon/radeon_mn.c
@@ -53,7 +53,7 @@ static bool radeon_mn_invalidate(struct mmu_interval_notifier *mn,
 	struct ttm_operation_ctx ctx = { false, false };
 	long r;
 
-	if (!bo->tbo.ttm || bo->tbo.ttm->state != tt_bound)
+	if (!bo->tbo.ttm || !ttm_tt_is_bound(bo->tbo.ttm))
 		return true;
 
 	if (!mmu_notifier_range_blockable(range))
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 602a591a53dc..7aa3d03ddeb9 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -615,14 +615,14 @@ static int radeon_ttm_tt_populate(struct ttm_bo_device *bdev,
 			return -ENOMEM;
 
 		ttm->page_flags |= TTM_PAGE_FLAG_SG;
-		ttm->state = tt_unbound;
+		ttm_tt_set_populated(ttm);
 		return 0;
 	}
 
 	if (slave && ttm->sg) {
 		drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,
 						 gtt->ttm.dma_address, ttm->num_pages);
-		ttm->state = tt_unbound;
+		ttm_tt_set_populated(ttm);
 		return 0;
 	}
 
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 1b56432dfa43..44b47ccdeaf7 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -249,7 +249,7 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
 	 * Don't move nonexistent data. Clear destination instead.
 	 */
 	if (old_iomap == NULL &&
-	    (ttm == NULL || (ttm->state == tt_unpopulated &&
+	    (ttm == NULL || (!ttm_tt_is_populated(ttm) &&
 			     !(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)))) {
 		memset_io(new_iomap, 0, new_mem->num_pages*PAGE_SIZE);
 		goto out2;
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index b40a4678c296..14660f723f71 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -1044,7 +1044,7 @@ ttm_pool_unpopulate_helper(struct ttm_tt *ttm, unsigned mem_count_update)
 put_pages:
 	ttm_put_pages(ttm->pages, ttm->num_pages, ttm->page_flags,
 		      ttm->caching_state);
-	ttm->state = tt_unpopulated;
+	ttm_tt_set_unpopulated(ttm);
 }
 
 int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
@@ -1053,7 +1053,7 @@ int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
 	unsigned i;
 	int ret;
 
-	if (ttm->state != tt_unpopulated)
+	if (ttm_tt_is_populated(ttm))
 		return 0;
 
 	if (ttm_check_under_lowerlimit(mem_glob, ttm->num_pages, ctx))
@@ -1083,7 +1083,7 @@ int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
 		}
 	}
 
-	ttm->state = tt_unbound;
+	ttm_tt_set_populated(ttm);
 	return 0;
 }
 EXPORT_SYMBOL(ttm_pool_populate);
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
index faefaaef7909..5e2df11685e7 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c
@@ -894,7 +894,7 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev,
 	unsigned i;
 	int ret;
 
-	if (ttm->state != tt_unpopulated)
+	if (ttm_tt_is_populated(ttm))
 		return 0;
 
 	if (ttm_check_under_lowerlimit(mem_glob, num_pages, ctx))
@@ -982,7 +982,7 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev,
 		}
 	}
 
-	ttm->state = tt_unbound;
+	ttm_tt_set_populated(ttm);
 	return 0;
 }
 EXPORT_SYMBOL_GPL(ttm_dma_populate);
@@ -1076,7 +1076,7 @@ void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev)
 	/* shrink pool if necessary (only on !is_cached pools)*/
 	if (npages)
 		ttm_dma_page_pool_free(pool, npages, false);
-	ttm->state = tt_unpopulated;
+	ttm_tt_set_unpopulated(ttm);
 }
 EXPORT_SYMBOL_GPL(ttm_dma_unpopulate);
 
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 67aa7fe39432..ff3d953aa90e 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -156,7 +156,7 @@ static int ttm_tt_set_caching(struct ttm_tt *ttm,
 	if (ttm->caching_state == c_state)
 		return 0;
 
-	if (ttm->state == tt_unpopulated) {
+	if (!ttm_tt_is_populated(ttm)) {
 		/* Change caching but don't populate */
 		ttm->caching_state = c_state;
 		return 0;
@@ -214,8 +214,7 @@ void ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
 
 	ttm_tt_unbind(bdev, ttm);
 
-	if (ttm->state == tt_unbound)
-		ttm_tt_unpopulate(bdev, ttm);
+	ttm_tt_unpopulate(bdev, ttm);
 
 	if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP) &&
 	    ttm->swap_storage)
@@ -232,7 +231,7 @@ static void ttm_tt_init_fields(struct ttm_tt *ttm,
 	ttm->num_pages = bo->num_pages;
 	ttm->caching_state = tt_cached;
 	ttm->page_flags = page_flags;
-	ttm->state = tt_unpopulated;
+	ttm_tt_set_unpopulated(ttm);
 	ttm->swap_storage = NULL;
 	ttm->sg = bo->sg;
 }
@@ -309,9 +308,9 @@ EXPORT_SYMBOL(ttm_dma_tt_fini);
 
 void ttm_tt_unbind(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
 {
-	if (ttm->state == tt_bound) {
+	if (ttm_tt_is_bound(ttm)) {
 		bdev->driver->ttm_tt_unbind(bdev, ttm);
-		ttm->state = tt_unbound;
+		ttm_tt_set_unbound(ttm);
 	}
 }
 
@@ -324,7 +323,7 @@ int ttm_tt_bind(struct ttm_bo_device *bdev,
 	if (!ttm)
 		return -EINVAL;
 
-	if (ttm->state == tt_bound)
+	if (ttm_tt_is_bound(ttm))
 		return 0;
 
 	ret = ttm_tt_populate(bdev, ttm, ctx);
@@ -335,7 +334,7 @@ int ttm_tt_bind(struct ttm_bo_device *bdev,
 	if (unlikely(ret != 0))
 		return ret;
 
-	ttm->state = tt_bound;
+	ttm_tt_set_bound(ttm);
 
 	return 0;
 }
@@ -393,7 +392,6 @@ int ttm_tt_swapout(struct ttm_bo_device *bdev,
 	int i;
 	int ret = -ENOMEM;
 
-	BUG_ON(ttm->state != tt_unbound && ttm->state != tt_unpopulated);
 	BUG_ON(ttm->caching_state != tt_cached);
 
 	if (!persistent_swap_storage) {
@@ -460,7 +458,7 @@ int ttm_tt_populate(struct ttm_bo_device *bdev,
 {
 	int ret;
 
-	if (ttm->state != tt_unpopulated)
+	if (ttm_tt_is_populated(ttm))
 		return 0;
 
 	if (bdev->driver->ttm_tt_populate)
@@ -489,7 +487,7 @@ static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
 void ttm_tt_unpopulate(struct ttm_bo_device *bdev,
 		       struct ttm_tt *ttm)
 {
-	if (ttm->state == tt_unpopulated)
+	if (!ttm_tt_is_populated(ttm))
 		return;
 
 	ttm_tt_clear_mapping(ttm);
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c
index 0cd21590ded9..e8d66182cd7b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_blit.c
@@ -464,13 +464,13 @@ int vmw_bo_cpu_blit(struct ttm_buffer_object *dst,
 	if (!(src->mem.placement & TTM_PL_FLAG_NO_EVICT))
 		dma_resv_assert_held(src->base.resv);
 
-	if (dst->ttm->state == tt_unpopulated) {
+	if (!ttm_tt_is_populated(dst->ttm)) {
 		ret = dst->bdev->driver->ttm_tt_populate(dst->bdev, dst->ttm, &ctx);
 		if (ret)
 			return ret;
 	}
 
-	if (src->ttm->state == tt_unpopulated) {
+	if (!ttm_tt_is_populated(src->ttm)) {
 		ret = src->bdev->driver->ttm_tt_populate(src->bdev, src->ttm, &ctx);
 		if (ret)
 			return ret;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
index 03aa0fc5e753..3458c5c3531d 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
@@ -644,7 +644,7 @@ static int vmw_ttm_populate(struct ttm_bo_device *bdev,
 	struct ttm_mem_global *glob = vmw_mem_glob(dev_priv);
 	int ret;
 
-	if (ttm->state != tt_unpopulated)
+	if (ttm_tt_is_populated(ttm))
 		return 0;
 
 	if (dev_priv->map_mode == vmw_dma_alloc_coherent) {
diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
index 146544ba1c10..86ae759ff018 100644
--- a/include/drm/ttm/ttm_tt.h
+++ b/include/drm/ttm/ttm_tt.h
@@ -74,9 +74,39 @@ struct ttm_tt {
 		tt_bound,
 		tt_unbound,
 		tt_unpopulated,
-	} state;
+	} _state;
 };
 
+static inline bool ttm_tt_is_populated(struct ttm_tt *tt)
+{
+	return tt->_state != tt_unpopulated;
+}
+
+static inline bool ttm_tt_is_bound(struct ttm_tt *tt)
+{
+	return tt->_state == tt_bound;
+}
+
+static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt)
+{
+	tt->_state = tt_unpopulated;
+}
+
+static inline void ttm_tt_set_populated(struct ttm_tt *tt)
+{
+	tt->_state = tt_unbound;
+}
+
+static inline void ttm_tt_set_unbound(struct ttm_tt *tt)
+{
+	tt->_state = tt_unbound;
+}
+
+static inline void ttm_tt_set_bound(struct ttm_tt *tt)
+{
+	tt->_state = tt_bound;
+}
+
 /**
  * struct ttm_dma_tt
  *
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 2/7] drm/ttm: wrap tt destroy.
  2020-09-15  2:40 Dave Airlie
  2020-09-15  2:40 ` [PATCH 1/7] drm/ttm/tt: add wrappers to set tt state Dave Airlie
@ 2020-09-15  2:40 ` Dave Airlie
  2020-09-15  7:47   ` Christian König
  2020-09-15  2:40 ` [PATCH 3/7] drm/ttm: tt destroy move null check to outer function Dave Airlie
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Dave Airlie @ 2020-09-15  2:40 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, bskeggs

From: Dave Airlie <airlied@redhat.com>

All places this was called was using bo->ttm either direct
or indirectly.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c      |  9 +++------
 drivers/gpu/drm/ttm/ttm_bo_util.c | 24 ++++++++++++------------
 include/drm/ttm/ttm_bo_driver.h   |  5 +++++
 3 files changed, 20 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index e2bfe3a13c63..9aae9e1bd8e8 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -301,10 +301,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
 
 out_err:
 	new_man = ttm_manager_type(bdev, bo->mem.mem_type);
-	if (!new_man->use_tt) {
-		ttm_tt_destroy(bdev, bo->ttm);
-		bo->ttm = NULL;
-	}
+	if (!new_man->use_tt)
+		ttm_bo_tt_destroy(bo);
 
 	return ret;
 }
@@ -322,8 +320,7 @@ static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo)
 	if (bo->bdev->driver->move_notify)
 		bo->bdev->driver->move_notify(bo, false, NULL);
 
-	ttm_tt_destroy(bo->bdev, bo->ttm);
-	bo->ttm = NULL;
+	ttm_bo_tt_destroy(bo);
 	ttm_resource_free(bo, &bo->mem);
 }
 
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 44b47ccdeaf7..0ddaaa1ddafd 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -297,10 +297,8 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
 	*old_mem = *new_mem;
 	new_mem->mm_node = NULL;
 
-	if (!man->use_tt) {
-		ttm_tt_destroy(bdev, ttm);
-		bo->ttm = NULL;
-	}
+	if (!man->use_tt)
+		ttm_bo_tt_destroy(bo);
 
 out1:
 	ttm_resource_iounmap(bdev, old_mem, new_iomap);
@@ -542,10 +540,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
 		if (ret)
 			return ret;
 
-		if (!man->use_tt) {
-			ttm_tt_destroy(bdev, bo->ttm);
-			bo->ttm = NULL;
-		}
+		if (!man->use_tt)
+			ttm_bo_tt_destroy(bo);
 		ttm_bo_free_old_node(bo);
 	} else {
 		/**
@@ -665,10 +661,8 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
 		if (ret)
 			return ret;
 
-		if (!to->use_tt) {
-			ttm_tt_destroy(bdev, bo->ttm);
-			bo->ttm = NULL;
-		}
+		if (!to->use_tt)
+			ttm_bo_tt_destroy(bo);
 		ttm_bo_free_old_node(bo);
 	}
 
@@ -702,3 +696,9 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
 
 	return 0;
 }
+
+void ttm_bo_tt_destroy(struct ttm_buffer_object *bo)
+{
+	ttm_tt_destroy(bo->bdev, bo->ttm);
+	bo->ttm = NULL;
+}
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 303a89d1066d..c2e93f04d0ad 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -684,6 +684,11 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo);
  */
 pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp);
 
+/**
+ * ttm_bo_tt_destroy.
+ */
+void ttm_bo_tt_destroy(struct ttm_buffer_object *bo);
+
 /**
  * ttm_range_man_init
  *
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 3/7] drm/ttm: tt destroy move null check to outer function.
  2020-09-15  2:40 Dave Airlie
  2020-09-15  2:40 ` [PATCH 1/7] drm/ttm/tt: add wrappers to set tt state Dave Airlie
  2020-09-15  2:40 ` [PATCH 2/7] drm/ttm: wrap tt destroy Dave Airlie
@ 2020-09-15  2:40 ` Dave Airlie
  2020-09-15  2:40 ` [PATCH 4/7] drm/ttm: split populate out from binding Dave Airlie
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Dave Airlie @ 2020-09-15  2:40 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, bskeggs

From: Dave Airlie <airlied@redhat.com>

This just makes things easier later.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/ttm/ttm_bo_util.c | 2 ++
 drivers/gpu/drm/ttm/ttm_tt.c      | 3 ---
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 0ddaaa1ddafd..f3452a1624fd 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -699,6 +699,8 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
 
 void ttm_bo_tt_destroy(struct ttm_buffer_object *bo)
 {
+	if (bo->ttm == NULL)
+		return;
 	ttm_tt_destroy(bo->bdev, bo->ttm);
 	bo->ttm = NULL;
 }
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index ff3d953aa90e..381face3cedb 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -209,9 +209,6 @@ EXPORT_SYMBOL(ttm_tt_set_placement_caching);
 
 void ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
 {
-	if (ttm == NULL)
-		return;
-
 	ttm_tt_unbind(bdev, ttm);
 
 	ttm_tt_unpopulate(bdev, ttm);
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 4/7] drm/ttm: split populate out from binding.
  2020-09-15  2:40 Dave Airlie
                   ` (2 preceding siblings ...)
  2020-09-15  2:40 ` [PATCH 3/7] drm/ttm: tt destroy move null check to outer function Dave Airlie
@ 2020-09-15  2:40 ` Dave Airlie
  2020-09-15  7:50   ` Christian König
  2020-09-15  2:40 ` [PATCH 5/7] drm/ttm: move ttm binding/unbinding out of ttm_tt paths Dave Airlie
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Dave Airlie @ 2020-09-15  2:40 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, bskeggs

From: Dave Airlie <airlied@redhat.com>

Drivers have to call populate themselves now before binding.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c |  7 ++++++-
 drivers/gpu/drm/nouveau/nouveau_bo.c    |  6 +++++-
 drivers/gpu/drm/radeon/radeon_ttm.c     |  7 ++++++-
 drivers/gpu/drm/ttm/ttm_bo.c            |  6 +++++-
 drivers/gpu/drm/ttm/ttm_bo_util.c       |  7 ++++++-
 drivers/gpu/drm/ttm/ttm_tt.c            | 11 +++++------
 include/drm/ttm/ttm_tt.h                |  3 +--
 7 files changed, 34 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 568cb75900a3..dc73cce515b2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -548,8 +548,13 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
 		goto out_cleanup;
 	}
 
+	r = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
+	if (unlikely(r)) {
+		goto out_cleanup;
+	}
+
 	/* Bind the memory to the GTT space */
-	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem, ctx);
+	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem);
 	if (unlikely(r)) {
 		goto out_cleanup;
 	}
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 3ab9397fac40..3a1032d01808 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -904,7 +904,11 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr,
 	if (ret)
 		return ret;
 
-	ret = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg, &ctx);
+	ret = ttm_tt_populate(bo->bdev, bo->ttm, &ctx);
+	if (ret)
+		goto out;
+
+	ret = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg);
 	if (ret)
 		goto out;
 
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 7aa3d03ddeb9..2bc6991fb7e9 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -237,7 +237,12 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
 		goto out_cleanup;
 	}
 
-	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem, &ctx);
+	r = ttm_tt_populate(bo->bdev, bo->ttm, &ctx);
+	if (unlikely(r)) {
+		goto out_cleanup;
+	}
+
+	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem);
 	if (unlikely(r)) {
 		goto out_cleanup;
 	}
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 9aae9e1bd8e8..32eaf809b7c9 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -260,7 +260,11 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
 			goto out_err;
 
 		if (mem->mem_type != TTM_PL_SYSTEM) {
-			ret = ttm_tt_bind(bdev, bo->ttm, mem, ctx);
+			ret = ttm_tt_populate(bdev, bo->ttm, ctx);
+			if (ret)
+				goto out_err;
+
+			ret = ttm_tt_bind(bdev, bo->ttm, mem);
 			if (ret)
 				goto out_err;
 		}
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index f3452a1624fd..2354046bda9a 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -77,7 +77,12 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
 		return ret;
 
 	if (new_mem->mem_type != TTM_PL_SYSTEM) {
-		ret = ttm_tt_bind(bo->bdev, ttm, new_mem, ctx);
+
+		ret = ttm_tt_populate(bo->bdev, ttm, ctx);
+		if (unlikely(ret != 0))
+			return ret;
+
+		ret = ttm_tt_bind(bo->bdev, ttm, new_mem);
 		if (unlikely(ret != 0))
 			return ret;
 	}
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 381face3cedb..93d65e5e4205 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -312,8 +312,7 @@ void ttm_tt_unbind(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
 }
 
 int ttm_tt_bind(struct ttm_bo_device *bdev,
-		struct ttm_tt *ttm, struct ttm_resource *bo_mem,
-		struct ttm_operation_ctx *ctx)
+		struct ttm_tt *ttm, struct ttm_resource *bo_mem)
 {
 	int ret = 0;
 
@@ -323,10 +322,6 @@ int ttm_tt_bind(struct ttm_bo_device *bdev,
 	if (ttm_tt_is_bound(ttm))
 		return 0;
 
-	ret = ttm_tt_populate(bdev, ttm, ctx);
-	if (ret)
-		return ret;
-
 	ret = bdev->driver->ttm_tt_bind(bdev, ttm, bo_mem);
 	if (unlikely(ret != 0))
 		return ret;
@@ -455,6 +450,9 @@ int ttm_tt_populate(struct ttm_bo_device *bdev,
 {
 	int ret;
 
+	if (!ttm)
+		return -EINVAL;
+
 	if (ttm_tt_is_populated(ttm))
 		return 0;
 
@@ -466,6 +464,7 @@ int ttm_tt_populate(struct ttm_bo_device *bdev,
 		ttm_tt_add_mapping(bdev, ttm);
 	return ret;
 }
+EXPORT_SYMBOL(ttm_tt_populate);
 
 static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
 {
diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
index 86ae759ff018..8f57d86ee67b 100644
--- a/include/drm/ttm/ttm_tt.h
+++ b/include/drm/ttm/ttm_tt.h
@@ -173,8 +173,7 @@ void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma);
  * Bind the pages of @ttm to an aperture location identified by @bo_mem
  */
 int ttm_tt_bind(struct ttm_bo_device *bdev,
-		struct ttm_tt *ttm, struct ttm_resource *bo_mem,
-		struct ttm_operation_ctx *ctx);
+		struct ttm_tt *ttm, struct ttm_resource *bo_mem);
 
 /**
  * ttm_ttm_destroy:
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 5/7] drm/ttm: move ttm binding/unbinding out of ttm_tt paths.
  2020-09-15  2:40 Dave Airlie
                   ` (3 preceding siblings ...)
  2020-09-15  2:40 ` [PATCH 4/7] drm/ttm: split populate out from binding Dave Airlie
@ 2020-09-15  2:40 ` Dave Airlie
  2020-09-15  2:40 ` [PATCH 6/7] drm/ttm: split bound/populated flags Dave Airlie
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Dave Airlie @ 2020-09-15  2:40 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, bskeggs

From: Dave Airlie <airlied@redhat.com>

Move these up to the bo level, moving ttm_tt to just being
backing store. Next step is to move the bound flag out.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c |  2 +-
 drivers/gpu/drm/nouveau/nouveau_bo.c    |  2 +-
 drivers/gpu/drm/radeon/radeon_mn.c      |  2 +-
 drivers/gpu/drm/radeon/radeon_ttm.c     |  2 +-
 drivers/gpu/drm/ttm/ttm_bo.c            |  2 +-
 drivers/gpu/drm/ttm/ttm_bo_util.c       | 33 +++++++++++++++++++++--
 drivers/gpu/drm/ttm/ttm_tt.c            | 31 ----------------------
 include/drm/ttm/ttm_bo_driver.h         | 28 ++++++++++++++++++++
 include/drm/ttm/ttm_tt.h                | 35 -------------------------
 9 files changed, 64 insertions(+), 73 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index dc73cce515b2..76a796eab901 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -554,7 +554,7 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
 	}
 
 	/* Bind the memory to the GTT space */
-	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem);
+	r = ttm_bo_tt_bind(bo, &tmp_mem);
 	if (unlikely(r)) {
 		goto out_cleanup;
 	}
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index 3a1032d01808..ec995215de97 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -908,7 +908,7 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr,
 	if (ret)
 		goto out;
 
-	ret = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg);
+	ret = ttm_bo_tt_bind(bo, &tmp_reg);
 	if (ret)
 		goto out;
 
diff --git a/drivers/gpu/drm/radeon/radeon_mn.c b/drivers/gpu/drm/radeon/radeon_mn.c
index b6293fb91030..eb46d2220236 100644
--- a/drivers/gpu/drm/radeon/radeon_mn.c
+++ b/drivers/gpu/drm/radeon/radeon_mn.c
@@ -53,7 +53,7 @@ static bool radeon_mn_invalidate(struct mmu_interval_notifier *mn,
 	struct ttm_operation_ctx ctx = { false, false };
 	long r;
 
-	if (!bo->tbo.ttm || !ttm_tt_is_bound(bo->tbo.ttm))
+	if (!bo->tbo.ttm || !ttm_bo_tt_is_bound(&bo->tbo))
 		return true;
 
 	if (!mmu_notifier_range_blockable(range))
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 2bc6991fb7e9..228175790457 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -242,7 +242,7 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
 		goto out_cleanup;
 	}
 
-	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem);
+	r = ttm_bo_tt_bind(bo, &tmp_mem);
 	if (unlikely(r)) {
 		goto out_cleanup;
 	}
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 32eaf809b7c9..abc88f713fc6 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -264,7 +264,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
 			if (ret)
 				goto out_err;
 
-			ret = ttm_tt_bind(bdev, bo->ttm, mem);
+			ret = ttm_bo_tt_bind(bo, mem);
 			if (ret)
 				goto out_err;
 		}
diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 2354046bda9a..4c5c9a333c74 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -67,7 +67,7 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
 			return ret;
 		}
 
-		ttm_tt_unbind(bo->bdev, ttm);
+		ttm_bo_tt_unbind(bo);
 		ttm_bo_free_old_node(bo);
 		old_mem->mem_type = TTM_PL_SYSTEM;
 	}
@@ -82,7 +82,7 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
 		if (unlikely(ret != 0))
 			return ret;
 
-		ret = ttm_tt_bind(bo->bdev, ttm, new_mem);
+		ret = ttm_bo_tt_bind(bo, new_mem);
 		if (unlikely(ret != 0))
 			return ret;
 	}
@@ -706,6 +706,35 @@ void ttm_bo_tt_destroy(struct ttm_buffer_object *bo)
 {
 	if (bo->ttm == NULL)
 		return;
+
+	ttm_bo_tt_unbind(bo);
 	ttm_tt_destroy(bo->bdev, bo->ttm);
 	bo->ttm = NULL;
 }
+
+int ttm_bo_tt_bind(struct ttm_buffer_object *bo, struct ttm_resource *mem)
+{
+	int ret;
+
+	if (!bo->ttm)
+		return -EINVAL;
+
+	if (ttm_bo_tt_is_bound(bo))
+		return 0;
+
+	ret = bo->bdev->driver->ttm_tt_bind(bo->bdev, bo->ttm, mem);
+	if (unlikely(ret != 0))
+		return ret;
+
+	ttm_bo_tt_set_bound(bo);
+	return 0;
+}
+EXPORT_SYMBOL(ttm_bo_tt_bind);
+
+void ttm_bo_tt_unbind(struct ttm_buffer_object *bo)
+{
+	if (ttm_bo_tt_is_bound(bo)) {
+		bo->bdev->driver->ttm_tt_unbind(bo->bdev, bo->ttm);
+		ttm_bo_tt_set_unbound(bo);
+	}
+}
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
index 93d65e5e4205..a4f0296effac 100644
--- a/drivers/gpu/drm/ttm/ttm_tt.c
+++ b/drivers/gpu/drm/ttm/ttm_tt.c
@@ -209,8 +209,6 @@ EXPORT_SYMBOL(ttm_tt_set_placement_caching);
 
 void ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
 {
-	ttm_tt_unbind(bdev, ttm);
-
 	ttm_tt_unpopulate(bdev, ttm);
 
 	if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP) &&
@@ -303,35 +301,6 @@ void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma)
 }
 EXPORT_SYMBOL(ttm_dma_tt_fini);
 
-void ttm_tt_unbind(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
-{
-	if (ttm_tt_is_bound(ttm)) {
-		bdev->driver->ttm_tt_unbind(bdev, ttm);
-		ttm_tt_set_unbound(ttm);
-	}
-}
-
-int ttm_tt_bind(struct ttm_bo_device *bdev,
-		struct ttm_tt *ttm, struct ttm_resource *bo_mem)
-{
-	int ret = 0;
-
-	if (!ttm)
-		return -EINVAL;
-
-	if (ttm_tt_is_bound(ttm))
-		return 0;
-
-	ret = bdev->driver->ttm_tt_bind(bdev, ttm, bo_mem);
-	if (unlikely(ret != 0))
-		return ret;
-
-	ttm_tt_set_bound(ttm);
-
-	return 0;
-}
-EXPORT_SYMBOL(ttm_tt_bind);
-
 int ttm_tt_swapin(struct ttm_tt *ttm)
 {
 	struct address_space *swap_space;
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index c2e93f04d0ad..0112619f6172 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -684,6 +684,34 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo);
  */
 pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp);
 
+/**
+ * ttm_bo_tt_bind
+ *
+ * Bind the object tt to a memory resource.
+ */
+int ttm_bo_tt_bind(struct ttm_buffer_object *bo, struct ttm_resource *mem);
+
+/**
+ * ttm_bo_tt_bind
+ *
+ * Unbind the object tt from a memory resource.
+ */
+void ttm_bo_tt_unbind(struct ttm_buffer_object *bo);
+
+static inline bool ttm_bo_tt_is_bound(struct ttm_buffer_object *bo)
+{
+	return bo->ttm->_state == tt_bound;
+}
+
+static inline void ttm_bo_tt_set_unbound(struct ttm_buffer_object *bo)
+{
+	bo->ttm->_state = tt_unbound;
+}
+
+static inline void ttm_bo_tt_set_bound(struct ttm_buffer_object *bo)
+{
+	bo->ttm->_state = tt_bound;
+}
 /**
  * ttm_bo_tt_destroy.
  */
diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
index 8f57d86ee67b..1ac56730d952 100644
--- a/include/drm/ttm/ttm_tt.h
+++ b/include/drm/ttm/ttm_tt.h
@@ -82,11 +82,6 @@ static inline bool ttm_tt_is_populated(struct ttm_tt *tt)
 	return tt->_state != tt_unpopulated;
 }
 
-static inline bool ttm_tt_is_bound(struct ttm_tt *tt)
-{
-	return tt->_state == tt_bound;
-}
-
 static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt)
 {
 	tt->_state = tt_unpopulated;
@@ -97,16 +92,6 @@ static inline void ttm_tt_set_populated(struct ttm_tt *tt)
 	tt->_state = tt_unbound;
 }
 
-static inline void ttm_tt_set_unbound(struct ttm_tt *tt)
-{
-	tt->_state = tt_unbound;
-}
-
-static inline void ttm_tt_set_bound(struct ttm_tt *tt)
-{
-	tt->_state = tt_bound;
-}
-
 /**
  * struct ttm_dma_tt
  *
@@ -164,17 +149,6 @@ int ttm_sg_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_buffer_object *bo,
 void ttm_tt_fini(struct ttm_tt *ttm);
 void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma);
 
-/**
- * ttm_ttm_bind:
- *
- * @ttm: The struct ttm_tt containing backing pages.
- * @bo_mem: The struct ttm_resource identifying the binding location.
- *
- * Bind the pages of @ttm to an aperture location identified by @bo_mem
- */
-int ttm_tt_bind(struct ttm_bo_device *bdev,
-		struct ttm_tt *ttm, struct ttm_resource *bo_mem);
-
 /**
  * ttm_ttm_destroy:
  *
@@ -184,15 +158,6 @@ int ttm_tt_bind(struct ttm_bo_device *bdev,
  */
 void ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *ttm);
 
-/**
- * ttm_ttm_unbind:
- *
- * @ttm: The struct ttm_tt.
- *
- * Unbind a struct ttm_tt.
- */
-void ttm_tt_unbind(struct ttm_bo_device *bdev, struct ttm_tt *ttm);
-
 /**
  * ttm_tt_swapin:
  *
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 6/7] drm/ttm: split bound/populated flags.
  2020-09-15  2:40 Dave Airlie
                   ` (4 preceding siblings ...)
  2020-09-15  2:40 ` [PATCH 5/7] drm/ttm: move ttm binding/unbinding out of ttm_tt paths Dave Airlie
@ 2020-09-15  2:40 ` Dave Airlie
  2020-09-15  2:40 ` [PATCH 7/7] drm/ttm: move populated state into page flags Dave Airlie
  2020-09-15  7:53 ` Christian König
  7 siblings, 0 replies; 11+ messages in thread
From: Dave Airlie @ 2020-09-15  2:40 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, bskeggs

From: Dave Airlie <airlied@redhat.com>

Move bound up into the bo object, and keep populated with the tt
object.

The ghost object handling needs to follow the flags at the bo
level now instead of it being part of the ttm tt object.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/ttm/ttm_bo_util.c | 15 +++++++++++----
 include/drm/ttm/ttm_bo_api.h      |  1 +
 include/drm/ttm/ttm_bo_driver.h   |  6 +++---
 include/drm/ttm/ttm_tt.h          | 12 ++++--------
 4 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
index 4c5c9a333c74..6b0320252a60 100644
--- a/drivers/gpu/drm/ttm/ttm_bo_util.c
+++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
@@ -572,10 +572,13 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
 		 * bo to be unbound and destroyed.
 		 */
 
-		if (man->use_tt)
+		if (man->use_tt) {
 			ghost_obj->ttm = NULL;
-		else
+			ttm_bo_tt_set_unbound(ghost_obj);
+		} else {
 			bo->ttm = NULL;
+			ttm_bo_tt_set_unbound(bo);
+		}
 
 		dma_resv_unlock(&ghost_obj->base._resv);
 		ttm_bo_put(ghost_obj);
@@ -628,10 +631,13 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
 		 * bo to be unbound and destroyed.
 		 */
 
-		if (to->use_tt)
+		if (to->use_tt) {
 			ghost_obj->ttm = NULL;
-		else
+			ttm_bo_tt_set_unbound(ghost_obj);
+		} else {
 			bo->ttm = NULL;
+			ttm_bo_tt_set_unbound(bo);
+		}
 
 		dma_resv_unlock(&ghost_obj->base._resv);
 		ttm_bo_put(ghost_obj);
@@ -695,6 +701,7 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
 	memset(&bo->mem, 0, sizeof(bo->mem));
 	bo->mem.mem_type = TTM_PL_SYSTEM;
 	bo->ttm = NULL;
+	ttm_bo_tt_set_unbound(bo);
 
 	dma_resv_unlock(&ghost->base._resv);
 	ttm_bo_put(ghost);
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 36ff64e2736c..1d20a7f15a7a 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -141,6 +141,7 @@ struct ttm_buffer_object {
 	struct ttm_resource mem;
 	struct file *persistent_swap_storage;
 	struct ttm_tt *ttm;
+	bool ttm_bound;
 	bool evicted;
 	bool deleted;
 
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 0112619f6172..0677e2582ff8 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -700,17 +700,17 @@ void ttm_bo_tt_unbind(struct ttm_buffer_object *bo);
 
 static inline bool ttm_bo_tt_is_bound(struct ttm_buffer_object *bo)
 {
-	return bo->ttm->_state == tt_bound;
+	return bo->ttm_bound;
 }
 
 static inline void ttm_bo_tt_set_unbound(struct ttm_buffer_object *bo)
 {
-	bo->ttm->_state = tt_unbound;
+	bo->ttm_bound = false;
 }
 
 static inline void ttm_bo_tt_set_bound(struct ttm_buffer_object *bo)
 {
-	bo->ttm->_state = tt_bound;
+	bo->ttm_bound = true;
 }
 /**
  * ttm_bo_tt_destroy.
diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
index 1ac56730d952..94e16238c93d 100644
--- a/include/drm/ttm/ttm_tt.h
+++ b/include/drm/ttm/ttm_tt.h
@@ -70,26 +70,22 @@ struct ttm_tt {
 	struct sg_table *sg; /* for SG objects via dma-buf */
 	struct file *swap_storage;
 	enum ttm_caching_state caching_state;
-	enum {
-		tt_bound,
-		tt_unbound,
-		tt_unpopulated,
-	} _state;
+	bool populated;
 };
 
 static inline bool ttm_tt_is_populated(struct ttm_tt *tt)
 {
-	return tt->_state != tt_unpopulated;
+	return tt->populated;
 }
 
 static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt)
 {
-	tt->_state = tt_unpopulated;
+	tt->populated = false;
 }
 
 static inline void ttm_tt_set_populated(struct ttm_tt *tt)
 {
-	tt->_state = tt_unbound;
+	tt->populated = true;
 }
 
 /**
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH 7/7] drm/ttm: move populated state into page flags
  2020-09-15  2:40 Dave Airlie
                   ` (5 preceding siblings ...)
  2020-09-15  2:40 ` [PATCH 6/7] drm/ttm: split bound/populated flags Dave Airlie
@ 2020-09-15  2:40 ` Dave Airlie
  2020-09-15  7:53 ` Christian König
  7 siblings, 0 replies; 11+ messages in thread
From: Dave Airlie @ 2020-09-15  2:40 UTC (permalink / raw)
  To: dri-devel; +Cc: christian.koenig, bskeggs

From: Dave Airlie <airlied@redhat.com>

Just use the top bit of page flags to store the populated state.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 include/drm/ttm/ttm_tt.h | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
index 94e16238c93d..c777b72063db 100644
--- a/include/drm/ttm/ttm_tt.h
+++ b/include/drm/ttm/ttm_tt.h
@@ -42,6 +42,8 @@ struct ttm_operation_ctx;
 #define TTM_PAGE_FLAG_SG              (1 << 8)
 #define TTM_PAGE_FLAG_NO_RETRY	      (1 << 9)
 
+#define TTM_PAGE_FLAG_PRIV_POPULATED  (1 << 31)
+
 enum ttm_caching_state {
 	tt_uncached,
 	tt_wc,
@@ -70,22 +72,21 @@ struct ttm_tt {
 	struct sg_table *sg; /* for SG objects via dma-buf */
 	struct file *swap_storage;
 	enum ttm_caching_state caching_state;
-	bool populated;
 };
 
 static inline bool ttm_tt_is_populated(struct ttm_tt *tt)
 {
-	return tt->populated;
+	return tt->page_flags & TTM_PAGE_FLAG_PRIV_POPULATED;
 }
 
 static inline void ttm_tt_set_unpopulated(struct ttm_tt *tt)
 {
-	tt->populated = false;
+	tt->page_flags &= ~TTM_PAGE_FLAG_PRIV_POPULATED;
 }
 
 static inline void ttm_tt_set_populated(struct ttm_tt *tt)
 {
-	tt->populated = true;
+	tt->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED;
 }
 
 /**
-- 
2.27.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 2/7] drm/ttm: wrap tt destroy.
  2020-09-15  2:40 ` [PATCH 2/7] drm/ttm: wrap tt destroy Dave Airlie
@ 2020-09-15  7:47   ` Christian König
  0 siblings, 0 replies; 11+ messages in thread
From: Christian König @ 2020-09-15  7:47 UTC (permalink / raw)
  To: dri-devel; +Cc: bskeggs

Am 15.09.20 um 04:40 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> All places this was called was using bo->ttm either direct
> or indirectly.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>   drivers/gpu/drm/ttm/ttm_bo.c      |  9 +++------
>   drivers/gpu/drm/ttm/ttm_bo_util.c | 24 ++++++++++++------------
>   include/drm/ttm/ttm_bo_driver.h   |  5 +++++
>   3 files changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index e2bfe3a13c63..9aae9e1bd8e8 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -301,10 +301,8 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
>   
>   out_err:
>   	new_man = ttm_manager_type(bdev, bo->mem.mem_type);
> -	if (!new_man->use_tt) {
> -		ttm_tt_destroy(bdev, bo->ttm);
> -		bo->ttm = NULL;
> -	}
> +	if (!new_man->use_tt)
> +		ttm_bo_tt_destroy(bo);
>   
>   	return ret;
>   }
> @@ -322,8 +320,7 @@ static void ttm_bo_cleanup_memtype_use(struct ttm_buffer_object *bo)
>   	if (bo->bdev->driver->move_notify)
>   		bo->bdev->driver->move_notify(bo, false, NULL);
>   
> -	ttm_tt_destroy(bo->bdev, bo->ttm);
> -	bo->ttm = NULL;
> +	ttm_bo_tt_destroy(bo);
>   	ttm_resource_free(bo, &bo->mem);
>   }
>   
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index 44b47ccdeaf7..0ddaaa1ddafd 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -297,10 +297,8 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
>   	*old_mem = *new_mem;
>   	new_mem->mm_node = NULL;
>   
> -	if (!man->use_tt) {
> -		ttm_tt_destroy(bdev, ttm);
> -		bo->ttm = NULL;
> -	}
> +	if (!man->use_tt)
> +		ttm_bo_tt_destroy(bo);
>   
>   out1:
>   	ttm_resource_iounmap(bdev, old_mem, new_iomap);
> @@ -542,10 +540,8 @@ int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
>   		if (ret)
>   			return ret;
>   
> -		if (!man->use_tt) {
> -			ttm_tt_destroy(bdev, bo->ttm);
> -			bo->ttm = NULL;
> -		}
> +		if (!man->use_tt)
> +			ttm_bo_tt_destroy(bo);
>   		ttm_bo_free_old_node(bo);
>   	} else {
>   		/**
> @@ -665,10 +661,8 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo,
>   		if (ret)
>   			return ret;
>   
> -		if (!to->use_tt) {
> -			ttm_tt_destroy(bdev, bo->ttm);
> -			bo->ttm = NULL;
> -		}
> +		if (!to->use_tt)
> +			ttm_bo_tt_destroy(bo);
>   		ttm_bo_free_old_node(bo);
>   	}
>   
> @@ -702,3 +696,9 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo)
>   
>   	return 0;
>   }
> +
> +void ttm_bo_tt_destroy(struct ttm_buffer_object *bo)
> +{
> +	ttm_tt_destroy(bo->bdev, bo->ttm);
> +	bo->ttm = NULL;
> +}

Please put that into ttm_bo.c instead. I want to get rid of the utility 
functions sooner or later.

Apart from that looks good to me.

Christian.

> diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
> index 303a89d1066d..c2e93f04d0ad 100644
> --- a/include/drm/ttm/ttm_bo_driver.h
> +++ b/include/drm/ttm/ttm_bo_driver.h
> @@ -684,6 +684,11 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo);
>    */
>   pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp);
>   
> +/**
> + * ttm_bo_tt_destroy.
> + */
> +void ttm_bo_tt_destroy(struct ttm_buffer_object *bo);
> +
>   /**
>    * ttm_range_man_init
>    *

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 4/7] drm/ttm: split populate out from binding.
  2020-09-15  2:40 ` [PATCH 4/7] drm/ttm: split populate out from binding Dave Airlie
@ 2020-09-15  7:50   ` Christian König
  0 siblings, 0 replies; 11+ messages in thread
From: Christian König @ 2020-09-15  7:50 UTC (permalink / raw)
  To: dri-devel; +Cc: bskeggs

Am 15.09.20 um 04:40 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> Drivers have to call populate themselves now before binding.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c |  7 ++++++-
>   drivers/gpu/drm/nouveau/nouveau_bo.c    |  6 +++++-
>   drivers/gpu/drm/radeon/radeon_ttm.c     |  7 ++++++-
>   drivers/gpu/drm/ttm/ttm_bo.c            |  6 +++++-
>   drivers/gpu/drm/ttm/ttm_bo_util.c       |  7 ++++++-
>   drivers/gpu/drm/ttm/ttm_tt.c            | 11 +++++------
>   include/drm/ttm/ttm_tt.h                |  3 +--
>   7 files changed, 34 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> index 568cb75900a3..dc73cce515b2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
> @@ -548,8 +548,13 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
>   		goto out_cleanup;
>   	}
>   
> +	r = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
> +	if (unlikely(r)) {
> +		goto out_cleanup;
> +	}

Nit pick, don't use {} here. Apart from that the patch is Reviewed-by: 
Christian König <christian.koenig@amd.com>

> +
>   	/* Bind the memory to the GTT space */
> -	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem, ctx);
> +	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem);
>   	if (unlikely(r)) {
>   		goto out_cleanup;
>   	}
> diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
> index 3ab9397fac40..3a1032d01808 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_bo.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
> @@ -904,7 +904,11 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict, bool intr,
>   	if (ret)
>   		return ret;
>   
> -	ret = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg, &ctx);
> +	ret = ttm_tt_populate(bo->bdev, bo->ttm, &ctx);
> +	if (ret)
> +		goto out;
> +
> +	ret = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg);
>   	if (ret)
>   		goto out;
>   
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index 7aa3d03ddeb9..2bc6991fb7e9 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -237,7 +237,12 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
>   		goto out_cleanup;
>   	}
>   
> -	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem, &ctx);
> +	r = ttm_tt_populate(bo->bdev, bo->ttm, &ctx);
> +	if (unlikely(r)) {
> +		goto out_cleanup;
> +	}
> +
> +	r = ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem);
>   	if (unlikely(r)) {
>   		goto out_cleanup;
>   	}
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 9aae9e1bd8e8..32eaf809b7c9 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -260,7 +260,11 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
>   			goto out_err;
>   
>   		if (mem->mem_type != TTM_PL_SYSTEM) {
> -			ret = ttm_tt_bind(bdev, bo->ttm, mem, ctx);
> +			ret = ttm_tt_populate(bdev, bo->ttm, ctx);
> +			if (ret)
> +				goto out_err;
> +
> +			ret = ttm_tt_bind(bdev, bo->ttm, mem);
>   			if (ret)
>   				goto out_err;
>   		}
> diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c
> index f3452a1624fd..2354046bda9a 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo_util.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c
> @@ -77,7 +77,12 @@ int ttm_bo_move_ttm(struct ttm_buffer_object *bo,
>   		return ret;
>   
>   	if (new_mem->mem_type != TTM_PL_SYSTEM) {
> -		ret = ttm_tt_bind(bo->bdev, ttm, new_mem, ctx);
> +
> +		ret = ttm_tt_populate(bo->bdev, ttm, ctx);
> +		if (unlikely(ret != 0))
> +			return ret;
> +
> +		ret = ttm_tt_bind(bo->bdev, ttm, new_mem);
>   		if (unlikely(ret != 0))
>   			return ret;
>   	}
> diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c
> index 381face3cedb..93d65e5e4205 100644
> --- a/drivers/gpu/drm/ttm/ttm_tt.c
> +++ b/drivers/gpu/drm/ttm/ttm_tt.c
> @@ -312,8 +312,7 @@ void ttm_tt_unbind(struct ttm_bo_device *bdev, struct ttm_tt *ttm)
>   }
>   
>   int ttm_tt_bind(struct ttm_bo_device *bdev,
> -		struct ttm_tt *ttm, struct ttm_resource *bo_mem,
> -		struct ttm_operation_ctx *ctx)
> +		struct ttm_tt *ttm, struct ttm_resource *bo_mem)
>   {
>   	int ret = 0;
>   
> @@ -323,10 +322,6 @@ int ttm_tt_bind(struct ttm_bo_device *bdev,
>   	if (ttm_tt_is_bound(ttm))
>   		return 0;
>   
> -	ret = ttm_tt_populate(bdev, ttm, ctx);
> -	if (ret)
> -		return ret;
> -
>   	ret = bdev->driver->ttm_tt_bind(bdev, ttm, bo_mem);
>   	if (unlikely(ret != 0))
>   		return ret;
> @@ -455,6 +450,9 @@ int ttm_tt_populate(struct ttm_bo_device *bdev,
>   {
>   	int ret;
>   
> +	if (!ttm)
> +		return -EINVAL;
> +
>   	if (ttm_tt_is_populated(ttm))
>   		return 0;
>   
> @@ -466,6 +464,7 @@ int ttm_tt_populate(struct ttm_bo_device *bdev,
>   		ttm_tt_add_mapping(bdev, ttm);
>   	return ret;
>   }
> +EXPORT_SYMBOL(ttm_tt_populate);
>   
>   static void ttm_tt_clear_mapping(struct ttm_tt *ttm)
>   {
> diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
> index 86ae759ff018..8f57d86ee67b 100644
> --- a/include/drm/ttm/ttm_tt.h
> +++ b/include/drm/ttm/ttm_tt.h
> @@ -173,8 +173,7 @@ void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma);
>    * Bind the pages of @ttm to an aperture location identified by @bo_mem
>    */
>   int ttm_tt_bind(struct ttm_bo_device *bdev,
> -		struct ttm_tt *ttm, struct ttm_resource *bo_mem,
> -		struct ttm_operation_ctx *ctx);
> +		struct ttm_tt *ttm, struct ttm_resource *bo_mem);
>   
>   /**
>    * ttm_ttm_destroy:

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re:
  2020-09-15  2:40 Dave Airlie
                   ` (6 preceding siblings ...)
  2020-09-15  2:40 ` [PATCH 7/7] drm/ttm: move populated state into page flags Dave Airlie
@ 2020-09-15  7:53 ` Christian König
  7 siblings, 0 replies; 11+ messages in thread
From: Christian König @ 2020-09-15  7:53 UTC (permalink / raw)
  To: dri-devel; +Cc: bskeggs

Reviewed-by: Christian König <christian.koenig@amd.com> for patches #1, 
#3 and #5-#7.

Minor comments on the other two.

Christian.

Am 15.09.20 um 04:40 schrieb Dave Airlie:
> The goal here is to make the ttm_tt object just represent a
> memory backing store, and now whether the store is bound to a
> global translation table. It moves binding up to the bo level.
>
> There's a lot more work on removing the global TT from the core
> of TTM, but this seems like a good start.
>
> Dave.
>
>

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2020-09-15  7:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-15  2:40 Dave Airlie
2020-09-15  2:40 ` [PATCH 1/7] drm/ttm/tt: add wrappers to set tt state Dave Airlie
2020-09-15  2:40 ` [PATCH 2/7] drm/ttm: wrap tt destroy Dave Airlie
2020-09-15  7:47   ` Christian König
2020-09-15  2:40 ` [PATCH 3/7] drm/ttm: tt destroy move null check to outer function Dave Airlie
2020-09-15  2:40 ` [PATCH 4/7] drm/ttm: split populate out from binding Dave Airlie
2020-09-15  7:50   ` Christian König
2020-09-15  2:40 ` [PATCH 5/7] drm/ttm: move ttm binding/unbinding out of ttm_tt paths Dave Airlie
2020-09-15  2:40 ` [PATCH 6/7] drm/ttm: split bound/populated flags Dave Airlie
2020-09-15  2:40 ` [PATCH 7/7] drm/ttm: move populated state into page flags Dave Airlie
2020-09-15  7:53 ` 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.