Lines Matching refs:mman
74 return ttm_range_man_init(&adev->mman.bdev, type, in amdgpu_ttm_init_on_chip()
139 if (!adev->mman.buffer_funcs_enabled) { in amdgpu_evict_flags()
204 BUG_ON(adev->mman.buffer_funcs->copy_max_bytes < in amdgpu_ttm_map_buffer()
220 num_dw = ALIGN(adev->mman.buffer_funcs->copy_num_dw, 8); in amdgpu_ttm_map_buffer()
269 r = amdgpu_job_submit(job, &adev->mman.entity, in amdgpu_ttm_map_buffer()
308 struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring; in amdgpu_ttm_copy_mem_to_mem()
313 if (!adev->mman.buffer_funcs_enabled) { in amdgpu_ttm_copy_mem_to_mem()
321 mutex_lock(&adev->mman.gtt_window_lock); in amdgpu_ttm_copy_mem_to_mem()
361 mutex_unlock(&adev->mman.gtt_window_lock); in amdgpu_ttm_copy_mem_to_mem()
527 if (adev->mman.buffer_funcs_enabled) { in amdgpu_bo_move()
589 if (adev->mman.aper_base_kaddr && in amdgpu_ttm_io_mem_reserve()
591 mem->bus.addr = (u8 *)adev->mman.aper_base_kaddr + in amdgpu_ttm_io_mem_reserve()
1137 return ttm_pool_alloc(&adev->mman.bdev.pool, ttm, ctx); in amdgpu_ttm_tt_populate()
1163 return ttm_pool_free(&adev->mman.bdev.pool, ttm); in amdgpu_ttm_tt_unpopulate()
1515 amdgpu_bo_free_kernel(&adev->mman.fw_vram_usage_reserved_bo, in amdgpu_ttm_fw_reserve_vram_fini()
1516 NULL, &adev->mman.fw_vram_usage_va); in amdgpu_ttm_fw_reserve_vram_fini()
1530 adev->mman.fw_vram_usage_va = NULL; in amdgpu_ttm_fw_reserve_vram_init()
1531 adev->mman.fw_vram_usage_reserved_bo = NULL; in amdgpu_ttm_fw_reserve_vram_init()
1533 if (adev->mman.fw_vram_usage_size == 0 || in amdgpu_ttm_fw_reserve_vram_init()
1534 adev->mman.fw_vram_usage_size > vram_size) in amdgpu_ttm_fw_reserve_vram_init()
1538 adev->mman.fw_vram_usage_start_offset, in amdgpu_ttm_fw_reserve_vram_init()
1539 adev->mman.fw_vram_usage_size, in amdgpu_ttm_fw_reserve_vram_init()
1541 &adev->mman.fw_vram_usage_reserved_bo, in amdgpu_ttm_fw_reserve_vram_init()
1542 &adev->mman.fw_vram_usage_va); in amdgpu_ttm_fw_reserve_vram_init()
1574 ALIGN((adev->gmc.mc_vram_size - adev->mman.discovery_tmr_size - SZ_1M), SZ_1M); in amdgpu_ttm_training_data_block_init()
1610 adev->mman.discovery_tmr_size = in amdgpu_ttm_reserve_tmr()
1612 if (!adev->mman.discovery_tmr_size) in amdgpu_ttm_reserve_tmr()
1613 adev->mman.discovery_tmr_size = DISCOVERY_TMR_OFFSET; in amdgpu_ttm_reserve_tmr()
1633 adev->gmc.real_vram_size - adev->mman.discovery_tmr_size, in amdgpu_ttm_reserve_tmr()
1634 adev->mman.discovery_tmr_size, in amdgpu_ttm_reserve_tmr()
1636 &adev->mman.discovery_memory, in amdgpu_ttm_reserve_tmr()
1640 amdgpu_bo_free_kernel(&adev->mman.discovery_memory, NULL, NULL); in amdgpu_ttm_reserve_tmr()
1662 mutex_init(&adev->mman.gtt_window_lock); in amdgpu_ttm_init()
1665 r = ttm_device_init(&adev->mman.bdev, &amdgpu_bo_driver, adev->dev, in amdgpu_ttm_init()
1674 adev->mman.initialized = true; in amdgpu_ttm_init()
1694 adev->mman.aper_base_kaddr = ioremap_cache(adev->gmc.aper_base, in amdgpu_ttm_init()
1699 adev->mman.aper_base_kaddr = ioremap_wc(adev->gmc.aper_base, in amdgpu_ttm_init()
1717 if (adev->mman.discovery_bin) { in amdgpu_ttm_init()
1727 r = amdgpu_bo_create_kernel_at(adev, 0, adev->mman.stolen_vga_size, in amdgpu_ttm_init()
1729 &adev->mman.stolen_vga_memory, in amdgpu_ttm_init()
1733 r = amdgpu_bo_create_kernel_at(adev, adev->mman.stolen_vga_size, in amdgpu_ttm_init()
1734 adev->mman.stolen_extended_size, in amdgpu_ttm_init()
1736 &adev->mman.stolen_extended_memory, in amdgpu_ttm_init()
1740 r = amdgpu_bo_create_kernel_at(adev, adev->mman.stolen_reserved_offset, in amdgpu_ttm_init()
1741 adev->mman.stolen_reserved_size, in amdgpu_ttm_init()
1743 &adev->mman.stolen_reserved_memory, in amdgpu_ttm_init()
1807 if (!adev->mman.initialized) in amdgpu_ttm_fini()
1812 amdgpu_bo_free_kernel(&adev->mman.stolen_vga_memory, NULL, NULL); in amdgpu_ttm_fini()
1813 amdgpu_bo_free_kernel(&adev->mman.stolen_extended_memory, NULL, NULL); in amdgpu_ttm_fini()
1815 amdgpu_bo_free_kernel(&adev->mman.discovery_memory, NULL, NULL); in amdgpu_ttm_fini()
1816 if (adev->mman.stolen_reserved_size) in amdgpu_ttm_fini()
1817 amdgpu_bo_free_kernel(&adev->mman.stolen_reserved_memory, in amdgpu_ttm_fini()
1824 ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_GDS); in amdgpu_ttm_fini()
1825 ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_GWS); in amdgpu_ttm_fini()
1826 ttm_range_man_fini(&adev->mman.bdev, AMDGPU_PL_OA); in amdgpu_ttm_fini()
1827 ttm_device_fini(&adev->mman.bdev); in amdgpu_ttm_fini()
1828 adev->mman.initialized = false; in amdgpu_ttm_fini()
1843 struct ttm_resource_manager *man = ttm_manager_type(&adev->mman.bdev, TTM_PL_VRAM); in amdgpu_ttm_set_buffer_funcs_status()
1847 if (!adev->mman.initialized || amdgpu_in_reset(adev) || in amdgpu_ttm_set_buffer_funcs_status()
1848 adev->mman.buffer_funcs_enabled == enable) in amdgpu_ttm_set_buffer_funcs_status()
1855 ring = adev->mman.buffer_funcs_ring; in amdgpu_ttm_set_buffer_funcs_status()
1857 r = drm_sched_entity_init(&adev->mman.entity, in amdgpu_ttm_set_buffer_funcs_status()
1866 drm_sched_entity_destroy(&adev->mman.entity); in amdgpu_ttm_set_buffer_funcs_status()
1877 adev->mman.buffer_funcs_enabled = enable; in amdgpu_ttm_set_buffer_funcs_status()
1901 max_bytes = adev->mman.buffer_funcs->copy_max_bytes; in amdgpu_copy_buffer()
1903 num_dw = ALIGN(num_loops * adev->mman.buffer_funcs->copy_num_dw, 8); in amdgpu_copy_buffer()
1940 r = amdgpu_job_submit(job, &adev->mman.entity, in amdgpu_copy_buffer()
1959 uint32_t max_bytes = adev->mman.buffer_funcs->fill_max_bytes; in amdgpu_fill_buffer()
1960 struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring; in amdgpu_fill_buffer()
1969 if (!adev->mman.buffer_funcs_enabled) { in amdgpu_fill_buffer()
1993 num_dw = num_loops * adev->mman.buffer_funcs->fill_num_dw; in amdgpu_fill_buffer()
2028 r = amdgpu_job_submit(job, &adev->mman.entity, in amdgpu_fill_buffer()
2060 man = ttm_manager_type(&adev->mman.bdev, mem_type); in amdgpu_ttm_evict_resources()
2067 return ttm_resource_manager_evict_all(&adev->mman.bdev, man); in amdgpu_ttm_evict_resources()
2075 struct ttm_resource_manager *man = ttm_manager_type(&adev->mman.bdev, in amdgpu_mm_vram_table_show()
2087 return ttm_pool_debugfs(&adev->mman.bdev.pool, m); in amdgpu_ttm_page_pool_show()
2093 struct ttm_resource_manager *man = ttm_manager_type(&adev->mman.bdev, in amdgpu_mm_tt_table_show()
2104 struct ttm_resource_manager *man = ttm_manager_type(&adev->mman.bdev, in amdgpu_mm_gds_table_show()
2115 struct ttm_resource_manager *man = ttm_manager_type(&adev->mman.bdev, in amdgpu_mm_gws_table_show()
2126 struct ttm_resource_manager *man = ttm_manager_type(&adev->mman.bdev, in amdgpu_mm_oa_table_show()
2261 if (p->mapping != adev->mman.bdev.dev_mapping) in amdgpu_iomem_read()
2312 if (p->mapping != adev->mman.bdev.dev_mapping) in amdgpu_iomem_write()