Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
radeon_gart.c File Reference
#include <drm/drmP.h>
#include <drm/radeon_drm.h>
#include "radeon.h"
#include "radeon_reg.h"

Go to the source code of this file.

Functions

int radeon_gart_table_ram_alloc (struct radeon_device *rdev)
 
void radeon_gart_table_ram_free (struct radeon_device *rdev)
 
int radeon_gart_table_vram_alloc (struct radeon_device *rdev)
 
int radeon_gart_table_vram_pin (struct radeon_device *rdev)
 
void radeon_gart_table_vram_unpin (struct radeon_device *rdev)
 
void radeon_gart_table_vram_free (struct radeon_device *rdev)
 
void radeon_gart_unbind (struct radeon_device *rdev, unsigned offset, int pages)
 
int radeon_gart_bind (struct radeon_device *rdev, unsigned offset, int pages, struct page **pagelist, dma_addr_t *dma_addr)
 
void radeon_gart_restore (struct radeon_device *rdev)
 
int radeon_gart_init (struct radeon_device *rdev)
 
void radeon_gart_fini (struct radeon_device *rdev)
 
int radeon_vm_manager_init (struct radeon_device *rdev)
 
void radeon_vm_manager_fini (struct radeon_device *rdev)
 
int radeon_vm_alloc_pt (struct radeon_device *rdev, struct radeon_vm *vm)
 
void radeon_vm_add_to_lru (struct radeon_device *rdev, struct radeon_vm *vm)
 
struct radeon_fenceradeon_vm_grab_id (struct radeon_device *rdev, struct radeon_vm *vm, int ring)
 
void radeon_vm_fence (struct radeon_device *rdev, struct radeon_vm *vm, struct radeon_fence *fence)
 
struct radeon_bo_varadeon_vm_bo_find (struct radeon_vm *vm, struct radeon_bo *bo)
 
struct radeon_bo_varadeon_vm_bo_add (struct radeon_device *rdev, struct radeon_vm *vm, struct radeon_bo *bo)
 
int radeon_vm_bo_set_addr (struct radeon_device *rdev, struct radeon_bo_va *bo_va, uint64_t soffset, uint32_t flags)
 
uint64_t radeon_vm_map_gart (struct radeon_device *rdev, uint64_t addr)
 
int radeon_vm_bo_update_pte (struct radeon_device *rdev, struct radeon_vm *vm, struct radeon_bo *bo, struct ttm_mem_reg *mem)
 
int radeon_vm_bo_rmv (struct radeon_device *rdev, struct radeon_bo_va *bo_va)
 
void radeon_vm_bo_invalidate (struct radeon_device *rdev, struct radeon_bo *bo)
 
void radeon_vm_init (struct radeon_device *rdev, struct radeon_vm *vm)
 
void radeon_vm_fini (struct radeon_device *rdev, struct radeon_vm *vm)
 

Function Documentation

int radeon_gart_bind ( struct radeon_device rdev,
unsigned  offset,
int  pages,
struct page **  pagelist,
dma_addr_t dma_addr 
)

radeon_gart_bind - bind pages into the gart page table

: radeon_device pointer : offset into the GPU's gart aperture : number of pages to bind : pages to bind : DMA addresses of pages

Binds the requested pages to the gart page table (all asics). Returns 0 for success, -EINVAL for failure.

Definition at line 271 of file radeon_gart.c.

void radeon_gart_fini ( struct radeon_device rdev)

radeon_gart_fini - tear down the driver info for managing the gart

: radeon_device pointer

Tear down the gart driver info and free the dummy page (all asics).

Definition at line 383 of file radeon_gart.c.

int radeon_gart_init ( struct radeon_device rdev)

radeon_gart_init - init the driver info for managing the gart

: radeon_device pointer

Allocate the dummy page and init the gart driver info (all asics). Returns 0 for success, error for failure.

Definition at line 337 of file radeon_gart.c.

void radeon_gart_restore ( struct radeon_device rdev)

radeon_gart_restore - bind all pages in the gart page table

: radeon_device pointer

Binds all pages in the gart page table (all asics). Used to rebuild the gart table on device startup or resume.

