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

drm/amdgpu: Remove unnecessary domain argument

Remove the "domain" argument to amdgpu_bo_create_kernel_at() since this
function takes an "offset" argument which is the offset off of VRAM, and as
such allocation always takes place in VRAM. Thus, the "domain" argument is
unnecessary.

Cc: Alex Deucher <Alexander.Deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: AMD Graphics <amd-gfx@lists.freedesktop.org>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Luben Tuikov and committed by
Alex Deucher
3273f116 7554886d

+6 -14
+5 -5
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
··· 346 346 * @adev: amdgpu device object 347 347 * @offset: offset of the BO 348 348 * @size: size of the BO 349 - * @domain: where to place it 350 349 * @bo_ptr: used to initialize BOs in structures 351 350 * @cpu_addr: optional CPU address mapping 352 351 * 353 - * Creates a kernel BO at a specific offset in the address space of the domain. 352 + * Creates a kernel BO at a specific offset in VRAM. 354 353 * 355 354 * Returns: 356 355 * 0 on success, negative error code otherwise. 357 356 */ 358 357 int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev, 359 - uint64_t offset, uint64_t size, uint32_t domain, 358 + uint64_t offset, uint64_t size, 360 359 struct amdgpu_bo **bo_ptr, void **cpu_addr) 361 360 { 362 361 struct ttm_operation_ctx ctx = { false, false }; ··· 365 366 offset &= PAGE_MASK; 366 367 size = ALIGN(size, PAGE_SIZE); 367 368 368 - r = amdgpu_bo_create_reserved(adev, size, PAGE_SIZE, domain, bo_ptr, 369 - NULL, cpu_addr); 369 + r = amdgpu_bo_create_reserved(adev, size, PAGE_SIZE, 370 + AMDGPU_GEM_DOMAIN_VRAM, bo_ptr, NULL, 371 + cpu_addr); 370 372 if (r) 371 373 return r; 372 374
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h
··· 284 284 u32 domain, struct amdgpu_bo **bo_ptr, 285 285 u64 *gpu_addr, void **cpu_addr); 286 286 int amdgpu_bo_create_kernel_at(struct amdgpu_device *adev, 287 - uint64_t offset, uint64_t size, uint32_t domain, 287 + uint64_t offset, uint64_t size, 288 288 struct amdgpu_bo **bo_ptr, void **cpu_addr); 289 289 int amdgpu_bo_create_user(struct amdgpu_device *adev, 290 290 struct amdgpu_bo_param *bp,
-7
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 1576 1576 return amdgpu_bo_create_kernel_at(adev, 1577 1577 adev->mman.fw_vram_usage_start_offset, 1578 1578 adev->mman.fw_vram_usage_size, 1579 - AMDGPU_GEM_DOMAIN_VRAM, 1580 1579 &adev->mman.fw_vram_usage_reserved_bo, 1581 1580 &adev->mman.fw_vram_usage_va); 1582 1581 } ··· 1601 1602 return amdgpu_bo_create_kernel_at(adev, 1602 1603 adev->mman.drv_vram_usage_start_offset, 1603 1604 adev->mman.drv_vram_usage_size, 1604 - AMDGPU_GEM_DOMAIN_VRAM, 1605 1605 &adev->mman.drv_vram_usage_reserved_bo, 1606 1606 &adev->mman.drv_vram_usage_va); 1607 1607 } ··· 1681 1683 ret = amdgpu_bo_create_kernel_at(adev, 1682 1684 ctx->c2p_train_data_offset, 1683 1685 ctx->train_data_size, 1684 - AMDGPU_GEM_DOMAIN_VRAM, 1685 1686 &ctx->c2p_bo, 1686 1687 NULL); 1687 1688 if (ret) { ··· 1694 1697 ret = amdgpu_bo_create_kernel_at(adev, 1695 1698 adev->gmc.real_vram_size - adev->mman.discovery_tmr_size, 1696 1699 adev->mman.discovery_tmr_size, 1697 - AMDGPU_GEM_DOMAIN_VRAM, 1698 1700 &adev->mman.discovery_memory, 1699 1701 NULL); 1700 1702 if (ret) { ··· 1794 1798 * avoid display artifacts while transitioning between pre-OS 1795 1799 * and driver. */ 1796 1800 r = amdgpu_bo_create_kernel_at(adev, 0, adev->mman.stolen_vga_size, 1797 - AMDGPU_GEM_DOMAIN_VRAM, 1798 1801 &adev->mman.stolen_vga_memory, 1799 1802 NULL); 1800 1803 if (r) 1801 1804 return r; 1802 1805 r = amdgpu_bo_create_kernel_at(adev, adev->mman.stolen_vga_size, 1803 1806 adev->mman.stolen_extended_size, 1804 - AMDGPU_GEM_DOMAIN_VRAM, 1805 1807 &adev->mman.stolen_extended_memory, 1806 1808 NULL); 1807 1809 if (r) 1808 1810 return r; 1809 1811 r = amdgpu_bo_create_kernel_at(adev, adev->mman.stolen_reserved_offset, 1810 1812 adev->mman.stolen_reserved_size, 1811 - AMDGPU_GEM_DOMAIN_VRAM, 1812 1813 &adev->mman.stolen_reserved_memory, 1813 1814 NULL); 1814 1815 if (r)
-1
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
··· 395 395 */ 396 396 if (amdgpu_bo_create_kernel_at(adev, bp << AMDGPU_GPU_PAGE_SHIFT, 397 397 AMDGPU_GPU_PAGE_SIZE, 398 - AMDGPU_GEM_DOMAIN_VRAM, 399 398 &bo, NULL)) 400 399 DRM_DEBUG("RAS WARN: reserve vram for retired page %llx fail\n", bp); 401 400