Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
vmwgfx_dmabuf.c File Reference
#include <drm/ttm/ttm_placement.h>
#include <drm/drmP.h>
#include "vmwgfx_drv.h"

Go to the source code of this file.

Functions

int vmw_dmabuf_to_placement (struct vmw_private *dev_priv, struct vmw_dma_buffer *buf, struct ttm_placement *placement, bool interruptible)
 
int vmw_dmabuf_to_vram_or_gmr (struct vmw_private *dev_priv, struct vmw_dma_buffer *buf, bool pin, bool interruptible)
 
int vmw_dmabuf_to_vram (struct vmw_private *dev_priv, struct vmw_dma_buffer *buf, bool pin, bool interruptible)
 
int vmw_dmabuf_to_start_of_vram (struct vmw_private *dev_priv, struct vmw_dma_buffer *buf, bool pin, bool interruptible)
 
int vmw_dmabuf_unpin (struct vmw_private *dev_priv, struct vmw_dma_buffer *buf, bool interruptible)
 
void vmw_bo_get_guest_ptr (const struct ttm_buffer_object *bo, SVGAGuestPtr *ptr)
 
void vmw_bo_pin (struct ttm_buffer_object *bo, bool pin)
 

Function Documentation

void vmw_bo_get_guest_ptr ( const struct ttm_buffer_object bo,
SVGAGuestPtr ptr 
)

vmw_bo_get_guest_ptr - Get the guest ptr representing the current placement of a buffer.

: Pointer to a struct ttm_buffer_object. Must be pinned or reserved. : SVGAGuestPtr returning the result.

Definition at line 279 of file vmwgfx_dmabuf.c.

void vmw_bo_pin ( struct ttm_buffer_object bo,
bool  pin 
)

vmw_bo_pin - Pin or unpin a buffer object without moving it.

: The buffer object. Must be reserved, and present either in VRAM or GMR memory. : Whether to pin or unpin.

Definition at line 300 of file vmwgfx_dmabuf.c.

int vmw_dmabuf_to_placement ( struct vmw_private dev_priv,
struct vmw_dma_buffer buf,
struct ttm_placement placement,
bool  interruptible 
)

vmw_dmabuf_to_placement - Validate a buffer to placement.

: Driver private. : DMA buffer to move. : Pin buffer if true. : Use interruptible wait.

May only be called by the current master since it assumes that the master lock is the current master's lock. This function takes the master's lock in write mode. Flushes and unpins the query bo to avoid failures.

Returns -ERESTARTSYS if interrupted by a signal.

Definition at line 50 of file vmwgfx_dmabuf.c.

int vmw_dmabuf_to_start_of_vram ( struct vmw_private dev_priv,
struct vmw_dma_buffer buf,
bool  pin,
bool  interruptible 
)

vmw_dmabuf_to_start_of_vram - Move a buffer to start of vram.

May only be called by the current master since it assumes that the master lock is the current master's lock. This function takes the master's lock in write mode. Flushes and unpins the query bo if == true to avoid failures.

: Driver private. : DMA buffer to move. : Pin buffer in vram if true. : Use interruptible wait.

Returns -ERESTARTSYS if interrupted by a signal.

Definition at line 197 of file vmwgfx_dmabuf.c.

int vmw_dmabuf_to_vram ( struct vmw_private dev_priv,
struct vmw_dma_buffer buf,
bool  pin,
bool  interruptible 
)

vmw_dmabuf_to_vram - Move a buffer to vram.

May only be called by the current master since it assumes that the master lock is the current master's lock. This function takes the master's lock in write mode.

: Driver private. : DMA buffer to move. : Pin buffer in vram if true. : Use interruptible wait.

Returns -ERESTARTSYS if interrupted by a signal.

Definition at line 165 of file vmwgfx_dmabuf.c.

int vmw_dmabuf_to_vram_or_gmr ( struct vmw_private dev_priv,
struct vmw_dma_buffer buf,
bool  pin,
bool  interruptible 
)

vmw_dmabuf_to_vram_or_gmr - Move a buffer to vram or gmr.

May only be called by the current master since it assumes that the master lock is the current master's lock. This function takes the master's lock in write mode. Flushes and unpins the query bo if == true to avoid failures.

: Driver private. : DMA buffer to move. : Pin buffer if true. : Use interruptible wait.

Returns -ERESTARTSYS if interrupted by a signal.

Put BO in VRAM if there is space, otherwise as a GMR. If there is no space in VRAM and GMR ids are all used up, start evicting GMRs to make room. If the DMA buffer can't be used as a GMR, this will return -ENOMEM.

If that failed, try VRAM again, this time evicting previous contents.

Definition at line 94 of file vmwgfx_dmabuf.c.

int vmw_dmabuf_unpin ( struct vmw_private dev_priv,
struct vmw_dma_buffer buf,
bool  interruptible 
)

vmw_dmabuf_upin - Unpin the buffer given buffer, does not move the buffer.

May only be called by the current master since it assumes that the master lock is the current master's lock. This function takes the master's lock in write mode.

: Driver private. : DMA buffer to unpin. : Use interruptible wait.

Returns -ERESTARTSYS if interrupted by a signal.

Definition at line 257 of file vmwgfx_dmabuf.c.