Definition at line 310 of file radeon_gart.c.

int radeon_gart_table_ram_alloc ( struct radeon_device rdev)

radeon_gart_table_ram_alloc - allocate system ram for gart page table

: radeon_device pointer

Allocate system memory for GART page table (r1xx-r3xx, non-pcie r4xx, rs400). These asics require the gart table to be in system memory. Returns 0 for success, -ENOMEM for failure.

Definition at line 66 of file radeon_gart.c.

void radeon_gart_table_ram_free ( struct radeon_device rdev)

radeon_gart_table_ram_free - free system ram for gart page table

: radeon_device pointer

Free system memory for GART page table (r1xx-r3xx, non-pcie r4xx, rs400). These asics require the gart table to be in system memory.

Definition at line 96 of file radeon_gart.c.

int radeon_gart_table_vram_alloc ( struct radeon_device rdev)

radeon_gart_table_vram_alloc - allocate vram for gart page table

: radeon_device pointer

Allocate video memory for GART page table (pcie r4xx, r5xx+). These asics require the gart table to be in video memory. Returns 0 for success, error for failure.

Definition at line 125 of file radeon_gart.c.

void radeon_gart_table_vram_free ( struct radeon_device rdev)

radeon_gart_table_vram_free - free gart page table vram

: radeon_device pointer

Free the video memory used for the GART page table (pcie r4xx, r5xx+). These asics require the gart table to be in video memory.

Definition at line 205 of file radeon_gart.c.

int radeon_gart_table_vram_pin ( struct radeon_device rdev)

radeon_gart_table_vram_pin - pin gart page table in vram

: radeon_device pointer

Pin the GART page table in vram so it will not be moved by the memory manager (pcie r4xx, r5xx+). These asics require the gart table to be in video memory. Returns 0 for success, error for failure.

Definition at line 150 of file radeon_gart.c.

void radeon_gart_table_vram_unpin ( struct radeon_device rdev)

radeon_gart_table_vram_unpin - unpin gart page table in vram

: radeon_device pointer

Unpin the GART page table in vram (pcie r4xx, r5xx+). These asics require the gart table to be in video memory.

Definition at line 180 of file radeon_gart.c.

void radeon_gart_unbind ( struct radeon_device rdev,
unsigned  offset,
int  pages 
)

radeon_gart_unbind - unbind pages from the gart page table

: radeon_device pointer : offset into the GPU's gart aperture : number of pages to unbind

Unbinds the requested pages from the gart page table and replaces them with the dummy page (all asics).

Definition at line 227 of file radeon_gart.c.

void radeon_vm_add_to_lru ( struct radeon_device rdev,
struct radeon_vm vm 
)

radeon_vm_add_to_lru - add VMs page table to LRU list

: radeon_device pointer : vm to add to LRU

Add the allocated page table to the LRU list (cayman+).

Global mutex must be locked!

Definition at line 665 of file radeon_gart.c.

int radeon_vm_alloc_pt ( struct radeon_device rdev,
struct radeon_vm vm 
)

radeon_vm_alloc_pt - allocates a page table for a VM

: radeon_device pointer : vm to bind

Allocate a page table for the requested vm (cayman+). Returns 0 for success, error for failure.

Global and local mutex must be locked!

Definition at line 608 of file radeon_gart.c.

struct radeon_bo_va* radeon_vm_bo_add ( struct radeon_device rdev,
struct radeon_vm vm,
struct radeon_bo bo 
)
read

radeon_vm_bo_add - add a bo to a specific vm

: radeon_device pointer : requested vm : radeon buffer object

Add into the requested vm (cayman+). Add to the list of bos associated with the vm Returns newly added bo_va or NULL for failure

Object has to be reserved!

Definition at line 786 of file radeon_gart.c.

struct radeon_bo_va* radeon_vm_bo_find ( struct radeon_vm vm,
struct radeon_bo bo 
)
read

radeon_vm_bo_find - find the bo_va for a specific vm & bo

: requested vm : requested buffer object

Find inside the requested vm (cayman+). Search inside the vm list for the requested vm Returns the found bo_va or NULL if none is found

Object has to be reserved!

