Lines Matching full:gart

42  * GART
43 * The GART (Graphics Aperture Remapping Table) is an aperture
49 * Radeon GPUs support both an internal GART, as described above,
50 * and AGP. AGP works similarly, but the GART table is configured
55 * Both AGP and internal GART can be used at the same time, however
58 * This file handles the common internal GART management.
62 * Common GART table functions.
71 * This dummy page is used by the driver as a filler for gart entries
72 * when pages are taken out of the GART
108 * amdgpu_gart_table_ram_alloc - allocate system ram for gart page table
112 * Allocate system memory for GART page table for ASICs that don't have
118 unsigned int order = get_order(adev->gart.table_size); in amdgpu_gart_table_ram_alloc()
128 if (adev->gart.bo != NULL) in amdgpu_gart_table_ram_alloc()
143 dma_addr = dma_map_page(&adev->pdev->dev, p, 0, adev->gart.table_size, in amdgpu_gart_table_ram_alloc()
146 dev_err(&adev->pdev->dev, "Failed to DMA MAP the GART BO page\n"); in amdgpu_gart_table_ram_alloc()
164 sg->sgl->length = adev->gart.table_size; in amdgpu_gart_table_ram_alloc()
166 sg->sgl->dma_length = adev->gart.table_size; in amdgpu_gart_table_ram_alloc()
170 bp.size = adev->gart.table_size; in amdgpu_gart_table_ram_alloc()
188 dev_err(adev->dev, "(%d) failed to reserve bo for GART system bo\n", ret); in amdgpu_gart_table_ram_alloc()
193 WARN(ret, "Pinning the GART table failed"); in amdgpu_gart_table_ram_alloc()
197 adev->gart.bo = bo; in amdgpu_gart_table_ram_alloc()
198 adev->gart.ptr = page_to_virt(p); in amdgpu_gart_table_ram_alloc()
199 /* Make GART table accessible in VMID0 */ in amdgpu_gart_table_ram_alloc()
200 ret = amdgpu_ttm_alloc_gart(&adev->gart.bo->tbo); in amdgpu_gart_table_ram_alloc()
220 * amdgpu_gart_table_ram_free - free gart page table system ram
224 * Free the system memory used for the GART page tableon ASICs that don't
229 unsigned int order = get_order(adev->gart.table_size); in amdgpu_gart_table_ram_free()
230 struct sg_table *sg = adev->gart.bo->tbo.sg; in amdgpu_gart_table_ram_free()
235 ret = amdgpu_bo_reserve(adev->gart.bo, false); in amdgpu_gart_table_ram_free()
237 amdgpu_bo_unpin(adev->gart.bo); in amdgpu_gart_table_ram_free()
238 amdgpu_bo_unreserve(adev->gart.bo); in amdgpu_gart_table_ram_free()
240 amdgpu_bo_unref(&adev->gart.bo); in amdgpu_gart_table_ram_free()
243 p = virt_to_page(adev->gart.ptr); in amdgpu_gart_table_ram_free()
248 adev->gart.ptr = NULL; in amdgpu_gart_table_ram_free()
252 * amdgpu_gart_table_vram_alloc - allocate vram for gart page table
256 * Allocate video memory for GART page table
258 * gart table to be in video memory.
263 if (adev->gart.bo != NULL) in amdgpu_gart_table_vram_alloc()
266 return amdgpu_bo_create_kernel(adev, adev->gart.table_size, PAGE_SIZE, in amdgpu_gart_table_vram_alloc()
267 AMDGPU_GEM_DOMAIN_VRAM, &adev->gart.bo, in amdgpu_gart_table_vram_alloc()
268 NULL, (void *)&adev->gart.ptr); in amdgpu_gart_table_vram_alloc()
272 * amdgpu_gart_table_vram_free - free gart page table vram
276 * Free the video memory used for the GART page table
277 * (pcie r4xx, r5xx+). These asics require the gart table to
282 amdgpu_bo_free_kernel(&adev->gart.bo, NULL, (void *)&adev->gart.ptr); in amdgpu_gart_table_vram_free()
286 * Common gart functions.
289 * amdgpu_gart_unbind - unbind pages from the gart page table
292 * @offset: offset into the GPU's gart aperture
295 * Unbinds the requested pages from the gart page table and
310 if (!adev->gart.ptr) in amdgpu_gart_unbind()
320 if (!adev->gart.ptr) in amdgpu_gart_unbind()
324 amdgpu_gmc_set_pte_pde(adev, adev->gart.ptr, in amdgpu_gart_unbind()
335 * amdgpu_gart_map - map dma_addresses into GART entries
338 * @offset: offset into the GPU's gart aperture
342 * @dst: CPU address of the gart table
344 * Map the dma_addresses into GART entries (all asics).
371 * amdgpu_gart_bind - bind pages into the gart page table
374 * @offset: offset into the GPU's gart aperture
379 * Binds the requested pages to the gart page table
387 if (!adev->gart.ptr) in amdgpu_gart_bind()
390 amdgpu_gart_map(adev, offset, pages, dma_addr, flags, adev->gart.ptr); in amdgpu_gart_bind()
394 * amdgpu_gart_invalidate_tlb - invalidate gart TLB
398 * Invalidate gart TLB which can be use as a way to flush gart changes
405 if (!adev->gart.ptr) in amdgpu_gart_invalidate_tlb()
418 * amdgpu_gart_init - init the driver info for managing the gart
422 * Allocate the dummy page and init the gart driver info (all asics).
441 adev->gart.num_cpu_pages = adev->gmc.gart_size / PAGE_SIZE; in amdgpu_gart_init()
442 adev->gart.num_gpu_pages = adev->gmc.gart_size / AMDGPU_GPU_PAGE_SIZE; in amdgpu_gart_init()
443 DRM_INFO("GART: num cpu pages %u, num gpu pages %u\n", in amdgpu_gart_init()
444 adev->gart.num_cpu_pages, adev->gart.num_gpu_pages); in amdgpu_gart_init()