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: use multiple entities in amdgpu_move_blit

Thanks to "drm/ttm: rework pipelined eviction fence handling", ttm
can deal correctly with moves and evictions being executed from
different contexts.

Signed-off-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Felix Kuehling <felix.kuehling@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Pierre-Eric Pelloux-Prayer and committed by
Alex Deucher
860fd1dd a3e14436

+10 -4
+9 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 387 387 { 388 388 struct amdgpu_device *adev = amdgpu_ttm_adev(bo->bdev); 389 389 struct amdgpu_bo *abo = ttm_to_amdgpu_bo(bo); 390 + struct amdgpu_ttm_buffer_entity *entity; 390 391 struct amdgpu_copy_mem src, dst; 391 392 struct dma_fence *fence = NULL; 392 393 int r; 394 + u32 e; 393 395 394 396 src.bo = bo; 395 397 dst.bo = bo; ··· 400 398 src.offset = 0; 401 399 dst.offset = 0; 402 400 401 + e = atomic_inc_return(&adev->mman.next_move_entity) % 402 + adev->mman.num_move_entities; 403 + entity = &adev->mman.move_entities[e]; 404 + 403 405 r = amdgpu_ttm_copy_mem_to_mem(adev, 404 - &adev->mman.move_entities[0], 406 + entity, 405 407 &src, &dst, 406 408 new_mem->size, 407 409 amdgpu_bo_encrypted(abo), ··· 417 411 if (old_mem->mem_type == TTM_PL_VRAM && 418 412 (abo->flags & AMDGPU_GEM_CREATE_VRAM_WIPE_ON_RELEASE)) { 419 413 struct dma_fence *wipe_fence = NULL; 420 - 421 - r = amdgpu_fill_buffer(&adev->mman.move_entities[0], 422 - abo, 0, NULL, &wipe_fence, 414 + r = amdgpu_fill_buffer(entity, abo, 0, NULL, &wipe_fence, 423 415 AMDGPU_KERNEL_JOB_ID_MOVE_BLIT); 424 416 if (r) { 425 417 goto error; ··· 2396 2392 } 2397 2393 2398 2394 adev->mman.num_move_entities = num_move_entities; 2395 + atomic_set(&adev->mman.next_move_entity, 0); 2399 2396 for (i = 0; i < num_move_entities; i++) { 2400 2397 r = amdgpu_ttm_buffer_entity_init( 2401 2398 &adev->mman.gtt_mgr,
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h
··· 76 76 atomic_t next_clear_entity; 77 77 u32 num_clear_entities; 78 78 struct amdgpu_ttm_buffer_entity move_entities[TTM_NUM_MOVE_FENCES]; 79 + atomic_t next_move_entity; 79 80 u32 num_move_entities; 80 81 81 82 struct amdgpu_vram_mgr vram_mgr;