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

Go to the source code of this file.

Data Structures

struct  drm_mm_node
 
struct  drm_mm
 

Macros

#define drm_mm_for_each_node(entry, mm)
 
#define drm_mm_for_each_scanned_node_reverse(entry, n, mm)
 

Functions

struct drm_mm_nodedrm_mm_get_block_generic (struct drm_mm_node *node, unsigned long size, unsigned alignment, unsigned long color, int atomic)
 
struct drm_mm_nodedrm_mm_get_block_range_generic (struct drm_mm_node *node, unsigned long size, unsigned alignment, unsigned long color, unsigned long start, unsigned long end, int atomic)
 
int drm_mm_insert_node (struct drm_mm *mm, struct drm_mm_node *node, unsigned long size, unsigned alignment)
 
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)
 
void drm_mm_put_block (struct drm_mm_node *cur)
 
void drm_mm_remove_node (struct drm_mm_node *node)
 
void drm_mm_replace_node (struct drm_mm_node *old, struct drm_mm_node *new)
 
struct drm_mm_nodedrm_mm_search_free_generic (const struct drm_mm *mm, unsigned long size, unsigned alignment, unsigned long color, bool best_match)
 
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)
 
int drm_mm_init (struct drm_mm *mm, unsigned long start, unsigned long size)
 
void drm_mm_takedown (struct drm_mm *mm)
 
int drm_mm_clean (struct drm_mm *mm)
 
int drm_mm_pre_get (struct drm_mm *mm)
 
void drm_mm_init_scan (struct drm_mm *mm, unsigned long size, unsigned alignment, unsigned long color)
 
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)
 
int drm_mm_scan_add_block (struct drm_mm_node *node)
 
int drm_mm_scan_remove_block (struct drm_mm_node *node)
 
void drm_mm_debug_table (struct drm_mm *mm, const char *prefix)
 

Macro Definition Documentation

#define drm_mm_for_each_node (   entry,
  mm 
)
Value:
&(mm)->head_node.node_list, \
node_list)

Definition at line 92 of file drm_mm.h.

#define drm_mm_for_each_scanned_node_reverse (   entry,
  n,
  mm 
)
Value:
for (entry = (mm)->prev_scanned_node, \
next = entry ? list_entry(entry->node_list.next, \
struct drm_mm_node, node_list) : NULL; \
entry != NULL; entry = next, \
next = entry ? list_entry(entry->node_list.next, \
struct drm_mm_node, node_list) : NULL) \
/*
* Basic range manager support (drm_mm.c)
*/

Definition at line 95 of file drm_mm.h.

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 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 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 cur)

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.