Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
cirrus_drv.h File Reference
#include <video/vga.h>
#include <drm/drm_fb_helper.h>
#include <drm/ttm/ttm_bo_api.h>
#include <drm/ttm/ttm_bo_driver.h>
#include <drm/ttm/ttm_placement.h>
#include <drm/ttm/ttm_memory.h>
#include <drm/ttm/ttm_module.h>

Go to the source code of this file.

Data Structures

struct  cirrus_crtc
 
struct  cirrus_mode_info
 
struct  cirrus_encoder
 
struct  cirrus_connector
 
struct  cirrus_framebuffer
 
struct  cirrus_mc
 
struct  cirrus_device
 
struct  cirrus_fbdev
 
struct  cirrus_bo
 

Macros

#define DRIVER_AUTHOR   "Matthew Garrett"
 
#define DRIVER_NAME   "cirrus"
 
#define DRIVER_DESC   "qemu Cirrus emulation"
 
#define DRIVER_DATE   "20110418"
 
#define DRIVER_MAJOR   1
 
#define DRIVER_MINOR   0
 
#define DRIVER_PATCHLEVEL   0
 
#define CIRRUSFB_CONN_LIMIT   1
 
#define RREG8(reg)   ioread8(((void __iomem *)cdev->rmmio) + (reg))
 
#define WREG8(reg, v)   iowrite8(v, ((void __iomem *)cdev->rmmio) + (reg))
 
#define RREG32(reg)   ioread32(((void __iomem *)cdev->rmmio) + (reg))
 
#define WREG32(reg, v)   iowrite32(v, ((void __iomem *)cdev->rmmio) + (reg))
 
#define SEQ_INDEX   4
 
#define SEQ_DATA   5
 
#define WREG_SEQ(reg, v)
 
#define CRT_INDEX   0x14
 
#define CRT_DATA   0x15
 
#define WREG_CRT(reg, v)
 
#define GFX_INDEX   0xe
 
#define GFX_DATA   0xf
 
#define WREG_GFX(reg, v)
 
#define VGA_DAC_MASK   0x6
 
#define WREG_HDR(v)
 
#define CIRRUS_MAX_FB_HEIGHT   4096
 
#define CIRRUS_MAX_FB_WIDTH   4096
 
#define CIRRUS_DPMS_CLEARED   (-1)
 
#define to_cirrus_crtc(x)   container_of(x, struct cirrus_crtc, base)
 
#define to_cirrus_encoder(x)   container_of(x, struct cirrus_encoder, base)
 
#define to_cirrus_framebuffer(x)   container_of(x, struct cirrus_framebuffer, base)
 
#define gem_to_cirrus_bo(gobj)   container_of((gobj), struct cirrus_bo, gem)
 
#define to_cirrus_obj(x)   container_of(x, struct cirrus_gem_object, base)
 
#define DRM_FILE_PAGE_OFFSET   (0x100000000ULL >> PAGE_SHIFT)
 

Functions

void cirrus_crtc_fb_gamma_set (struct drm_crtc *crtc, u16 red, u16 green, u16 blue, int regno)
 
void cirrus_crtc_fb_gamma_get (struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue, int regno)
 
int cirrus_device_init (struct cirrus_device *cdev, struct drm_device *ddev, struct pci_dev *pdev, uint32_t flags)
 
void cirrus_device_fini (struct cirrus_device *cdev)
 
int cirrus_gem_init_object (struct drm_gem_object *obj)
 
void cirrus_gem_free_object (struct drm_gem_object *obj)
 
int cirrus_dumb_mmap_offset (struct drm_file *file, struct drm_device *dev, uint32_t handle, uint64_t *offset)
 
int cirrus_gem_create (struct drm_device *dev, u32 size, bool iskernel, struct drm_gem_object **obj)
 
int cirrus_dumb_create (struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args)
 
int cirrus_dumb_destroy (struct drm_file *file, struct drm_device *dev, uint32_t handle)
 
int cirrus_framebuffer_init (struct drm_device *dev, struct cirrus_framebuffer *gfb, struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj)
 
int cirrus_modeset_init (struct cirrus_device *cdev)
 
void cirrus_modeset_fini (struct cirrus_device *cdev)
 
int cirrus_fbdev_init (struct cirrus_device *cdev)
 
void cirrus_fbdev_fini (struct cirrus_device *cdev)
 
void cirrus_driver_irq_preinstall (struct drm_device *dev)
 
int cirrus_driver_irq_postinstall (struct drm_device *dev)
 
void cirrus_driver_irq_uninstall (struct drm_device *dev)
 
irqreturn_t cirrus_driver_irq_handler (DRM_IRQ_ARGS)
 
int cirrus_driver_load (struct drm_device *dev, unsigned long flags)
 
int cirrus_driver_unload (struct drm_device *dev)
 
int cirrus_mm_init (struct cirrus_device *cirrus)
 
