Lines Matching full:gart
41 * GART
42 * The GART (Graphics Aperture Remapping Table) is an aperture
48 * Radeon GPUs support both an internal GART, as described above,
49 * and AGP. AGP works similarly, but the GART table is configured
54 * Both AGP and internal GART can be used at the same time, however
57 * This file handles the common internal GART management.
61 * Common GART table functions.
70 * This dummy page is used by the driver as a filler for gart entries
71 * when pages are taken out of the GART
107 * amdgpu_gart_table_ram_alloc - allocate system ram for gart page table
111 * Allocate system memory for GART page table for ASICs that don't have
117 unsigned int order = get_order(adev->gart.table_size); in amdgpu_gart_table_ram_alloc()
127 if (adev->gart.bo != NULL) in amdgpu_gart_table_ram_alloc()
142 dma_addr = dma_map_page(&adev->pdev->dev, p, 0, adev->gart.table_size, in amdgpu_gart_table_ram_alloc()
145 dev_err(&adev->pdev->dev, "Failed to DMA MAP the GART BO page\n"); in amdgpu_gart_table_ram_alloc()
163 sg->sgl->length = adev->gart.table_size; in amdgpu_gart_table_ram_alloc()
165 sg->sgl->dma_length = adev->gart.table_size; in amdgpu_gart_table_ram_alloc()
169 bp.size = adev->gart.table_size; in amdgpu_gart_table_ram_alloc()
187 dev_err(adev->dev, "(%d) failed to reserve bo for GART system bo\n", ret); in amdgpu_gart_table_ram_alloc()
192 WARN(ret, "Pinning the GART table failed"); in amdgpu_gart_table_ram_alloc()
196 adev->gart.bo = bo; in amdgpu_gart_table_ram_alloc()
197 adev->gart.ptr = page_to_virt(p); in amdgpu_gart_table_ram_alloc()
198 /* Make GART table accessible in VMID0 */ in amdgpu_gart_table_ram_alloc()
199 ret = amdgpu_ttm_alloc_gart(&adev->gart.bo->tbo); in amdgpu_gart_table_ram_alloc()
219 * amdgpu_gart_table_ram_free - free gart page table system ram
223 * Free the system memory used for the GART page tableon ASICs that don't
228 unsigned int order = get_order(adev->gart.table_size); in amdgpu_gart_table_ram_free()
229 struct sg_table *sg = adev->gart.bo->tbo.sg; in amdgpu_gart_table_ram_free()
234 ret = amdgpu_bo_reserve(adev->gart.bo, false); in amdgpu_gart_table_ram_free()
236 amdgpu_bo_unpin(adev->gart.bo); in amdgpu_gart_table_ram_free()
237 amdgpu_bo_unreserve(adev->gart.bo); in amdgpu_gart_table_ram_free()
239 amdgpu_bo_unref(&adev->gart.bo); in amdgpu_gart_table_ram_free()
242 p = virt_to_page(adev->gart.ptr); in amdgpu_gart_table_ram_free()
247 adev->gart.ptr = NULL; in amdgpu_gart_table_ram_free()
251 * amdgpu_gart_table_vram_alloc - allocate vram for gart page table
255 * Allocate video memory for GART page table
257 * gart table to be in video memory.
262 if (adev->gart.bo != NULL) in amdgpu_gart_table_vram_alloc()
265 return amdgpu_bo_create_kernel(adev, adev->gart.table_size, PAGE_SIZE, in amdgpu_gart_table_vram_alloc()
266 AMDGPU_GEM_DOMAIN_VRAM, &adev->gart.bo, in amdgpu_gart_table_vram_alloc()
267 NULL, (void *)&adev->gart.ptr); in amdgpu_gart_table_vram_alloc()
271 * amdgpu_gart_table_vram_free - free gart page table vram
275 * Free the video memory used for the GART page table
276 * (pcie r4xx, r5xx+). These asics require the gart table to
281 amdgpu_bo_free_kernel(&adev->gart.bo, NULL, (void *)&adev->gart.ptr); in amdgpu_gart_table_vram_free()
285 * Common gart functions.
288 * amdgpu_gart_unbind - unbind pages from the gart page table
291 * @offset: offset into the GPU's gart aperture
294 * Unbinds the requested pages from the gart page table and
309 if (!adev->gart.ptr) in amdgpu_gart_unbind()
319 if (!adev->gart.ptr) in amdgpu_gart_unbind()
323 amdgpu_gmc_set_pte_pde(adev, adev->gart.ptr, in amdgpu_gart_unbind()
337 * amdgpu_gart_map - map dma_addresses into GART entries
340 * @offset: offset into the GPU's gart aperture
344 * @dst: CPU address of the gart table
346 * Map the dma_addresses into GART entries (all asics).
373 * amdgpu_gart_bind - bind pages into the gart page table
376 * @offset: offset into the GPU's gart aperture
381 * Binds the requested pages to the gart page table
389 if (!adev->gart.ptr) in amdgpu_gart_bind()
392 amdgpu_gart_map(adev, offset, pages, dma_addr, flags, adev->gart.ptr); in amdgpu_gart_bind()
396 * amdgpu_gart_invalidate_tlb - invalidate gart TLB
400 * Invalidate gart TLB which can be use as a way to flush gart changes
407 if (!adev->gart.ptr) in amdgpu_gart_invalidate_tlb()
417 * amdgpu_gart_init - init the driver info for managing the gart
421 * Allocate the dummy page and init the gart driver info (all asics).
440 adev->gart.num_cpu_pages = adev->gmc.gart_size / PAGE_SIZE; in amdgpu_gart_init()
441 adev->gart.num_gpu_pages = adev->gmc.gart_size / AMDGPU_GPU_PAGE_SIZE; in amdgpu_gart_init()
442 DRM_INFO("GART: num cpu pages %u, num gpu pages %u\n", in amdgpu_gart_init()
443 adev->gart.num_cpu_pages, adev->gart.num_gpu_pages); in amdgpu_gart_init()