Definition at line 760 of file radeon_gart.c.

void radeon_vm_bo_invalidate ( struct radeon_device rdev,
struct radeon_bo bo 
)

radeon_vm_bo_invalidate - mark the bo as invalid

: radeon_device pointer : requested vm : radeon buffer object

Mark as invalid (cayman+).

Definition at line 1235 of file radeon_gart.c.

int radeon_vm_bo_rmv ( struct radeon_device rdev,
struct radeon_bo_va bo_va 
)

radeon_vm_bo_rmv - remove a bo to a specific vm

: radeon_device pointer : requested bo_va

Remove ->bo from the requested vm (cayman+). Remove ->bo from the list of bos associated with the bo_va->vm and remove the ptes for in the page table. Returns 0 for success.

Object have to be reserved!

Definition at line 1209 of file radeon_gart.c.

int radeon_vm_bo_set_addr ( struct radeon_device rdev,
struct radeon_bo_va bo_va,
uint64_t  soffset,
uint32_t  flags 
)

radeon_vm_bo_set_addr - set bos virtual address inside a vm

: radeon_device pointer : bo_va to store the address : requested offset of the buffer in the VM address space : attributes of pages (read/write/valid/etc.)

Set offset of (cayman+). Validate and set the offset requested within the vm address space. Returns 0 for success, error for failure.

Object has to be reserved!

Definition at line 828 of file radeon_gart.c.

int radeon_vm_bo_update_pte ( struct radeon_device rdev,
struct radeon_vm vm,
struct radeon_bo bo,
struct ttm_mem_reg mem 
)

radeon_vm_bo_update_pte - map a bo into the vm page table

: radeon_device pointer : requested vm : radeon buffer object : ttm mem

Fill in the page table entries for (cayman+). Returns 0 for success, -EINVAL for failure.

Object have to be reserved & global and local mutex must be locked!

Definition at line 1077 of file radeon_gart.c.

void radeon_vm_fence ( struct radeon_device rdev,
struct radeon_vm vm,
struct radeon_fence fence 
)

radeon_vm_fence - remember fence for vm

: radeon_device pointer : vm we want to fence : fence to remember

Fence the vm (cayman+). Set the fence used to protect page table and id.

Global and local mutex must be locked!

Definition at line 737 of file radeon_gart.c.

void radeon_vm_fini ( struct radeon_device rdev,
struct radeon_vm vm 
)

radeon_vm_fini - tear down a vm instance

: radeon_device pointer : requested vm

Tear down (cayman+). Unbind the VM and remove all bos from the vm bo list

Definition at line 1272 of file radeon_gart.c.

struct radeon_fence* radeon_vm_grab_id ( struct radeon_device rdev,
struct radeon_vm vm,
int  ring 
)
read

radeon_vm_grab_id - allocate the next free VMID

: radeon_device pointer : vm to allocate id for : ring we want to submit job to

Allocate an id for the vm (cayman+). Returns the fence we need to sync to (if any).

Global and local mutex must be locked!

Definition at line 683 of file radeon_gart.c.

void radeon_vm_init ( struct radeon_device rdev,
struct radeon_vm vm 
)

radeon_vm_init - initialize a vm instance

: radeon_device pointer : requested vm

Init fields (cayman+).

Definition at line 1254 of file radeon_gart.c.

void radeon_vm_manager_fini ( struct radeon_device rdev)

radeon_vm_manager_fini - tear down the vm manager

: radeon_device pointer

Tear down the VM manager (cayman+).

Definition at line 542 of file radeon_gart.c.

int radeon_vm_manager_init ( struct radeon_device rdev)

radeon_vm_manager_init - init the vm manager

: radeon_device pointer

Init the vm manager (cayman+). Returns 0 for success, error for failure.

Definition at line 456 of file radeon_gart.c.

uint64_t radeon_vm_map_gart ( struct radeon_device rdev,
uint64_t  addr 
)

radeon_vm_map_gart - get the physical address of a gart page

: radeon_device pointer : the unmapped addr

Look up the physical address of the page that the pte resolves to (cayman+). Returns the physical address of the page.

Definition at line 903 of file radeon_gart.c.