Linux Kernel
3.7.1
|
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include <linux/log2.h>
#include <linux/export.h>
#include <asm/shmparam.h>
#include <drm/drmP.h>
Go to the source code of this file.
Generic buffer template
Definition in file drm_bufs.c.
int drm_addbufs | ( | struct drm_device * | dev, |
void * | data, | ||
struct drm_file * | file_priv | ||
) |
Add buffers for DMA transfers (ioctl).
inode | device inode. |
file_priv | DRM file private. |
cmd | command. |
arg | pointer to a struct drm_buf_desc request. |
According with the memory type specified in drm_buf_desc::flags and the build options, it dispatches the call either to addbufs_agp(), addbufs_sg() or addbufs_pci() for AGP, scatter-gather or consistent PCI memory respectively.
Definition at line 1292 of file drm_bufs.c.
int drm_addbufs_pci | ( | struct drm_device * | dev, |
struct drm_buf_desc * | request | ||
) |
Definition at line 764 of file drm_bufs.c.
int drm_addmap | ( | struct drm_device * | dev, |
resource_size_t | offset, | ||
unsigned int | size, | ||
enum drm_map_type | type, | ||
enum drm_map_flags | flags, | ||
struct drm_local_map ** | map_ptr | ||
) |
Definition at line 369 of file drm_bufs.c.
int drm_addmap_ioctl | ( | struct drm_device * | dev, |
void * | data, | ||
struct drm_file * | file_priv | ||
) |
Ioctl to specify a range of memory that is available for mapping by a non-root process.
inode | device inode. |
file_priv | DRM file private. |
cmd | command. |
arg | pointer to a drm_map structure. |
Definition at line 395 of file drm_bufs.c.
int drm_freebufs | ( | struct drm_device * | dev, |
void * | data, | ||
struct drm_file * | file_priv | ||
) |
Unreserve the buffers in list, previously reserved using drmDMA.
inode | device inode. |
file_priv | DRM file private. |
cmd | command. |
arg | pointer to a drm_buf_free structure. |
Calls free_buffer() for each used buffer. This function is primarily used for debugging.
Definition at line 1456 of file drm_bufs.c.
int drm_infobufs | ( | struct drm_device * | dev, |
void * | data, | ||
struct drm_file * | file_priv | ||
) |
Get information about the buffer mappings.
This was originally mean for debugging purposes, or by a sophisticated client library to determine how best to use the available buffers (e.g., large buffers can be used for image transfer).
inode | device inode. |
file_priv | DRM file private. |
cmd | command. |
arg | pointer to a drm_buf_info structure. |
Increments drm_device::buf_use while holding the drm_device::count_lock lock, preventing of allocating more buffers after this call. Information about each requested buffer is then copied into user space.
Definition at line 1333 of file drm_bufs.c.
int drm_mapbufs | ( | struct drm_device * | dev, |
void * | data, | ||
struct drm_file * | file_priv | ||
) |
Maps all of the DMA buffers into client-virtual space (ioctl).
inode | device inode. |
file_priv | DRM file private. |
cmd | command. |
arg | pointer to a drm_buf_map structure. |
Maps the AGP, SG or PCI buffer region with vm_mmap(), and copies information about each buffer into user space. For PCI buffers, it calls vm_mmap() with offset equal to 0, which drm_mmap() interpretes as PCI buffers and calls drm_mmap_dma().
Definition at line 1506 of file drm_bufs.c.
int drm_markbufs | ( | struct drm_device * | dev, |
void * | data, | ||
struct drm_file * | file_priv | ||
) |
Specifies a low and high water mark for buffer allocation
inode | device inode. |
file_priv | DRM file private. |
cmd | command. |
arg | a pointer to a drm_buf_desc structure. |
Verifies that the size order is bounded between the admissible orders and updates the respective drm_device_dma::bufs entry low and high water mark.
Definition at line 1412 of file drm_bufs.c.
Compute size order. Returns the exponent of the smaller power of two which is greater or equal to given number.
size | size. |
Definition at line 1602 of file drm_bufs.c.
int drm_rmmap | ( | struct drm_device * | dev, |
struct drm_local_map * | map | ||
) |
Definition at line 489 of file drm_bufs.c.
int drm_rmmap_ioctl | ( | struct drm_device * | dev, |
void * | data, | ||
struct drm_file * | file_priv | ||
) |
Definition at line 516 of file drm_bufs.c.
int drm_rmmap_locked | ( | struct drm_device * | dev, |
struct drm_local_map * | map | ||
) |
Remove a map private from list and deallocate resources if the mapping isn't in use.
Searches the map on drm_device::maplist, removes it from the list, see if its being used, and free any associate resource (such as MTRR's) if it's not being on use.
Definition at line 426 of file drm_bufs.c.
EXPORT_SYMBOL | ( | drm_addmap | ) |
EXPORT_SYMBOL | ( | drm_rmmap_locked | ) |
EXPORT_SYMBOL | ( | drm_rmmap | ) |
EXPORT_SYMBOL | ( | drm_addbufs_pci | ) |
EXPORT_SYMBOL | ( | drm_order | ) |