]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: Account for shadow PTs in mapping update IB size.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 7 Sep 2017 11:23:21 +0000 (13:23 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 12 Sep 2017 18:23:52 +0000 (14:23 -0400)
When amdgpu_vm_frag_ptes calls amdgpu_vm_update_ptes and the pt
has a shadow PT we mirror all the write to the shadow PT too, which
results in twice the commands.

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

index c9223a5184dee69c9c7d85b043769c2bd741dd88..545531db66db9fef8e0e7e890b8b9d5b86d95a5c 100644 (file)
@@ -1536,10 +1536,12 @@ static int amdgpu_vm_bo_update_mapping(struct amdgpu_device *adev,
        nptes = last - start + 1;
 
        /*
-        * reserve space for one command every (1 << BLOCK_SIZE)
+        * reserve space for two commands every (1 << BLOCK_SIZE)
         *  entries or 2k dwords (whatever is smaller)
+         *
+         * The second command is for the shadow pagetables.
         */
-       ncmds = (nptes >> min(adev->vm_manager.block_size, 11u)) + 1;
+       ncmds = ((nptes >> min(adev->vm_manager.block_size, 11u)) + 1) * 2;
 
        /* padding, etc. */
        ndw = 64;