Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
ttm_tt.c File Reference
#include <linux/sched.h>
#include <linux/highmem.h>
#include <linux/pagemap.h>
#include <linux/shmem_fs.h>
#include <linux/file.h>
#include <linux/swap.h>
#include <linux/slab.h>
#include <linux/export.h>
#include <drm/drm_cache.h>
#include <drm/drm_mem_util.h>
#include <drm/ttm/ttm_module.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_page_alloc.h>

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   "[TTM] " fmt
 

Functions

int ttm_tt_set_placement_caching (struct ttm_tt *ttm, uint32_t placement)
 
 EXPORT_SYMBOL (ttm_tt_set_placement_caching)
 
void ttm_tt_destroy (struct ttm_tt *ttm)
 
int ttm_tt_init (struct ttm_tt *ttm, struct ttm_bo_device *bdev, unsigned long size, uint32_t page_flags, struct page *dummy_read_page)
 
 EXPORT_SYMBOL (ttm_tt_init)
 
void ttm_tt_fini (struct ttm_tt *ttm)
 
 EXPORT_SYMBOL (ttm_tt_fini)
 
int ttm_dma_tt_init (struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, unsigned long size, uint32_t page_flags, struct page *dummy_read_page)
 
 EXPORT_SYMBOL (ttm_dma_tt_init)
 
void ttm_dma_tt_fini (struct ttm_dma_tt *ttm_dma)
 
 EXPORT_SYMBOL (ttm_dma_tt_fini)
 
void ttm_tt_unbind (struct ttm_tt *ttm)
 
int ttm_tt_bind (struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem)
 
 EXPORT_SYMBOL (ttm_tt_bind)
 
int ttm_tt_swapin (struct ttm_tt *ttm)
 
int ttm_tt_swapout (struct ttm_tt *ttm, struct file *persistent_swap_storage)
 

Macro Definition Documentation

#define pr_fmt (   fmt)    "[TTM] " fmt

Definition at line 31 of file ttm_tt.c.

Function Documentation

EXPORT_SYMBOL ( ttm_tt_set_placement_caching  )
EXPORT_SYMBOL ( ttm_tt_init  )
EXPORT_SYMBOL ( ttm_tt_fini  )
EXPORT_SYMBOL ( ttm_dma_tt_init  )
EXPORT_SYMBOL ( ttm_dma_tt_fini  )
EXPORT_SYMBOL ( ttm_tt_bind  )
void ttm_dma_tt_fini ( struct ttm_dma_tt ttm_dma)

Definition at line 241 of file ttm_tt.c.

int ttm_dma_tt_init ( struct ttm_dma_tt ttm_dma,
struct ttm_bo_device bdev,
unsigned long  size,
uint32_t  page_flags,
struct page dummy_read_page 
)

Definition at line 215 of file ttm_tt.c.

int ttm_tt_bind ( struct ttm_tt ttm,
struct ttm_mem_reg bo_mem 
)

ttm_ttm_bind:

: The struct ttm_tt containing backing pages. : The struct ttm_mem_reg identifying the binding location.

Bind the pages of to an aperture location identified by

Definition at line 263 of file ttm_tt.c.

void ttm_tt_destroy ( struct ttm_tt ttm)

ttm_ttm_destroy:

: The struct ttm_tt.

Unbind, unpopulate and destroy common struct ttm_tt.

Definition at line 164 of file ttm_tt.c.

void ttm_tt_fini ( struct ttm_tt ttm)

ttm_tt_fini

: the ttm_tt structure.

Free memory of ttm_tt structure

Definition at line 208 of file ttm_tt.c.

int ttm_tt_init ( struct ttm_tt ttm,
struct ttm_bo_device bdev,
unsigned long  size,
uint32_t  page_flags,
struct page dummy_read_page 
)

ttm_tt_init

: The struct ttm_tt. : pointer to a struct ttm_bo_device: : Size of the data needed backing. : Page flags as identified by TTM_PAGE_FLAG_XX flags. : See struct ttm_bo_device.

Create a struct ttm_tt to back data with system memory pages. No pages are actually allocated. Returns: NULL: Out of memory.

Definition at line 185 of file ttm_tt.c.

int ttm_tt_set_placement_caching ( struct ttm_tt ttm,
uint32_t  placement 
)

ttm_tt_set_placement_caching:

A struct ttm_tt the backing pages of which will change caching policy. : Flag indicating the desired caching policy.

This function will change caching policy of any default kernel mappings of the pages backing . If changing from cached to uncached or write-combined, all CPU caches will first be flushed to make sure the data of the pages hit RAM. This function may be very costly as it involves global TLB and cache flushes and potential page splitting / combining.

Definition at line 149 of file ttm_tt.c.

int ttm_tt_swapin ( struct ttm_tt ttm)

ttm_tt_swapin:

: The struct ttm_tt.

Swap in a previously swap out ttm_tt.

Definition at line 287 of file ttm_tt.c.

int ttm_tt_swapout ( struct ttm_tt ttm,
struct file persistent_swap_storage 
)

Definition at line 325 of file ttm_tt.c.

void ttm_tt_unbind ( struct ttm_tt ttm)

ttm_ttm_unbind:

: The struct ttm_tt.

Unbind a struct ttm_tt.

Definition at line 252 of file ttm_tt.c.