Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
drm_mm.c File Reference
#include <drm/drmP.h>
#include <drm/drm_mm.h>
#include <linux/slab.h>
#include <linux/seq_file.h>
#include <linux/export.h>

Go to the source code of this file.

Macros

#define MM_UNUSED_TARGET   4
 

Functions

int drm_mm_pre_get (struct drm_mm *mm)
 
 EXPORT_SYMBOL (drm_mm_pre_get)
 
struct drm_mm_nodedrm_mm_get_block_generic (struct drm_mm_node *hole_node, unsigned long size, unsigned alignment, unsigned long color, int atomic)
 
 EXPORT_SYMBOL (drm_mm_get_block_generic)
 
int drm_mm_insert_node (struct drm_mm *mm, struct drm_mm_node *node, unsigned long size, unsigned alignment)
 
 EXPORT_SYMBOL (drm_mm_insert_node)
 
struct drm_mm_nodedrm_mm_get_block_range_generic (struct drm_mm_node *hole_node, unsigned long size, unsigned alignment, unsigned long color, unsigned long start, unsigned long end, int atomic)
 
 EXPORT_SYMBOL (drm_mm_get_block_range_generic)
 
int drm_mm_insert_node_in_range (struct drm_mm *mm, struct drm_mm_node *node, unsigned long size, unsigned alignment, unsigned long start, unsigned long end)
 
 EXPORT_SYMBOL (drm_mm_insert_node_in_range)
 
void drm_mm_remove_node (struct drm_mm_node *node)
 
 EXPORT_SYMBOL (drm_mm_remove_node)
 
void drm_mm_put_block (struct drm_mm_node *node)
 
 EXPORT_SYMBOL (drm_mm_put_block)
 
struct drm_mm_nodedrm_mm_search_free_generic (const struct drm_mm *mm, unsigned long size, unsigned alignment, unsigned long color, bool best_match)
 
 EXPORT_SYMBOL (drm_mm_search_free_generic)
 
struct drm_mm_nodedrm_mm_search_free_in_range_generic (const struct drm_mm *mm, unsigned long size, unsigned alignment, unsigned long color, unsigned long start, unsigned long end, bool best_match)
 
 EXPORT_SYMBOL (drm_mm_search_free_in_range_generic)
 
void drm_mm_replace_node (struct drm_mm_node *old, struct drm_mm_node *new)
 
 EXPORT_SYMBOL (drm_mm_replace_node)
 
void drm_mm_init_scan (struct drm_mm *mm, unsigned long size, unsigned alignment, unsigned long color)
 
 EXPORT_SYMBOL (drm_mm_init_scan)
 
void drm_mm_init_scan_with_range (struct drm_mm *mm, unsigned long size, unsigned alignment, unsigned long color, unsigned long start, unsigned long end)
 
 EXPORT_SYMBOL (drm_mm_init_scan_with_range)
 
int drm_mm_scan_add_block (struct drm_mm_node *node)
 
 EXPORT_SYMBOL (drm_mm_scan_add_block)
 
int drm_mm_scan_remove_block (struct drm_mm_node *node)
 
 EXPORT_SYMBOL (drm_mm_scan_remove_block)
 
int drm_mm_clean (struct drm_mm *mm)
 
 EXPORT_SYMBOL (drm_mm_clean)
 
int drm_mm_init (struct drm_mm *mm, unsigned long start, unsigned long size)
 
 EXPORT_SYMBOL (drm_mm_init)
 
void drm_mm_takedown (struct drm_mm *mm)
 
 EXPORT_SYMBOL (drm_mm_takedown)
 
void drm_mm_debug_table (struct drm_mm *mm, const char *prefix)
 
 EXPORT_SYMBOL (drm_mm_debug_table)
 

Macro Definition Documentation

#define MM_UNUSED_TARGET   4

Definition at line 50 of file drm_mm.c.

Function Documentation

int drm_mm_clean ( struct drm_mm mm)

Definition at line 628 of file drm_mm.c.

void drm_mm_debug_table ( struct drm_mm mm,
const char prefix 
)

Definition at line 683 of file drm_mm.c.

struct drm_mm_node* drm_mm_get_block_generic ( struct drm_mm_node hole_node,
unsigned long  size,
unsigned  alignment,
unsigned long  color,
int  atomic 
)
read

Definition at line 164 of file drm_mm.c.

struct drm_mm_node* drm_mm_get_block_range_generic ( struct drm_mm_node hole_node,
unsigned long  size,
unsigned  alignment,
unsigned long  color,
unsigned long  start,
unsigned long  end,
int  atomic 
)
read

Definition at line 252 of file drm_mm.c.

int drm_mm_init ( struct drm_mm mm,
unsigned long  start,
unsigned long  size 
)

