Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
omap_gem.c File Reference
#include <linux/spinlock.h>
#include <linux/shmem_fs.h>
#include "omap_drv.h"
#include "omap_dmm_tiler.h"

Go to the source code of this file.

Data Structures

struct  omap_gem_object
struct  usergart_entry
struct  omap_gem_sync_waiter


#define to_omap_bo(x)   container_of(x, struct omap_gem_object, base)
#define OMAP_BO_DMA   0x01000000 /* actually is physically contiguous */
#define OMAP_BO_EXT_SYNC   0x02000000 /* externally allocated sync object */
#define OMAP_BO_EXT_MEM   0x04000000 /* externally allocated memory */
#define SYNCDBG   0
#define SYNC(fmt,...)


struct page ** _drm_gem_get_pages (struct drm_gem_object *obj, gfp_t gfpmask)
void _drm_gem_put_pages (struct drm_gem_object *obj, struct page **pages, bool dirty, bool accessed)
int _drm_gem_create_mmap_offset_size (struct drm_gem_object *obj, size_t size)
uint32_t omap_gem_flags (struct drm_gem_object *obj)
uint64_t omap_gem_mmap_offset (struct drm_gem_object *obj)
size_t omap_gem_mmap_size (struct drm_gem_object *obj)
int omap_gem_tiled_size (struct drm_gem_object *obj, uint16_t *w, uint16_t *h)
int omap_gem_fault (struct vm_area_struct *vma, struct vm_fault *vmf)
int omap_gem_mmap (struct file *filp, struct vm_area_struct *vma)
int omap_gem_mmap_obj (struct drm_gem_object *obj, struct vm_area_struct *vma)
int omap_gem_dumb_create (struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args)
int omap_gem_dumb_destroy (struct drm_file *file, struct drm_device *dev, uint32_t handle)
int omap_gem_dumb_map_offset (struct drm_file *file, struct drm_device *dev, uint32_t handle, uint64_t *offset)
int omap_gem_roll (struct drm_gem_object *obj, uint32_t roll)
void omap_gem_cpu_sync (struct drm_gem_object *obj, int pgoff)
void omap_gem_dma_sync (struct drm_gem_object *obj, enum dma_data_direction dir)
int omap_gem_get_paddr (struct drm_gem_object *obj, dma_addr_t *paddr, bool remap)
int omap_gem_put_paddr (struct drm_gem_object *obj)
int omap_gem_rotated_paddr (struct drm_gem_object *obj, uint32_t orient, int x, int y, dma_addr_t *paddr)
int omap_gem_tiled_stride (struct drm_gem_object *obj, uint32_t orient)
int omap_gem_get_pages (struct drm_gem_object *obj, struct page ***pages, bool remap)
int omap_gem_put_pages (struct drm_gem_object *obj)
voidomap_gem_vaddr (struct drm_gem_object *obj)
void omap_gem_op_update (void)
int omap_gem_op_start (struct drm_gem_object *obj, enum omap_gem_op op)
int omap_gem_op_finish (struct drm_gem_object *obj, enum omap_gem_op op)
int omap_gem_op_sync (struct drm_gem_object *obj, enum omap_gem_op op)
int omap_gem_op_async (struct drm_gem_object *obj, enum omap_gem_op op, void(*fxn)(void *arg), void *arg)
int omap_gem_set_sync_object (struct drm_gem_object *obj, void *syncobj)
int omap_gem_init_object (struct drm_gem_object *obj)
void omap_gem_free_object (struct drm_gem_object *obj)
int omap_gem_new_handle (struct drm_device *dev, struct drm_file *file, union omap_gem_size gsize, uint32_t flags, uint32_t *handle)
struct drm_gem_object * omap_gem_new (struct drm_device *dev, union omap_gem_size gsize, uint32_t flags)
void omap_gem_init (struct drm_device *dev)
void omap_gem_deinit (struct drm_device *dev)

Macro Definition Documentation


Definition at line 135 of file omap_gem.c.

#define OMAP_BO_DMA   0x01000000 /* actually is physically contiguous */

Definition at line 40 of file omap_gem.c.

#define OMAP_BO_EXT_MEM   0x04000000 /* externally allocated memory */

Definition at line 42 of file omap_gem.c.

#define OMAP_BO_EXT_SYNC   0x02000000 /* externally allocated sync object */

Definition at line 41 of file omap_gem.c.

