Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
ast_drv.h File Reference
#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>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>

Go to the source code of this file.

Data Structures

struct  ast_private
 
struct  ast_i2c_chan
 
struct  ast_connector
 
struct  ast_crtc
 
struct  ast_encoder
 
struct  ast_framebuffer
 
struct  ast_fbdev
 
struct  ast_vbios_stdtable
 
struct  ast_vbios_enhtable
 
struct  ast_vbios_dclk_info
 
struct  ast_vbios_mode_info
 
struct  ast_bo
 

Macros

#define DRIVER_AUTHOR   "Dave Airlie"
 
#define DRIVER_NAME   "ast"
 
#define DRIVER_DESC   "AST"
 
#define DRIVER_DATE   "20120228"
 
#define DRIVER_MAJOR   0
 
#define DRIVER_MINOR   1
 
#define DRIVER_PATCHLEVEL   0
 
#define PCI_CHIP_AST2000   0x2000
 
#define PCI_CHIP_AST2100   0x2010
 
#define PCI_CHIP_AST1180   0x1180
 
#define AST_DRAM_512Mx16   0
 
#define AST_DRAM_1Gx16   1
 
#define AST_DRAM_512Mx32   2
 
#define AST_DRAM_1Gx32   3
 
#define AST_DRAM_2Gx16   6
 
#define AST_DRAM_4Gx16   7
 
#define AST_IO_AR_PORT_WRITE   (0x40)
 
#define AST_IO_MISC_PORT_WRITE   (0x42)
 
#define AST_IO_SEQ_PORT   (0x44)
 
#define AST_DAC_INDEX_READ   (0x3c7)
 
#define AST_IO_DAC_INDEX_WRITE   (0x48)
 
#define AST_IO_DAC_DATA   (0x49)
 
#define AST_IO_GR_PORT   (0x4E)
 
#define AST_IO_CRTC_PORT   (0x54)
 
#define AST_IO_INPUT_STATUS1_READ   (0x5A)
 
#define AST_IO_MISC_PORT_READ   (0x4C)
 
#define __ast_read(x)
 
#define __ast_io_read(x)
 
#define __ast_write(x)
 
#define __ast_io_write(x)
 
#define AST_VIDMEM_SIZE_8M   0x00800000
 
#define AST_VIDMEM_SIZE_16M   0x01000000
 
#define AST_VIDMEM_SIZE_32M   0x02000000
 
#define AST_VIDMEM_SIZE_64M   0x04000000
 
#define AST_VIDMEM_SIZE_128M   0x08000000
 
#define AST_VIDMEM_DEFAULT_SIZE   AST_VIDMEM_SIZE_8M
 
#define AST_MAX_HWC_WIDTH   64
 
#define AST_MAX_HWC_HEIGHT   64
 
#define AST_HWC_SIZE   (AST_MAX_HWC_WIDTH*AST_MAX_HWC_HEIGHT*2)
 
#define AST_HWC_SIGNATURE_SIZE   32
 
#define AST_DEFAULT_HWC_NUM   2
 
#define AST_HWC_SIGNATURE_CHECKSUM   0x00
 
#define AST_HWC_SIGNATURE_SizeX   0x04
 
#define AST_HWC_SIGNATURE_SizeY   0x08
 
#define AST_HWC_SIGNATURE_X   0x0C
 
#define AST_HWC_SIGNATURE_Y   0x10
 
#define AST_HWC_SIGNATURE_HOTSPOTX   0x14
 
#define AST_HWC_SIGNATURE_HOTSPOTY   0x18
 
#define to_ast_crtc(x)   container_of(x, struct ast_crtc, base)
 
#define to_ast_connector(x)   container_of(x, struct ast_connector, base)
 
#define to_ast_encoder(x)   container_of(x, struct ast_encoder, base)
 
#define to_ast_framebuffer(x)   container_of(x, struct ast_framebuffer, base)
 
#define gem_to_ast_bo(gobj)   container_of((gobj), struct ast_bo, gem)
 
#define to_ast_obj(x)   container_of(x, struct ast_gem_object, base)
 
#define AST_MM_ALIGN_SHIFT   4
 
#define AST_MM_ALIGN_MASK   ((1 << AST_MM_ALIGN_SHIFT) - 1)
 
#define DRM_FILE_PAGE_OFFSET   (0x100000000ULL >> PAGE_SHIFT)
 

Enumerations

enum  ast_chip {
  AST2000, AST2100, AST1100, AST2200,
  AST2150, AST2300, AST1180
}
 

Functions