void cirrus_mm_fini (struct cirrus_device *cirrus)
 
void cirrus_ttm_placement (struct cirrus_bo *bo, int domain)
 
int cirrus_bo_create (struct drm_device *dev, int size, int align, uint32_t flags, struct cirrus_bo **pcirrusbo)
 
int cirrus_mmap (struct file *filp, struct vm_area_struct *vma)
 
int cirrus_bo_reserve (struct cirrus_bo *bo, bool no_wait)
 
void cirrus_bo_unreserve (struct cirrus_bo *bo)
 
int cirrus_bo_push_sysram (struct cirrus_bo *bo)
 
int cirrus_bo_pin (struct cirrus_bo *bo, u32 pl_flag, u64 *gpu_addr)
 

Variables

struct drm_ioctl_desc cirrus_ioctls []
 
int cirrus_max_ioctl
 

Macro Definition Documentation

#define CIRRUS_DPMS_CLEARED   (-1)

Definition at line 88 of file cirrus_drv.h.

#define CIRRUS_MAX_FB_HEIGHT   4096

Definition at line 85 of file cirrus_drv.h.

#define CIRRUS_MAX_FB_WIDTH   4096

Definition at line 86 of file cirrus_drv.h.

#define CIRRUSFB_CONN_LIMIT   1

Definition at line 34 of file cirrus_drv.h.

#define CRT_DATA   0x15

Definition at line 51 of file cirrus_drv.h.

#define CRT_INDEX   0x14

Definition at line 50 of file cirrus_drv.h.

#define DRIVER_AUTHOR   "Matthew Garrett"

Definition at line 24 of file cirrus_drv.h.

#define DRIVER_DATE   "20110418"

Definition at line 28 of file cirrus_drv.h.

#define DRIVER_DESC   "qemu Cirrus emulation"

Definition at line 27 of file cirrus_drv.h.

#define DRIVER_MAJOR   1

Definition at line 30 of file cirrus_drv.h.

#define DRIVER_MINOR   0

Definition at line 31 of file cirrus_drv.h.

#define DRIVER_NAME   "cirrus"

Definition at line 26 of file cirrus_drv.h.

#define DRIVER_PATCHLEVEL   0

Definition at line 32 of file cirrus_drv.h.

#define DRM_FILE_PAGE_OFFSET   (0x100000000ULL >> PAGE_SHIFT)

Definition at line 177 of file cirrus_drv.h.

#define gem_to_cirrus_bo (   gobj)    container_of((gobj), struct cirrus_bo, gem)

Definition at line 167 of file cirrus_drv.h.

#define GFX_DATA   0xf

Definition at line 60 of file cirrus_drv.h.

#define GFX_INDEX   0xe

Definition at line 59 of file cirrus_drv.h.

#define RREG32 (   reg)    ioread32(((void __iomem *)cdev->rmmio) + (reg))

Definition at line 38 of file cirrus_drv.h.

#define RREG8 (   reg)    ioread8(((void __iomem *)cdev->rmmio) + (reg))

Definition at line 36 of file cirrus_drv.h.

#define SEQ_DATA   5

Definition at line 42 of file cirrus_drv.h.

#define SEQ_INDEX   4

Definition at line 41 of file cirrus_drv.h.

#define to_cirrus_crtc (   x)    container_of(x, struct cirrus_crtc, base)

Definition at line 90 of file cirrus_drv.h.

#define to_cirrus_encoder (   x)    container_of(x, struct cirrus_encoder, base)

Definition at line 91 of file cirrus_drv.h.

#define to_cirrus_framebuffer (   x)    container_of(x, struct cirrus_framebuffer, base)

Definition at line 92 of file cirrus_drv.h.

#define to_cirrus_obj (   x)    container_of(x, struct cirrus_gem_object, base)

Definition at line 176 of file cirrus_drv.h.

#define VGA_DAC_MASK   0x6

Definition at line 73 of file cirrus_drv.h.

#define WREG32 (   reg,
  v 
)    iowrite32(v, ((void __iomem *)cdev->rmmio) + (reg))

Definition at line 39 of file cirrus_drv.h.

#define WREG8 (   reg,
  v 
)    iowrite8(v, ((void __iomem *)cdev->rmmio) + (reg))

Definition at line 37 of file cirrus_drv.h.

#define WREG_CRT (   reg,
  v 
)
Value:
do { \
WREG8(CRT_INDEX, reg); \
WREG8(CRT_DATA, v); \
} while (0) \

Definition at line 53 of file cirrus_drv.h.

#define WREG_GFX (   reg,
  v 
)
Value:
do { \
WREG8(GFX_INDEX, reg); \
WREG8(GFX_DATA, v); \
} while (0) \

Definition at line 62 of file cirrus_drv.h.

#define WREG_HDR (   v)
Value:
do { \
RREG8(VGA_DAC_MASK); \
RREG8(VGA_DAC_MASK); \
RREG8(VGA_DAC_MASK); \
RREG8(VGA_DAC_MASK); \
WREG8(VGA_DAC_MASK, v); \
} while (0) \

Definition at line 75 of file cirrus_drv.h.

#define WREG_SEQ (   reg,
  v 
)
Value:
do { \
WREG8(SEQ_INDEX, reg); \
WREG8(SEQ_DATA, v); \
} while (0) \

Definition at line 44 of file cirrus_drv.h.

Function Documentation

int cirrus_bo_create ( struct drm_device dev,
int  size,
int  align,
uint32_t  flags,
struct cirrus_bo **  pcirrusbo 
)

Definition at line 336 of file cirrus_ttm.c.

int cirrus_bo_pin ( struct cirrus_bo bo,
u32  pl_flag,
u64 gpu_addr 
)

Definition at line 378 of file cirrus_ttm.c.

int cirrus_bo_push_sysram ( struct cirrus_bo bo)

Definition at line 421 of file cirrus_ttm.c.

int cirrus_bo_reserve ( struct cirrus_bo bo,
bool  no_wait 
)

Definition at line 318 of file cirrus_ttm.c.

void cirrus_bo_unreserve ( struct cirrus_bo bo)

Definition at line 331 of file cirrus_ttm.c.

void cirrus_crtc_fb_gamma_get ( struct drm_crtc crtc,
u16 red,
u16 green,
u16 blue,
int  regno 
)

Gets the color ramps on behalf of fbcon

Definition at line 419 of file cirrus_mode.c.

void cirrus_crtc_fb_gamma_set ( struct drm_crtc crtc,
u16  red,
u16  green,
u16  blue,
int  regno 
)

Sets the color ramps on behalf of fbcon

Definition at line 408 of file cirrus_mode.c.

void cirrus_device_fini ( struct cirrus_device cdev)

Definition at line 162 of file cirrus_main.c.

int cirrus_device_init ( struct cirrus_device cdev,
struct drm_device ddev,
struct pci_dev pdev,
uint32_t  flags 
)

Definition at line 126 of file cirrus_main.c.

irqreturn_t cirrus_driver_irq_handler ( DRM_IRQ_ARGS  )
int cirrus_driver_irq_postinstall ( struct drm_device dev)
void cirrus_driver_irq_preinstall ( struct drm_device dev)
void cirrus_driver_irq_uninstall ( struct drm_device dev)
int cirrus_driver_load ( struct drm_device dev,
unsigned long  flags 
)

Definition at line 173 of file cirrus_main.c.

int cirrus_driver_unload ( struct drm_device dev)

Definition at line 204 of file cirrus_main.c.

int cirrus_dumb_create ( struct drm_file *  file,
struct drm_device dev,
struct drm_mode_create_dumb args 
)

Definition at line 241 of file cirrus_main.c.

int cirrus_dumb_destroy ( struct drm_file *  file,
struct drm_device dev,
uint32_t  handle 
)

Definition at line 266 of file cirrus_main.c.

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

Definition at line 309 of file cirrus_main.c.

void cirrus_fbdev_fini ( struct cirrus_device cdev)

Definition at line 298 of file cirrus_fbdev.c.

int cirrus_fbdev_init ( struct cirrus_device cdev)

Definition at line 272 of file cirrus_fbdev.c.

int cirrus_framebuffer_init ( struct drm_device dev,
struct cirrus_framebuffer gfb,
struct drm_mode_fb_cmd2 mode_cmd,
struct drm_gem_object *  obj 
)

Definition at line 38 of file cirrus_main.c.

int cirrus_gem_create ( struct drm_device dev,
u32  size,
bool  iskernel,
struct drm_gem_object **  obj 
)

Definition at line 218 of file cirrus_main.c.

void cirrus_gem_free_object ( struct drm_gem_object *  obj)

Definition at line 293 of file cirrus_main.c.

int cirrus_gem_init_object ( struct drm_gem_object *  obj)

Definition at line 273 of file cirrus_main.c.

void cirrus_mm_fini ( struct cirrus_device cirrus)

Definition at line 282 of file cirrus_ttm.c.

int cirrus_mm_init ( struct cirrus_device cirrus)

Definition at line 248 of file cirrus_ttm.c.

int cirrus_mmap ( struct file filp,
struct vm_area_struct vma 
)

Definition at line 447 of file cirrus_ttm.c.

void cirrus_modeset_fini ( struct cirrus_device cdev)

Definition at line 620 of file cirrus_mode.c.

int cirrus_modeset_init ( struct cirrus_device cdev)

Definition at line 578 of file cirrus_mode.c.

void cirrus_ttm_placement ( struct cirrus_bo bo,
int  domain 
)

Definition at line 301 of file cirrus_ttm.c.

Variable Documentation

struct drm_ioctl_desc cirrus_ioctls[]
int cirrus_max_ioctl