Subsystems (6)
Dave Airlie
maintainerPATCH 2/7 drm/ttm: wrap tt destroy.
In reply to Dave AirlieFrom: Dave Airlie <[email protected]>
All places this was called was using bo->ttm either direct or indirectly.
--- 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(-)
drivers/gpu/drm/ttm/ttm_bo.c +3 -6
@@ -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); }
drivers/gpu/drm/ttm/ttm_bo_util.c +12 -12
@@ -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 ; +}
include/drm/ttm/ttm_bo_driver.h +5 -0
@@ -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 *
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Dave Airlie
maintainerPATCH 3/7 drm/ttm: tt destroy move null check to outer function.
In reply to Dave AirlieFrom: Dave Airlie <[email protected]>
This just makes things easier later.
--- drivers/gpu/drm/ttm/ttm_bo_util.c | 2 ++ drivers/gpu/drm/ttm/ttm_tt.c | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_util.c +2 -0
@@ -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 ; }
drivers/gpu/drm/ttm/ttm_tt.c +0 -3
@@ -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);
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Dave Airlie
maintainerPATCH 6/7 drm/ttm: split bound/populated flags.
In reply to Dave AirlieFrom: Dave Airlie <[email protected]>
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.
--- 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(-)
drivers/gpu/drm/ttm/ttm_bo_util.c +11 -4
@@ -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);
include/drm/ttm/ttm_bo_api.h +1 -0
@@ -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;
include/drm/ttm/ttm_bo_driver.h +3 -3
@@ -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.
include/drm/ttm/ttm_tt.h +4 -8
@@ -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; }/**
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Dave Airlie
maintainerPATCH 7/7 drm/ttm: move populated state into page flags
In reply to Dave AirlieFrom: Dave Airlie <[email protected]>
Just use the top bit of page flags to store the populated state.
--- include/drm/ttm/ttm_tt.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
include/drm/ttm/ttm_tt.h +5 -4
@@ -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 ; }/**
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Dave Airlie
maintainerThe 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Dave Airlie
maintainerPATCH 4/7 drm/ttm: split populate out from binding.
From: Dave Airlie <[email protected]>
Drivers have to call populate themselves now before binding.
--- 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +6 -1
@@ -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; }
drivers/gpu/drm/nouveau/nouveau_bo.c +5 -1
@@ -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;
drivers/gpu/drm/radeon/radeon_ttm.c +6 -1
@@ -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; }
drivers/gpu/drm/ttm/ttm_bo.c +5 -1
@@ -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; }
drivers/gpu/drm/ttm/ttm_bo_util.c +6 -1
@@ -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; }
drivers/gpu/drm/ttm/ttm_tt.c +5 -6
@@ -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) {
include/drm/ttm/ttm_tt.h +1 -2
@@ -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:
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Dave Airlie
maintainerPATCH 1/7 drm/ttm/tt: add wrappers to set tt state.
In reply to Dave AirlieFrom: Dave Airlie <[email protected]>
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.
--- 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2 -2
@@ -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 ; }
drivers/gpu/drm/nouveau/nouveau_bo.c +2 -2
@@ -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 ; }
drivers/gpu/drm/radeon/radeon_mn.c +1 -1
@@ -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))
drivers/gpu/drm/radeon/radeon_ttm.c +2 -2
@@ -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 ; }
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -1
@@ -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;
drivers/gpu/drm/ttm/ttm_page_alloc.c +3 -3
@@ -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);
drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +3 -3
@@ -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);
drivers/gpu/drm/ttm/ttm_tt.c +9 -11
@@ -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);
drivers/gpu/drm/vmwgfx/vmwgfx_blit.c +2 -2
@@ -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;
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c +1 -1
@@ -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) {
include/drm/ttm/ttm_tt.h +31 -1
@@ -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 *
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Dave Airlie
maintainerPATCH 5/7 drm/ttm: move ttm binding/unbinding out of ttm_tt paths.
In reply to Dave AirlieFrom: Dave Airlie <[email protected]>
Move these up to the bo level, moving ttm_tt to just being backing store. Next step is to move the bound flag out.
--- 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(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
@@ -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; }
drivers/gpu/drm/nouveau/nouveau_bo.c +1 -1
@@ -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;
drivers/gpu/drm/radeon/radeon_mn.c +1 -1
@@ -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))
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
@@ -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; }
drivers/gpu/drm/ttm/ttm_bo.c +1 -1
@@ -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; }
drivers/gpu/drm/ttm/ttm_bo_util.c +31 -2
@@ -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); + } +}
drivers/gpu/drm/ttm/ttm_tt.c +0 -31
@@ -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;
include/drm/ttm/ttm_bo_driver.h +28 -0
@@ -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. */
include/drm/ttm/ttm_tt.h +0 -35
@@ -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: *
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Christian König
maintainerRe: [PATCH 2/7] drm/ttm: wrap tt destroy.
In reply to Dave AirlieAm 15.09.20 um 04:40 schrieb Dave Airlie:
Quoted 83 lines
From: Dave Airlie <[email protected]>
All places this was called was using
bo->ttmeither direct or indirectly.Signed-off-by Dave Airlie <[email protected]>--- 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(-)drivers/gpu/drm/ttm/ttm_bo.c +3
-6@@ -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); }drivers/gpu/drm/ttm/ttm_bo_util.c +6
-12@@ -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); }
drivers/gpu/drm/ttm/ttm_bo_util.c int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo) · line 704
Quoted 9 lines
drivers/gpu/drm/ttm/ttm_bo_util.c +6
-0@@ -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.
Quoted 6 lines
include/drm/ttm/ttm_bo_driver.h +0
-0@@ -684,6 +684,11 @@ int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo);*/
include/drm/ttm/ttm_bo_driver.h int ttm_bo_pipeline_gutting(struct ttm_buffer_object *bo); · line 694
Quoted 10 lines
include/drm/ttm/ttm_bo_driver.h +5
-0pgprot_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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Christian König
maintainerRe: [PATCH 4/7] drm/ttm: split populate out from binding.
In reply to Dave AirlieAm 15.09.20 um 04:40 schrieb Dave Airlie:
Quoted 20 lines
From: Dave Airlie <[email protected]>
Drivers have to call populate themselves now before binding.
Signed-off-by Dave Airlie <[email protected]>--- 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(-)drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict, · line 554
Quoted 7 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +4
-0@@ -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 <[email protected]>
Quoted 125 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +2
-1+/* 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; }drivers/gpu/drm/nouveau/nouveau_bo.c +5
-1@@ -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;drivers/gpu/drm/radeon/radeon_ttm.c +6
-1@@ -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; }drivers/gpu/drm/ttm/ttm_bo.c +5
-1@@ -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; }drivers/gpu/drm/ttm/ttm_bo_util.c +6
-1@@ -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; }drivers/gpu/drm/ttm/ttm_tt.c +5
-6@@ -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) {include/drm/ttm/ttm_tt.h +0
-0
include/drm/ttm/ttm_tt.h void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma); · line 179
Quoted 9 lines
include/drm/ttm/ttm_tt.h +1
-2@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Minor comments on the other two.
Christian.
Am 15.09.20 um 04:40 schrieb Dave Airlie:
Quoted 10 lines
The goal here is to make the
ttm_ttobject 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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel