Lines Matching full:gart
39 * GART
40 * The GART (Graphics Aperture Remapping Table) is an aperture
46 * Radeon GPUs support both an internal GART, as described above,
47 * and AGP. AGP works similarly, but the GART table is configured
52 * Both AGP and internal GART can be used at the same time, however
55 * This file handles the common internal GART management.
59 * Common GART table functions.
68 * This dummy page is used by the driver as a filler for gart entries
69 * when pages are taken out of the GART
105 * amdgpu_gart_table_vram_alloc - allocate vram for gart page table
109 * Allocate video memory for GART page table
111 * gart table to be in video memory.
118 if (adev->gart.bo == NULL) { in amdgpu_gart_table_vram_alloc()
122 bp.size = adev->gart.table_size; in amdgpu_gart_table_vram_alloc()
131 r = amdgpu_bo_create(adev, &bp, &adev->gart.bo); in amdgpu_gart_table_vram_alloc()
140 * amdgpu_gart_table_vram_pin - pin gart page table in vram
144 * Pin the GART page table in vram so it will not be moved
146 * gart table to be in video memory.
153 r = amdgpu_bo_reserve(adev->gart.bo, false); in amdgpu_gart_table_vram_pin()
156 r = amdgpu_bo_pin(adev->gart.bo, AMDGPU_GEM_DOMAIN_VRAM); in amdgpu_gart_table_vram_pin()
158 amdgpu_bo_unreserve(adev->gart.bo); in amdgpu_gart_table_vram_pin()
161 r = amdgpu_bo_kmap(adev->gart.bo, &adev->gart.ptr); in amdgpu_gart_table_vram_pin()
163 amdgpu_bo_unpin(adev->gart.bo); in amdgpu_gart_table_vram_pin()
164 amdgpu_bo_unreserve(adev->gart.bo); in amdgpu_gart_table_vram_pin()
169 * amdgpu_gart_table_vram_unpin - unpin gart page table in vram
173 * Unpin the GART page table in vram (pcie r4xx, r5xx+).
174 * These asics require the gart table to be in video memory.
180 if (adev->gart.bo == NULL) { in amdgpu_gart_table_vram_unpin()
183 r = amdgpu_bo_reserve(adev->gart.bo, true); in amdgpu_gart_table_vram_unpin()
185 amdgpu_bo_kunmap(adev->gart.bo); in amdgpu_gart_table_vram_unpin()
186 amdgpu_bo_unpin(adev->gart.bo); in amdgpu_gart_table_vram_unpin()
187 amdgpu_bo_unreserve(adev->gart.bo); in amdgpu_gart_table_vram_unpin()
188 adev->gart.ptr = NULL; in amdgpu_gart_table_vram_unpin()
193 * amdgpu_gart_table_vram_free - free gart page table vram
197 * Free the video memory used for the GART page table
198 * (pcie r4xx, r5xx+). These asics require the gart table to
203 if (adev->gart.bo == NULL) { in amdgpu_gart_table_vram_free()
206 amdgpu_bo_unref(&adev->gart.bo); in amdgpu_gart_table_vram_free()
207 adev->gart.ptr = NULL; in amdgpu_gart_table_vram_free()
211 * Common gart functions.
214 * amdgpu_gart_unbind - unbind pages from the gart page table
217 * @offset: offset into the GPU's gart aperture
220 * Unbinds the requested pages from the gart page table and
234 if (!adev->gart.ready) { in amdgpu_gart_unbind()
235 WARN(1, "trying to unbind memory from uninitialized GART !\n"); in amdgpu_gart_unbind()
243 if (!adev->gart.ptr) in amdgpu_gart_unbind()
247 amdgpu_gmc_set_pte_pde(adev, adev->gart.ptr, in amdgpu_gart_unbind()
261 * amdgpu_gart_map - map dma_addresses into GART entries
264 * @offset: offset into the GPU's gart aperture
268 * @dst: CPU address of the gart table
270 * Map the dma_addresses into GART entries (all asics).
280 if (!adev->gart.ready) { in amdgpu_gart_map()
281 WARN(1, "trying to bind memory to uninitialized GART !\n"); in amdgpu_gart_map()
298 * amdgpu_gart_bind - bind pages into the gart page table
301 * @offset: offset into the GPU's gart aperture
306 * Binds the requested pages to the gart page table
314 if (!adev->gart.ready) { in amdgpu_gart_bind()
315 WARN(1, "trying to bind memory to uninitialized GART !\n"); in amdgpu_gart_bind()
319 if (!adev->gart.ptr) in amdgpu_gart_bind()
323 adev->gart.ptr); in amdgpu_gart_bind()
327 * amdgpu_gart_invalidate_tlb - invalidate gart TLB
331 * Invalidate gart TLB which can be use as a way to flush gart changes
345 * amdgpu_gart_init - init the driver info for managing the gart
349 * Allocate the dummy page and init the gart driver info (all asics).
368 adev->gart.num_cpu_pages = adev->gmc.gart_size / PAGE_SIZE; in amdgpu_gart_init()
369 adev->gart.num_gpu_pages = adev->gmc.gart_size / AMDGPU_GPU_PAGE_SIZE; in amdgpu_gart_init()
370 DRM_INFO("GART: num cpu pages %u, num gpu pages %u\n", in amdgpu_gart_init()
371 adev->gart.num_cpu_pages, adev->gart.num_gpu_pages); in amdgpu_gart_init()