int ast_driver_load (struct drm_device *dev, unsigned long flags)
 
int ast_driver_unload (struct drm_device *dev)
 
 __ast_read (8)
 
 __ast_read (16)
 
 __ast_read (32) __ast_io_read(8)
 
 __ast_io_read (16)
 
 __ast_io_read (32)
 
 __ast_write (8)
 
 __ast_write (16)
 
 __ast_write (32)
 
 __ast_io_write (8)
 
 __ast_io_write (16)
 
void ast_set_index_reg_mask (struct ast_private *ast, uint32_t base, uint8_t index, uint8_t mask, uint8_t val)
 
uint8_t ast_get_index_reg (struct ast_private *ast, uint32_t base, uint8_t index)
 
uint8_t ast_get_index_reg_mask (struct ast_private *ast, uint32_t base, uint8_t index, uint8_t mask)
 
int ast_mode_init (struct drm_device *dev)
 
void ast_mode_fini (struct drm_device *dev)
 
int ast_framebuffer_init (struct drm_device *dev, struct ast_framebuffer *ast_fb, struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj)
 
int ast_fbdev_init (struct drm_device *dev)
 
void ast_fbdev_fini (struct drm_device *dev)
 
void ast_fbdev_set_suspend (struct drm_device *dev, int state)
 
int ast_dumb_create (struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args)
 
int ast_dumb_destroy (struct drm_file *file, struct drm_device *dev, uint32_t handle)
 
int ast_gem_init_object (struct drm_gem_object *obj)
 
void ast_gem_free_object (struct drm_gem_object *obj)
 
int ast_dumb_mmap_offset (struct drm_file *file, struct drm_device *dev, uint32_t handle, uint64_t *offset)
 
int ast_mm_init (struct ast_private *ast)
 
void ast_mm_fini (struct ast_private *ast)
 
int ast_bo_create (struct drm_device *dev, int size, int align, uint32_t flags, struct ast_bo **pastbo)
 
int ast_gem_create (struct drm_device *dev, u32 size, bool iskernel, struct drm_gem_object **obj)
 
int ast_bo_pin (struct ast_bo *bo, u32 pl_flag, u64 *gpu_addr)
 
int ast_bo_unpin (struct ast_bo *bo)
 
int ast_bo_reserve (struct ast_bo *bo, bool no_wait)
 
void ast_bo_unreserve (struct ast_bo *bo)
 
void ast_ttm_placement (struct ast_bo *bo, int domain)
 
int ast_bo_push_sysram (struct ast_bo *bo)
 
int ast_mmap (struct file *filp, struct vm_area_struct *vma)
 
void ast_post_gpu (struct drm_device *dev)
 

Macro Definition Documentation

#define __ast_io_read (   x)
Value:
static inline u##x ast_io_read##x(struct ast_private *ast, u32 reg) { \
u##x val = 0;\
val = ioread##x(ast->ioregs + reg); \
return val;\
}
#define __ast_io_write (   x)
Value:
static inline void ast_io_write##x(struct ast_private *ast, u32 reg, u##x val) {\
iowrite##x(val, ast->ioregs + reg);\
}

Definition at line 152 of file ast_drv.h.

#define __ast_read (   x)
Value:
static inline u##x ast_read##x(struct ast_private *ast, u32 reg) { \
u##x val = 0;\
val = ioread##x(ast->regs + reg); \
return val;\
}

Definition at line 121 of file ast_drv.h.

#define __ast_write (   x)
Value:
static inline void ast_write##x(struct ast_private *ast, u32 reg, u##x val) {\
iowrite##x(val, ast->regs + reg);\
}

Definition at line 143 of file ast_drv.h.

#define AST_DAC_INDEX_READ   (0x3c7)

Definition at line 113 of file ast_drv.h.

#define AST_DEFAULT_HWC_NUM   2

Definition at line 195 of file ast_drv.h.

#define AST_DRAM_1Gx16   1

Definition at line 68 of file ast_drv.h.

#define AST_DRAM_1Gx32   3

Definition at line 70 of file ast_drv.h.

#define AST_DRAM_2Gx16   6

Definition at line 71 of file ast_drv.h.

#define AST_DRAM_4Gx16   7

Definition at line 72 of file ast_drv.h.

#define AST_DRAM_512Mx16   0

Definition at line 67 of file ast_drv.h.

#define AST_DRAM_512Mx32   2

Definition at line 69 of file ast_drv.h.

#define AST_HWC_SIGNATURE_CHECKSUM   0x00

Definition at line 197 of file ast_drv.h.

#define AST_HWC_SIGNATURE_HOTSPOTX   0x14

Definition at line 202 of file ast_drv.h.

#define AST_HWC_SIGNATURE_HOTSPOTY   0x18

Definition at line 203 of file ast_drv.h.

#define AST_HWC_SIGNATURE_SIZE   32

Definition at line 193 of file ast_drv.h.

#define AST_HWC_SIGNATURE_SizeX   0x04

Definition at line 198 of file ast_drv.h.

#define AST_HWC_SIGNATURE_SizeY   0x08

Definition at line 199 of file ast_drv.h.

#define AST_HWC_SIGNATURE_X   0x0C

Definition at line 200 of file ast_drv.h.

#define AST_HWC_SIGNATURE_Y   0x10

Definition at line 201 of file ast_drv.h.

#define AST_HWC_SIZE   (AST_MAX_HWC_WIDTH*AST_MAX_HWC_HEIGHT*2)

Definition at line 192 of file ast_drv.h.

#define AST_IO_AR_PORT_WRITE   (0x40)

Definition at line 110 of file ast_drv.h.

#define AST_IO_CRTC_PORT   (0x54)

Definition at line 117 of file ast_drv.h.

#define AST_IO_DAC_DATA   (0x49)

Definition at line 115 of file ast_drv.h.

#define AST_IO_DAC_INDEX_WRITE   (0x48)

Definition at line 114 of file ast_drv.h.

#define AST_IO_GR_PORT   (0x4E)

Definition at line 116 of file ast_drv.h.

#define AST_IO_INPUT_STATUS1_READ   (0x5A)

Definition at line 118 of file ast_drv.h.

#define AST_IO_MISC_PORT_READ   (0x4C)

Definition at line 119 of file ast_drv.h.

#define AST_IO_MISC_PORT_WRITE   (0x42)

Definition at line 111 of file ast_drv.h.

#define AST_IO_SEQ_PORT   (0x44)

Definition at line 112 of file ast_drv.h.

#define AST_MAX_HWC_HEIGHT   64

Definition at line 190 of file ast_drv.h.

#define AST_MAX_HWC_WIDTH   64

Definition at line 189 of file ast_drv.h.

#define AST_MM_ALIGN_MASK   ((1 << AST_MM_ALIGN_SHIFT) - 1)

Definition at line 316 of file ast_drv.h.

#define AST_MM_ALIGN_SHIFT   4

Definition at line 315 of file ast_drv.h.

#define AST_VIDMEM_DEFAULT_SIZE   AST_VIDMEM_SIZE_8M

Definition at line 187 of file ast_drv.h.

#define AST_VIDMEM_SIZE_128M   0x08000000

Definition at line 185 of file ast_drv.h.

#define AST_VIDMEM_SIZE_16M   0x01000000

Definition at line 182 of file ast_drv.h.

#define AST_VIDMEM_SIZE_32M   0x02000000

Definition at line 183 of file ast_drv.h.

#define AST_VIDMEM_SIZE_64M   0x04000000

Definition at line 184 of file ast_drv.h.

#define AST_VIDMEM_SIZE_8M   0x00800000

Definition at line 181 of file ast_drv.h.

#define DRIVER_AUTHOR   "Dave Airlie"

Definition at line 42 of file ast_drv.h.

#define DRIVER_DATE   "20120228"

Definition at line 46 of file ast_drv.h.

#define DRIVER_DESC   "AST"

Definition at line 45 of file ast_drv.h.

#define DRIVER_MAJOR   0

Definition at line 48 of file ast_drv.h.

#define DRIVER_MINOR   1

Definition at line 49 of file ast_drv.h.

#define DRIVER_NAME   "ast"

Definition at line 44 of file ast_drv.h.

#define DRIVER_PATCHLEVEL   0

Definition at line 50 of file ast_drv.h.

#define DRM_FILE_PAGE_OFFSET   (0x100000000ULL >> PAGE_SHIFT)

Definition at line 332 of file ast_drv.h.

#define gem_to_ast_bo (   gobj)    container_of((gobj), struct ast_bo, gem)

Definition at line 304 of file ast_drv.h.

#define PCI_CHIP_AST1180   0x1180

Definition at line 54 of file ast_drv.h.

#define PCI_CHIP_AST2000   0x2000

Definition at line 52 of file ast_drv.h.

#define PCI_CHIP_AST2100   0x2010

Definition at line 53 of file ast_drv.h.

#define to_ast_connector (   x)    container_of(x, struct ast_connector, base)

