Skip to content

Commit e9949dd

Browse files
erichuang22alexdeucher
authored andcommitted
Revert "Revert "drm/amdgpu: Add table_freed parameter to amdgpu_vm_bo_update""
This reverts commit 024d881. Revert reason: The issue has been resolved. Signed-off-by: Eric Huang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent f875343 commit e9949dd

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
781781
if (r)
782782
return r;
783783

784-
r = amdgpu_vm_bo_update(adev, fpriv->prt_va, false);
784+
r = amdgpu_vm_bo_update(adev, fpriv->prt_va, false, NULL);
785785
if (r)
786786
return r;
787787

@@ -792,7 +792,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
792792
if (amdgpu_mcbp || amdgpu_sriov_vf(adev)) {
793793
bo_va = fpriv->csa_va;
794794
BUG_ON(!bo_va);
795-
r = amdgpu_vm_bo_update(adev, bo_va, false);
795+
r = amdgpu_vm_bo_update(adev, bo_va, false, NULL);
796796
if (r)
797797
return r;
798798

@@ -811,7 +811,7 @@ static int amdgpu_cs_vm_handling(struct amdgpu_cs_parser *p)
811811
if (bo_va == NULL)
812812
continue;
813813

814-
r = amdgpu_vm_bo_update(adev, bo_va, false);
814+
r = amdgpu_vm_bo_update(adev, bo_va, false, NULL);
815815
if (r)
816816
return r;
817817

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,
612612

613613
if (operation == AMDGPU_VA_OP_MAP ||
614614
operation == AMDGPU_VA_OP_REPLACE) {
615-
r = amdgpu_vm_bo_update(adev, bo_va, false);
615+
r = amdgpu_vm_bo_update(adev, bo_va, false, NULL);
616616
if (r)
617617
goto error;
618618
}

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1798,7 +1798,7 @@ int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
17981798
r = vm->update_funcs->commit(&params, fence);
17991799

18001800
if (table_freed)
1801-
*table_freed = params.table_freed;
1801+
*table_freed = *table_freed || params.table_freed;
18021802

18031803
error_unlock:
18041804
amdgpu_vm_eviction_unlock(vm);
@@ -1863,7 +1863,7 @@ void amdgpu_vm_get_memory(struct amdgpu_vm *vm, uint64_t *vram_mem,
18631863
* 0 for success, -EINVAL for failure.
18641864
*/
18651865
int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
1866-
bool clear)
1866+
bool clear, bool *table_freed)
18671867
{
18681868
struct amdgpu_bo *bo = bo_va->base.bo;
18691869
struct amdgpu_vm *vm = bo_va->base.vm;
@@ -1942,7 +1942,7 @@ int amdgpu_vm_bo_update(struct amdgpu_device *adev, struct amdgpu_bo_va *bo_va,
19421942
resv, mapping->start,
19431943
mapping->last, update_flags,
19441944
mapping->offset, mem,
1945-
pages_addr, last_update, NULL);
1945+
pages_addr, last_update, table_freed);
19461946
if (r)
19471947
return r;
19481948
}
@@ -2194,7 +2194,7 @@ int amdgpu_vm_handle_moved(struct amdgpu_device *adev,
21942194

21952195
list_for_each_entry_safe(bo_va, tmp, &vm->moved, base.vm_status) {
21962196
/* Per VM BOs never need to bo cleared in the page tables */
2197-
r = amdgpu_vm_bo_update(adev, bo_va, false);
2197+
r = amdgpu_vm_bo_update(adev, bo_va, false, NULL);
21982198
if (r)
21992199
return r;
22002200
}
@@ -2213,7 +2213,7 @@ int amdgpu_vm_handle_moved(struct amdgpu_device *adev,
22132213
else
22142214
clear = true;
22152215

2216-
r = amdgpu_vm_bo_update(adev, bo_va, clear);
2216+
r = amdgpu_vm_bo_update(adev, bo_va, clear, NULL);
22172217
if (r)
22182218
return r;
22192219

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
408408
struct dma_fence **fence, bool *free_table);
409409
int amdgpu_vm_bo_update(struct amdgpu_device *adev,
410410
struct amdgpu_bo_va *bo_va,
411-
bool clear);
411+
bool clear, bool *table_freed);
412412
bool amdgpu_vm_evictable(struct amdgpu_bo *bo);
413413
void amdgpu_vm_bo_invalidate(struct amdgpu_device *adev,
414414
struct amdgpu_bo *bo, bool evicted);

0 commit comments

Comments
 (0)