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

Go to the source code of this file.

Macros

#define VMW_CMD_DEF(cmd, func)   [cmd - SVGA_3D_CMD_BASE] = func
 

Typedefs

typedef int(* vmw_cmd_func )(struct vmw_private *, struct vmw_sw_context *, SVGA3dCmdHeader *)
 

Functions

int vmw_execbuf_fence_commands (struct drm_file *file_priv, struct vmw_private *dev_priv, struct vmw_fence_obj **p_fence, uint32_t *p_handle)
 
void vmw_execbuf_copy_fence_user (struct vmw_private *dev_priv, struct vmw_fpriv *vmw_fp, int ret, struct drm_vmw_fence_rep __user *user_fence_rep, struct vmw_fence_obj *fence, uint32_t fence_handle)
 
int vmw_execbuf_process (struct drm_file *file_priv, struct vmw_private *dev_priv, void __user *user_commands, void *kernel_commands, uint32_t command_size, uint64_t throttle_us, struct drm_vmw_fence_rep __user *user_fence_rep, struct vmw_fence_obj **out_fence)
 
void vmw_execbuf_release_pinned_bo (struct vmw_private *dev_priv, bool only_on_cid_match, uint32_t cid)
 
int vmw_execbuf_ioctl (struct drm_device *dev, void *data, struct drm_file *file_priv)
 

Macro Definition Documentation

#define VMW_CMD_DEF (   cmd,
  func 
)    [cmd - SVGA_3D_CMD_BASE] = func

Definition at line 758 of file vmwgfx_execbuf.c.

Typedef Documentation

typedef int(* vmw_cmd_func)(struct vmw_private *, struct vmw_sw_context *, SVGA3dCmdHeader *)

Definition at line 754 of file vmwgfx_execbuf.c.

Function Documentation

void vmw_execbuf_copy_fence_user ( struct vmw_private dev_priv,
struct vmw_fpriv vmw_fp,
int  ret,
struct drm_vmw_fence_rep __user user_fence_rep,
struct vmw_fence_obj fence,
uint32_t  fence_handle 
)

vmw_execbuf_copy_fence_user - copy fence object information to user-space.

: Pointer to a vmw_private struct. : Pointer to the struct vmw_fpriv representing the calling file. : Return value from fence object creation. : User space address of a struct drm_vmw_fence_rep to which the information should be copied. : Pointer to the fenc object. : User-space fence handle.

This function copies fence information to user-space. If copying fails, The user-space struct drm_vmw_fence_rep::error member is hopefully left untouched, and if it's preloaded with an -EFAULT by user-space, the error will hopefully be detected. Also if copying fails, user-space will be unable to signal the fence object so we wait for it immediately, and then unreference the user-space reference.

Definition at line 1060 of file vmwgfx_execbuf.c.

int vmw_execbuf_fence_commands ( struct drm_file *  file_priv,
struct vmw_private dev_priv,
struct vmw_fence_obj **  p_fence,
uint32_t p_handle 
)

vmw_execbuf_fence_commands - create and submit a command stream fence

Creates a fence object and submits a command stream marker. If this fails for some reason, We sync the fifo and return NULL. It is then safe to fence buffers with a NULL pointer.

If is not NULL must also not be NULL. Creates a userspace handle if is not NULL, otherwise not.

Definition at line 1001 of file vmwgfx_execbuf.c.

int vmw_execbuf_ioctl ( struct drm_device dev,
void data,
struct drm_file *  file_priv 
)

Command submission - vmwgfx_execbuf.c

Definition at line 1342 of file vmwgfx_execbuf.c.

int vmw_execbuf_process ( struct drm_file *  file_priv,
struct vmw_private dev_priv,
void __user user_commands,
void kernel_commands,
uint32_t  command_size,
uint64_t  throttle_us,
struct drm_vmw_fence_rep __user user_fence_rep,
struct vmw_fence_obj **  out_fence 
)

Definition at line 1106 of file vmwgfx_execbuf.c.

void vmw_execbuf_release_pinned_bo ( struct vmw_private dev_priv,
bool  only_on_cid_match,
uint32_t  cid 
)

vmw_execbuf_release_pinned_bo - Flush queries and unpin the pinned query bo.

: The device private structure. : Only flush and unpin if the current active query cid matches . : Optional context id to match.

This function should be used to unpin the pinned query bo, or as a query barrier when we need to make sure that all queries have finished before the next fifo command. (For example on hardware context destructions where the hardware may otherwise leak unfinished queries).

This function does not return any failure codes, but make attempts to do safe unpinning in case of errors.

The function will synchronize on the previous query barrier, and will thus not finish until that barrier has executed.

Definition at line 1275 of file vmwgfx_execbuf.c.