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

Go to the source code of this file.

Data Structures

struct  drm_buffer
 

Functions

int drm_buffer_alloc (struct drm_buffer **buf, int size)
 
int drm_buffer_copy_from_user (struct drm_buffer *buf, void __user *user_data, int size)
 
void drm_buffer_free (struct drm_buffer *buf)
 
voiddrm_buffer_read_object (struct drm_buffer *buf, int objsize, void *stack_obj)
 

Function Documentation

int drm_buffer_alloc ( struct drm_buffer **  buf,
int  size 
)

Allocate the drm buffer object.

buf: A pointer to a pointer where the object is stored. size: The number of bytes to allocate.

Allocate the drm buffer object.

buf: Pointer to a pointer where the object is stored. size: The number of bytes to allocate.

Definition at line 44 of file drm_buffer.c.

int drm_buffer_copy_from_user ( struct drm_buffer buf,
void __user user_data,
int  size 
)

Copy the user data to the begin of the buffer and reset the processing iterator.

user_data: A pointer the data that is copied to the buffer. size: The Number of bytes to copy.

Definition at line 102 of file drm_buffer.c.

void drm_buffer_free ( struct drm_buffer buf)

Free the drm buffer object

Definition at line 135 of file drm_buffer.c.

void* drm_buffer_read_object ( struct drm_buffer buf,
int  objsize,
void stack_obj 
)

Read an object from buffer that may be split to multiple parts. If object is not split function just returns the pointer to object in buffer. But in case of split object data is copied to given stack object that is suplied by caller.

The processing location of the buffer is also advanced to the next byte after the object.

objsize: The size of the objet in bytes. stack_obj: A pointer to a memory location where object can be copied.

Definition at line 162 of file drm_buffer.c.