aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
diff options
context:
space:
mode:
authorAlex Xie <AlexBin.Xie@amd.com>2016-06-06 18:14:57 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-07-07 14:51:26 -0400
commit3a6f8e0c7294ce1c0bdeaa778df1095197b4cf6a (patch)
tree1d240f5de34562048d8b1259b232712b9d8196c9 /drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
parent677131a16d84d522fb096ff489034471588661a5 (diff)
drm/amdgpu: Add comment to describe the purpose of one difficult if statement
Use == instead of != in the if statement to make code easier understood Signed-off-by: Alex Xie <AlexBin.Xie@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
index 00cb58905e94..8dafbd3c427f 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
@@ -780,8 +780,13 @@ static void amdgpu_vm_update_ptes(struct amdgpu_device *adev,
780 next_pe_start = amdgpu_bo_gpu_offset(pt); 780 next_pe_start = amdgpu_bo_gpu_offset(pt);
781 next_pe_start += (addr & mask) * 8; 781 next_pe_start += (addr & mask) * 8;
782 782
783 if (cur_pe_end != next_pe_start) { 783 if (cur_pe_end == next_pe_start) {
784 784 /* The next ptb is consecutive to current ptb.
785 * Don't call amdgpu_vm_frag_ptes now.
786 * Will update two ptbs together in future.
787 */
788 cur_pe_end += 8 * nptes;
789 } else {
785 amdgpu_vm_frag_ptes(adev, vm_update_params, 790 amdgpu_vm_frag_ptes(adev, vm_update_params,
786 cur_pe_start, cur_pe_end, 791 cur_pe_start, cur_pe_end,
787 cur_dst, flags); 792 cur_dst, flags);
@@ -789,8 +794,6 @@ static void amdgpu_vm_update_ptes(struct amdgpu_device *adev,
789 cur_pe_start = next_pe_start; 794 cur_pe_start = next_pe_start;
790 cur_pe_end = next_pe_start + 8 * nptes; 795 cur_pe_end = next_pe_start + 8 * nptes;
791 cur_dst = dst; 796 cur_dst = dst;
792 } else {
793 cur_pe_end += 8 * nptes;
794 } 797 }
795 798
796 addr += nptes; 799 addr += nptes;