Skip to contentSkip to conversation

drm/amdgpu: Correct the IB size of bo update mapping.

PATCH In review Emily Deng 2 participants 2 messages Dec 28, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

Emily Deng

author
#0 lore raw

PATCH 1/1 drm/amdgpu: Correct the IB size of bo update mapping.

The amdgpu_vm_frag_ptes will call amdgpu_vm_update_ptes, and for buffer object that has shadow buffer, need twice commands.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +8 -2
index 7fbe971..7eb23b5 100644
@@ -1584,13 +1584,19 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
          *
          * The second command is for the shadow pagetables.
 	 */
-	ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2;
+	if (vm->root.base.bo->shadow)
+		ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2;
+	else
+		ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1);
 
 	/* padding, etc. */
 	ndw = 64;
 
 	/* one PDE write for each huge page */
-	ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;
+	if (vm->root.base.bo->shadow)
+		ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6 * 2;
+	else
+		ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;
 
 	if (pages_addr) {
 		/* copy commands needed */
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1514431045-10768-1-git-send-email-Emily.Deng-5C7GfCeVMHo@public.gmane.org

#2 lore raw

Good catch, Reviewed-by: Chunming Zhou <[email protected]>

Quoted 24 lines · Emily Deng

The amdgpu_vm_frag_ptes will call amdgpu_vm_update_ptes, and for buffer object that has shadow buffer, need twice commands.

---
  drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 ++++++++--
  1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +4 -1
index 7fbe971..7eb23b5 100644
@@ -1584,13 +1584,19 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
           *
           * The second command is for the shadow pagetables.
  	 */
-	ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2;
+	if (vm->root.base.bo->shadow)
+		ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2;
+	else
+		ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1);
 
  	/* padding, etc. */
  	ndw = 64;

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev, · line 1602

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +4 -1
 
  	/* one PDE write for each huge page */
-	ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;
+	if (vm->root.base.bo->shadow)
+		ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6 * 2;
+	else
+		ndw += ((nptes >> adev->vm_manager.block_size) + 1) * 6;
 
  	if (pages_addr) {
  		/* copy commands needed */

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx