mirror of
https://github.com/torvalds/linux.git
synced 2026-04-24 01:25:49 -04:00
drm/amdgpu: remove table_freed param from the VM code
Better to leave the decision when to flush the VM changes in the TLB to the VM code. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Philip Yang<Philip.Yang@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
4d30a83c74
commit
8f8cc3fb43
@@ -808,7 +808,6 @@ static void amdgpu_vm_tlb_seq_cb(struct dma_fence *fence,
|
||||
* @res: ttm_resource to map
|
||||
* @pages_addr: DMA addresses to use for mapping
|
||||
* @fence: optional resulting fence
|
||||
* @table_freed: return true if page table is freed
|
||||
*
|
||||
* Fill in the page table entries between @start and @last.
|
||||
*
|
||||
@@ -823,8 +822,7 @@ int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
|
||||
uint64_t flags, uint64_t offset,
|
||||
struct ttm_resource *res,
|
||||
dma_addr_t *pages_addr,
|
||||
struct dma_fence **fence,
|
||||
bool *table_freed)
|
||||
struct dma_fence **fence)
|
||||
{
|
||||
struct amdgpu_vm_update_params params;
|
||||
struct amdgpu_vm_tlb_seq_cb *tlb_cb;
|
||||
@@ -938,9 +936,6 @@ int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
|
||||
tlb_cb = NULL;
|
||||
}
|
||||
|
||||
if (table_freed)
|
||||
*table_freed = *table_freed || params.table_freed;
|
||||
|
||||
error_free:
|
||||
kfree(tlb_cb);
|
||||
|
||||
@@ -1000,7 +995,6 @@ void amdgpu_vm_get_memory(struct amdgpu_vm *vm, uint64_t *vram_mem,
|
||||
* @adev: amdgpu_device pointer
|
||||
* @bo_va: requested BO and VM object
|
||||
* @clear: if true clear the entries
|
||||
* @table_freed: return true if page table is freed
|
||||
*
|
||||
* Fill in the page table entries for @bo_va.
|
||||
*
|
||||
@@ -1008,7 +1002,7 @@ void amdgpu_vm_get_memory(struct amdgpu_vm *vm, uint64_t *vram_mem,
|
||||
* 0 for success, -EINVAL for failure.
|
||||
*/
|
||||
int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
|
||||
bool clear, bool *table_freed)
|
||||
bool clear)
|
||||
{
|
||||
struct amdgpu_bo *bo = bo_va->base.bo;
|
||||
struct amdgpu_vm *vm = bo_va->base.vm;
|
||||
@@ -1087,7 +1081,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
|
||||
resv, mapping->start,
|
||||
mapping->last, update_flags,
|
||||
mapping->offset, mem,
|
||||
pages_addr, last_update, table_freed);
|
||||
pages_addr, last_update);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
@@ -1281,7 +1275,7 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev,
|
||||
r = amdgpu_vm_bo_update_mapping(adev, adev, vm, false, false,
|
||||
resv, mapping->start,
|
||||
mapping->last, init_pte_value,
|
||||
0, NULL, NULL, &f, NULL);
|
||||
0, NULL, NULL, &f);
|
||||
amdgpu_vm_free_mapping(adev, vm, mapping, f);
|
||||
if (r) {
|
||||
dma_fence_put(f);
|
||||
@@ -1323,7 +1317,7 @@ int amdgpu_vm_handle_moved(struct amdgpu_device *adev,
|
||||
|
||||
list_for_each_entry_safe(bo_va, tmp, &vm->moved, base.vm_status) {
|
||||
/* Per VM BOs never need to bo cleared in the page tables */
|
||||
r = amdgpu_vm_bo_update(adev, bo_va, false, NULL);
|
||||
r = amdgpu_vm_bo_update(adev, bo_va, false);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
@@ -1342,7 +1336,7 @@ int amdgpu_vm_handle_moved(struct amdgpu_device *adev,
|
||||
else
|
||||
clear = true;
|
||||
|
||||
r = amdgpu_vm_bo_update(adev, bo_va, clear, NULL);
|
||||
r = amdgpu_vm_bo_update(adev, bo_va, clear);
|
||||
if (r)
|
||||
return r;
|
||||
|
||||
@@ -2526,8 +2520,7 @@ bool amdgpu_vm_handle_fault(struct amdgpu_device *adev, u32 pasid,
|
||||
}
|
||||
|
||||
r = amdgpu_vm_bo_update_mapping(adev, adev, vm, true, false, NULL, addr,
|
||||
addr, flags, value, NULL, NULL, NULL,
|
||||
NULL);
|
||||
addr, flags, value, NULL, NULL, NULL);
|
||||
if (r)
|
||||
goto error_unlock;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user