Definition at line 245 of file ast_drv.h.

#define to_ast_crtc (   x)    container_of(x, struct ast_crtc, base)

Definition at line 244 of file ast_drv.h.

#define to_ast_encoder (   x)    container_of(x, struct ast_encoder, base)

Definition at line 246 of file ast_drv.h.

#define to_ast_framebuffer (   x)    container_of(x, struct ast_framebuffer, base)

Definition at line 247 of file ast_drv.h.

#define to_ast_obj (   x)    container_of(x, struct ast_gem_object, base)

Definition at line 313 of file ast_drv.h.

Enumeration Type Documentation

enum ast_chip
Enumerator:
AST2000 
AST2100 
AST1100 
AST2200 
AST2150 
AST2300 
AST1180 

Definition at line 57 of file ast_drv.h.

Function Documentation

__ast_io_read ( 16  )
__ast_io_read ( 32  )
__ast_io_write ( )
__ast_io_write ( 16  )
__ast_read ( )
__ast_read ( 16  )
__ast_read ( 32  )
__ast_write ( )
__ast_write ( 16  )
__ast_write ( 32  )
int ast_bo_create ( struct drm_device dev,
int  size,
int  align,
uint32_t  flags,
struct ast_bo **  pastbo 
)

Definition at line 331 of file ast_ttm.c.

int ast_bo_pin ( struct ast_bo bo,
u32  pl_flag,
u64 gpu_addr 
)

Definition at line 373 of file ast_ttm.c.

int ast_bo_push_sysram ( struct ast_bo bo)

Definition at line 416 of file ast_ttm.c.

int ast_bo_reserve ( struct ast_bo bo,
bool  no_wait 
)

Definition at line 313 of file ast_ttm.c.

int ast_bo_unpin ( struct ast_bo bo)

Definition at line 396 of file ast_ttm.c.

void ast_bo_unreserve ( struct ast_bo bo)

Definition at line 326 of file ast_ttm.c.

int ast_driver_load ( struct drm_device dev,
unsigned long  flags 
)

Definition at line 328 of file ast_main.c.

int ast_driver_unload ( struct drm_device dev)

Definition at line 397 of file ast_main.c.

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

Definition at line 435 of file ast_main.c.

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

Definition at line 460 of file ast_main.c.

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

Definition at line 501 of file ast_main.c.

void ast_fbdev_fini ( struct drm_device dev)

Definition at line 320 of file ast_fb.c.

int ast_fbdev_init ( struct drm_device dev)

Definition at line 296 of file ast_fb.c.

void ast_fbdev_set_suspend ( struct drm_device dev,
int  state 
)

Definition at line 332 of file ast_fb.c.

int ast_framebuffer_init ( struct drm_device dev,
struct ast_framebuffer ast_fb,
struct drm_mode_fb_cmd2 mode_cmd,
struct drm_gem_object *  obj 
)

Definition at line 262 of file ast_main.c.

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

Definition at line 412 of file ast_main.c.

void ast_gem_free_object ( struct drm_gem_object *  obj)

Definition at line 486 of file ast_main.c.

int ast_gem_init_object ( struct drm_gem_object *  obj)

Definition at line 467 of file ast_main.c.

uint8_t ast_get_index_reg ( struct ast_private ast,
uint32_t  base,
uint8_t  index 
)

Definition at line 47 of file ast_main.c.

uint8_t ast_get_index_reg_mask ( struct ast_private ast,
uint32_t  base,
uint8_t  index,
uint8_t  mask 
)

Definition at line 56 of file ast_main.c.

void ast_mm_fini ( struct ast_private ast)

Definition at line 281 of file ast_ttm.c.

int ast_mm_init ( struct ast_private ast)

Definition at line 248 of file ast_ttm.c.

int ast_mmap ( struct file filp,
struct vm_area_struct vma 
)

Definition at line 442 of file ast_ttm.c.

void ast_mode_fini ( struct drm_device dev)

Definition at line 866 of file ast_mode.c.

int ast_mode_init ( struct drm_device dev)

Definition at line 857 of file ast_mode.c.

void ast_post_gpu ( struct drm_device dev)

Definition at line 355 of file ast_post.c.

void ast_set_index_reg_mask ( struct ast_private ast,
uint32_t  base,
uint8_t  index,
uint8_t  mask,
uint8_t  val 
)

Definition at line 37 of file ast_main.c.

void ast_ttm_placement ( struct ast_bo bo,
int  domain 
)

Definition at line 296 of file ast_ttm.c.