Definition at line 636 of file drm_mm.c.

void drm_mm_init_scan ( struct drm_mm mm,
unsigned long  size,
unsigned  alignment,
unsigned long  color 
)

Initializa lru scanning.

This simply sets up the scanning routines with the parameters for the desired hole.

Warning: As long as the scan list is non-empty, no other operations than adding/removing nodes to/from the scan list are allowed.

Definition at line 482 of file drm_mm.c.

void drm_mm_init_scan_with_range ( struct drm_mm mm,
unsigned long  size,
unsigned  alignment,
unsigned long  color,
unsigned long  start,
unsigned long  end 
)

Initializa lru scanning.

This simply sets up the scanning routines with the parameters for the desired hole. This version is for range-restricted scans.

Warning: As long as the scan list is non-empty, no other operations than adding/removing nodes to/from the scan list are allowed.

Definition at line 507 of file drm_mm.c.

int drm_mm_insert_node ( struct drm_mm mm,
struct drm_mm_node node,
unsigned long  size,
unsigned  alignment 
)

Search for free space and insert a preallocated memory node. Returns -ENOSPC if no suitable free area is available. The preallocated memory node must be cleared.

Definition at line 187 of file drm_mm.c.

int drm_mm_insert_node_in_range ( struct drm_mm mm,
struct drm_mm_node node,
unsigned long  size,
unsigned  alignment,
unsigned long  start,
unsigned long  end 
)

Search for free space and insert a preallocated memory node. Returns -ENOSPC if no suitable free area is available. This is for range restricted allocations. The preallocated memory node must be cleared.

Definition at line 278 of file drm_mm.c.

int drm_mm_pre_get ( struct drm_mm mm)

Definition at line 82 of file drm_mm.c.

void drm_mm_put_block ( struct drm_mm_node node)

Definition at line 334 of file drm_mm.c.

void drm_mm_remove_node ( struct drm_mm_node node)

Remove a memory node from the allocator.

Definition at line 299 of file drm_mm.c.

void drm_mm_replace_node ( struct drm_mm_node old,
struct drm_mm_node new 
)

Moves an allocation. To be used with embedded struct drm_mm_node.

Definition at line 458 of file drm_mm.c.

int drm_mm_scan_add_block ( struct drm_mm_node node)

Add a node to the scan list that might be freed to make space for the desired hole.

Returns non-zero, if a hole has been found, zero otherwise.

Definition at line 533 of file drm_mm.c.

int drm_mm_scan_remove_block ( struct drm_mm_node node)

Remove a node from the scan list.

Nodes must be removed in the exact same order from the scan list as they have been added, otherwise the internal state of the memory manager will be corrupted.

When the scan list is empty, the selected memory nodes can be freed. An immediately following drm_mm_search_free with best_match = 0 will then return the just freed block (because its at the top of the free_stack list).

Returns one if this block should be evicted, zero otherwise. Will always return zero when no hole has been found.

Definition at line 598 of file drm_mm.c.

struct drm_mm_node* drm_mm_search_free_generic ( const struct drm_mm mm,
unsigned long  size,
unsigned  alignment,
unsigned long  color,
bool  best_match 
)
read

Definition at line 366 of file drm_mm.c.

struct drm_mm_node* drm_mm_search_free_in_range_generic ( const struct drm_mm mm,
unsigned long  size,
unsigned  alignment,
unsigned long  color,
unsigned long  start,
unsigned long  end,
bool  best_match 
)
read

Definition at line 408 of file drm_mm.c.

void drm_mm_takedown ( struct drm_mm mm)

Definition at line 662 of file drm_mm.c.

EXPORT_SYMBOL ( drm_mm_pre_get  )
EXPORT_SYMBOL ( drm_mm_get_block_generic  )
EXPORT_SYMBOL ( drm_mm_insert_node  )
EXPORT_SYMBOL ( drm_mm_get_block_range_generic  )
EXPORT_SYMBOL ( drm_mm_insert_node_in_range  )
EXPORT_SYMBOL ( drm_mm_remove_node  )
EXPORT_SYMBOL ( drm_mm_put_block  )
EXPORT_SYMBOL ( drm_mm_search_free_generic  )
EXPORT_SYMBOL ( drm_mm_replace_node  )
EXPORT_SYMBOL ( drm_mm_init_scan  )
EXPORT_SYMBOL ( drm_mm_init_scan_with_range  )
EXPORT_SYMBOL ( drm_mm_scan_add_block  )
EXPORT_SYMBOL ( drm_mm_scan_remove_block  )
EXPORT_SYMBOL ( drm_mm_clean  )
EXPORT_SYMBOL ( drm_mm_init  )
EXPORT_SYMBOL ( drm_mm_takedown  )
EXPORT_SYMBOL ( drm_mm_debug_table  )