#define SYNC (   fmt,
do { if (SYNCDBG) \
printk(KERN_ERR "%s:%d: "fmt"\n", \
__func__, __LINE__, ##__VA_ARGS__); \
} while (0)

Definition at line 1052 of file omap_gem.c.

#define SYNCDBG   0

Definition at line 1051 of file omap_gem.c.

#define to_omap_bo (   x)    container_of(x, struct omap_gem_object, base)

Definition at line 37 of file omap_gem.c.

Function Documentation

int _drm_gem_create_mmap_offset_size ( struct drm_gem_object *  obj,
size_t  size 

Definition at line 117 of file omap_gem_helpers.c.

struct page** _drm_gem_get_pages ( struct drm_gem_object *  obj,
gfp_t  gfpmask 

drm_gem_get_pages - helper to allocate backing pages for a GEM object : obj in question : gfp mask of requested pages

Definition at line 35 of file omap_gem_helpers.c.

void _drm_gem_put_pages ( struct drm_gem_object *  obj,
struct page **  pages,
bool  dirty,
bool  accessed 

drm_gem_put_pages - helper to free backing pages for a GEM object : obj in question : pages to free

Definition at line 95 of file omap_gem_helpers.c.

void omap_gem_cpu_sync ( struct drm_gem_object *  obj,
int  pgoff 

Definition at line 717 of file omap_gem.c.

void omap_gem_deinit ( struct drm_device dev)

Definition at line 1485 of file omap_gem.c.

void omap_gem_dma_sync ( struct drm_gem_object *  obj,
enum dma_data_direction  dir 

Definition at line 730 of file omap_gem.c.

int omap_gem_dumb_create ( struct drm_file *  file,
struct drm_device dev,
struct drm_mode_create_dumb args 

omap_gem_dumb_create - create a dumb buffer : our client file : our device : the requested arguments copied from userspace

Allocate a buffer suitable for use for a frame buffer of the form described by user space. Give userspace a handle by which to reference it.

Definition at line 615 of file omap_gem.c.

int omap_gem_dumb_destroy ( struct drm_file *  file,
struct drm_device dev,
uint32_t  handle 

Definition at line 640 of file omap_gem.c.

int omap_gem_dumb_map_offset ( struct drm_file *  file,
struct drm_device dev,
uint32_t  handle,
uint64_t offset 

Definition at line 656 of file omap_gem.c.

int omap_gem_fault ( struct vm_area_struct vma,
struct vm_fault *  vmf 

omap_gem_fault - pagefault handler for GEM objects : the VMA of the GEM object : fault detail

Invoked when a fault occurs on an mmap of a GEM managed area. GEM does most of the work for us including the actual map/unmap calls but we need to do the actual page work.

The VMA was set up by GEM. In doing so it also ensured that the vma->vm_private_data points to the GEM object that is backing this mapping.

Definition at line 509 of file omap_gem.c.

uint32_t omap_gem_flags ( struct drm_gem_object *  obj)

Definition at line 302 of file omap_gem.c.

void omap_gem_free_object ( struct drm_gem_object *  obj)

Definition at line 1277 of file omap_gem.c.

int omap_gem_get_paddr ( struct drm_gem_object *  obj,
dma_addr_t paddr,
bool  remap 

Definition at line 760 of file omap_gem.c.

int omap_gem_get_pages ( struct drm_gem_object *  obj,
struct page ***  pages,
bool  remap 

Definition at line 922 of file omap_gem.c.

void omap_gem_init ( struct drm_device dev)

Definition at line 1430 of file omap_gem.c.

int omap_gem_init_object ( struct drm_gem_object *  obj)

Definition at line 1269 of file omap_gem.c.

int omap_gem_mmap ( struct file filp,
struct vm_area_struct vma 

We override mainly to fix up some of the vm mapping flags..

Definition at line 555 of file omap_gem.c.

int omap_gem_mmap_obj ( struct drm_gem_object *  obj,
struct vm_area_struct vma 

Definition at line 568 of file omap_gem.c.

uint64_t omap_gem_mmap_offset ( struct drm_gem_object *  obj)

Definition at line 328 of file omap_gem.c.

size_t omap_gem_mmap_size ( struct drm_gem_object *  obj)

get mmap size

Definition at line 338 of file omap_gem.c.

struct drm_gem_object* omap_gem_new ( struct drm_device dev,
union omap_gem_size  gsize,
uint32_t  flags 

Definition at line 1345 of file omap_gem.c.

int omap_gem_new_handle ( struct drm_device dev,
struct drm_file *  file,
union omap_gem_size  gsize,
uint32_t  flags,
uint32_t handle 

Definition at line 1321 of file omap_gem.c.

int omap_gem_op_async ( struct drm_gem_object *  obj,
enum omap_gem_op  op,
void(*)(void *arg fxn,
void arg 

Definition at line 1196 of file omap_gem.c.

int omap_gem_op_finish ( struct drm_gem_object *  obj,
enum omap_gem_op  op 

Definition at line 1126 of file omap_gem.c.

int omap_gem_op_start ( struct drm_gem_object *  obj,
enum omap_gem_op  op 

Definition at line 1121 of file omap_gem.c.

int omap_gem_op_sync ( struct drm_gem_object *  obj,
enum omap_gem_op  op 

Definition at line 1140 of file omap_gem.c.

void omap_gem_op_update ( void  )

Definition at line 1113 of file omap_gem.c.

int omap_gem_put_paddr ( struct drm_gem_object *  obj)

Definition at line 832 of file omap_gem.c.

int omap_gem_put_pages ( struct drm_gem_object *  obj)

Definition at line 940 of file omap_gem.c.

int omap_gem_roll ( struct drm_gem_object *  obj,
uint32_t  roll 

Definition at line 682 of file omap_gem.c.

int omap_gem_rotated_paddr ( struct drm_gem_object *  obj,
uint32_t  orient,
int  x,
int  y,
dma_addr_t paddr 

Definition at line 864 of file omap_gem.c.

int omap_gem_set_sync_object ( struct drm_gem_object *  obj,
void syncobj 

Definition at line 1237 of file omap_gem.c.

int omap_gem_tiled_size ( struct drm_gem_object *  obj,
uint16_t w,
uint16_t h 

Definition at line 358 of file omap_gem.c.

int omap_gem_tiled_stride ( struct drm_gem_object *  obj,
uint32_t  orient 

Definition at line 881 of file omap_gem.c.

void* omap_gem_vaddr ( struct drm_gem_object *  obj)

Definition at line 953 of file omap_gem.c.

Variable Documentation

Definition at line 144 of file omap_gem.c.

int height

Definition at line 145 of file omap_gem.c.

int height_shift

Definition at line 146 of file omap_gem.c.

int last

Definition at line 149 of file omap_gem.c.

int slot_shift

Definition at line 147 of file omap_gem.c.

int stride_pfn

Definition at line 148 of file omap_gem.c.