Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: stop joining VM PTE updates

This isn't beneficial any more since VRAM allocations are now split
so that they fits into a single page table.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
301654a4 53e2e91d

+7 -54
+7 -54
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 1163 1163 struct amdgpu_device *adev = params->adev; 1164 1164 const uint64_t mask = AMDGPU_VM_PTE_COUNT(adev) - 1; 1165 1165 1166 - uint64_t cur_pe_start, cur_nptes, cur_dst; 1167 - uint64_t addr; /* next GPU address to be updated */ 1166 + uint64_t addr, pe_start; 1168 1167 struct amdgpu_bo *pt; 1169 - unsigned nptes; /* next number of ptes to be updated */ 1170 - uint64_t next_pe_start; 1171 - 1172 - /* initialize the variables */ 1173 - addr = start; 1174 - pt = amdgpu_vm_get_pt(params, addr); 1175 - if (!pt) { 1176 - pr_err("PT not found, aborting update_ptes\n"); 1177 - return -EINVAL; 1178 - } 1179 - 1180 - if (params->shadow) { 1181 - if (!pt->shadow) 1182 - return 0; 1183 - pt = pt->shadow; 1184 - } 1185 - if ((addr & ~mask) == (end & ~mask)) 1186 - nptes = end - addr; 1187 - else 1188 - nptes = AMDGPU_VM_PTE_COUNT(adev) - (addr & mask); 1189 - 1190 - cur_pe_start = amdgpu_bo_gpu_offset(pt); 1191 - cur_pe_start += (addr & mask) * 8; 1192 - cur_nptes = nptes; 1193 - cur_dst = dst; 1194 - 1195 - /* for next ptb*/ 1196 - addr += nptes; 1197 - dst += nptes * AMDGPU_GPU_PAGE_SIZE; 1168 + unsigned nptes; 1198 1169 1199 1170 /* walk over the address space and update the page tables */ 1200 - while (addr < end) { 1171 + for (addr = start; addr < end; addr += nptes) { 1201 1172 pt = amdgpu_vm_get_pt(params, addr); 1202 1173 if (!pt) { 1203 1174 pr_err("PT not found, aborting update_ptes\n"); ··· 1186 1215 else 1187 1216 nptes = AMDGPU_VM_PTE_COUNT(adev) - (addr & mask); 1188 1217 1189 - next_pe_start = amdgpu_bo_gpu_offset(pt); 1190 - next_pe_start += (addr & mask) * 8; 1218 + pe_start = amdgpu_bo_gpu_offset(pt); 1219 + pe_start += (addr & mask) * 8; 1191 1220 1192 - if ((cur_pe_start + 8 * cur_nptes) == next_pe_start && 1193 - ((cur_nptes + nptes) <= AMDGPU_VM_MAX_UPDATE_SIZE)) { 1194 - /* The next ptb is consecutive to current ptb. 1195 - * Don't call the update function now. 1196 - * Will update two ptbs together in future. 1197 - */ 1198 - cur_nptes += nptes; 1199 - } else { 1200 - params->func(params, cur_pe_start, cur_dst, cur_nptes, 1201 - AMDGPU_GPU_PAGE_SIZE, flags); 1221 + params->func(params, pe_start, dst, nptes, 1222 + AMDGPU_GPU_PAGE_SIZE, flags); 1202 1223 1203 - cur_pe_start = next_pe_start; 1204 - cur_nptes = nptes; 1205 - cur_dst = dst; 1206 - } 1207 - 1208 - /* for next ptb*/ 1209 - addr += nptes; 1210 1224 dst += nptes * AMDGPU_GPU_PAGE_SIZE; 1211 1225 } 1212 - 1213 - params->func(params, cur_pe_start, cur_dst, cur_nptes, 1214 - AMDGPU_GPU_PAGE_SIZE, flags); 1215 1226 1216 1227 return 0; 1217 1228 }