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

Go to the source code of this file.

Data Structures

struct  mga_framebuffer
struct  mga_fbdev
struct  mga_crtc
struct  mga_mode_info
struct  mga_encoder
struct  mga_i2c_chan
struct  mga_connector
struct  mga_mc
struct  mga_device
struct  mgag200_bo


#define DRIVER_AUTHOR   "Matthew Garrett"
#define DRIVER_NAME   "mgag200"
#define DRIVER_DESC   "MGA G200 SE"
#define DRIVER_DATE   "20110418"
#define DRIVER_MAJOR   1
#define DRIVER_MINOR   0
#define MGAG200FB_CONN_LIMIT   1
#define RREG8(reg)   ioread8(((void __iomem *)mdev->rmmio) + (reg))
#define WREG8(reg, v)   iowrite8(v, ((void __iomem *)mdev->rmmio) + (reg))
#define RREG32(reg)   ioread32(((void __iomem *)mdev->rmmio) + (reg))
#define WREG32(reg, v)   iowrite32(v, ((void __iomem *)mdev->rmmio) + (reg))
#define ATTR_INDEX   0x1fc0
#define ATTR_DATA   0x1fc1
#define WREG_ATTR(reg, v)
#define WREG_SEQ(reg, v)
#define WREG_CRT(reg, v)
#define WREG_ECRT(reg, v)
#define GFX_INDEX   0x1fce
#define GFX_DATA   0x1fcf
#define WREG_GFX(reg, v)
#define DAC_INDEX   0x3c00
#define DAC_DATA   0x3c0a
#define WREG_DAC(reg, v)
#define MGA_MISC_OUT   0x1fc2
#define MGA_MISC_IN   0x1fcc
#define MGAG200_MAX_FB_HEIGHT   4096
#define MGAG200_MAX_FB_WIDTH   4096
#define MATROX_DPMS_CLEARED   (-1)
#define to_mga_crtc(x)   container_of(x, struct mga_crtc, base)
#define to_mga_encoder(x)   container_of(x, struct mga_encoder, base)
#define to_mga_connector(x)   container_of(x, struct mga_connector, base)
#define to_mga_framebuffer(x)   container_of(x, struct mga_framebuffer, base)
#define IS_G200_SE(mdev)   (mdev->type == G200_SE_A || mdev->type == G200_SE_B)
#define gem_to_mga_bo(gobj)   container_of((gobj), struct mgag200_bo, gem)
#define DRM_FILE_PAGE_OFFSET   (0x100000000ULL >> PAGE_SHIFT)


enum  mga_type {
  G200_SE_A, G200_SE_B, G200_WB, G200_EV,
  G200_EH, G200_ER


void mga_crtc_fb_gamma_set (struct drm_crtc *crtc, u16 red, u16 green, u16 blue, int regno)
void mga_crtc_fb_gamma_get (struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue, int regno)
int mgag200_modeset_init (struct mga_device *mdev)
void mgag200_modeset_fini (struct mga_device *mdev)
int mgag200_fbdev_init (struct mga_device *mdev)
void mgag200_fbdev_fini (struct mga_device *mdev)
int mgag200_framebuffer_init (struct drm_device *dev, struct mga_framebuffer *mfb, struct drm_mode_fb_cmd2 *mode_cmd, struct drm_gem_object *obj)
int mgag200_driver_load (struct drm_device *dev, unsigned long flags)
int mgag200_driver_unload (struct drm_device *dev)
int mgag200_gem_create (struct drm_device *dev, u32 size, bool iskernel, struct drm_gem_object **obj)
int mgag200_gem_init_object (struct drm_gem_object *obj)
int mgag200_dumb_create (struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args)
int mgag200_dumb_destroy (struct drm_file *file, struct drm_device *dev, uint32_t handle)
void mgag200_gem_free_object (struct drm_gem_object *obj)
int mgag200_dumb_mmap_offset (struct drm_file *file, struct drm_device *dev, uint32_t handle, uint64_t *offset)
struct mga_i2c_chanmgag200_i2c_create (struct drm_device *dev)
void mgag200_i2c_destroy (struct mga_i2c_chan *i2c)
void mgag200_ttm_placement (struct mgag200_bo *bo, int domain)
int mgag200_bo_reserve (struct mgag200_bo *bo, bool no_wait)
void mgag200_bo_unreserve (struct mgag200_bo *bo)
int mgag200_bo_create (struct drm_device *dev, int size, int align, uint32_t flags, struct mgag200_bo **pastbo)
int mgag200_mm_init (struct mga_device *mdev)
void mgag200_mm_fini (struct mga_device *mdev)
int mgag200_mmap (struct file *filp, struct vm_area_struct *vma)
int mgag200_bo_pin (struct mgag200_bo *bo, u32 pl_flag, u64 *gpu_addr)
int mgag200_bo_unpin (struct mgag200_bo *bo)
int mgag200_bo_push_sysram (struct mgag200_bo *bo)

Macro Definition Documentation

#define ATTR_DATA   0x1fc1

Definition at line 48 of file mgag200_drv.h.

#define ATTR_INDEX   0x1fc0

Definition at line 47 of file mgag200_drv.h.

#define DAC_DATA   0x3c0a

Definition at line 86 of file mgag200_drv.h.

#define DAC_INDEX   0x3c00

Definition at line 85 of file mgag200_drv.h.

#define DRIVER_AUTHOR   "Matthew Garrett"

Definition at line 30 of file mgag200_drv.h.

#define DRIVER_DATE   "20110418"

Definition at line 34 of file mgag200_drv.h.

#define DRIVER_DESC   "MGA G200 SE"

Definition at line 33 of file mgag200_drv.h.

#define DRIVER_MAJOR   1

Definition at line 36 of file mgag200_drv.h.

#define DRIVER_MINOR   0

Definition at line 37 of file mgag200_drv.h.

#define DRIVER_NAME   "mgag200"

Definition at line 32 of file mgag200_drv.h.


Definition at line 38 of file mgag200_drv.h.

#define DRM_FILE_PAGE_OFFSET   (0x100000000ULL >> PAGE_SHIFT)

Definition at line 262 of file mgag200_drv.h.

#define gem_to_mga_bo (   gobj)    container_of((gobj), struct mgag200_bo, gem)

Definition at line 212 of file mgag200_drv.h.

#define GFX_DATA   0x1fcf

Definition at line 77 of file mgag200_drv.h.

#define GFX_INDEX   0x1fce

Definition at line 76 of file mgag200_drv.h.

#define IS_G200_SE (   mdev)    (mdev->type == G200_SE_A || mdev->type == G200_SE_B)

Definition at line 167 of file mgag200_drv.h.

#define MATROX_DPMS_CLEARED   (-1)

Definition at line 100 of file mgag200_drv.h.

#define MGA_MISC_IN   0x1fcc

Definition at line 95 of file mgag200_drv.h.

#define MGA_MISC_OUT   0x1fc2

Definition at line 94 of file mgag200_drv.h.

#define MGAG200_MAX_FB_HEIGHT   4096

Definition at line 97 of file mgag200_drv.h.

#define MGAG200_MAX_FB_WIDTH   4096

Definition at line 98 of file mgag200_drv.h.

#define MGAG200FB_CONN_LIMIT   1

Definition at line 40 of file mgag200_drv.h.

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

Definition at line 44 of file mgag200_drv.h.

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

Definition at line 42 of file mgag200_drv.h.

#define to_mga_connector (   x)    container_of(x, struct mga_connector, base)

Definition at line 104 of file mgag200_drv.h.

#define to_mga_crtc (   x)    container_of(x, struct mga_crtc, base)

Definition at line 102 of file mgag200_drv.h.

#define to_mga_encoder (   x)    container_of(x, struct mga_encoder, base)

Definition at line 103 of file mgag200_drv.h.

#define to_mga_framebuffer (   x)    container_of(x, struct mga_framebuffer, base)

Definition at line 105 of file mgag200_drv.h.

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

Definition at line 45 of file mgag200_drv.h.

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

Definition at line 43 of file mgag200_drv.h.

#define WREG_ATTR (   reg,
do { \
RREG8(0x1fda); \
} while (0) \

Definition at line 50 of file mgag200_drv.h.

#define WREG_CRT (   reg,
do { \
} while (0) \

Definition at line 63 of file mgag200_drv.h.

#define WREG_DAC (   reg,
do { \
WREG8(DAC_INDEX, reg); \
} while (0) \

Definition at line 88 of file mgag200_drv.h.

#define WREG_ECRT (   reg,
do { \
} while (0) \

Definition at line 70 of file mgag200_drv.h.

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

Definition at line 79 of file mgag200_drv.h.

#define WREG_SEQ (   reg,
do { \
} while (0) \

Definition at line 57 of file mgag200_drv.h.

Enumeration Type Documentation

enum mga_type

Definition at line 158 of file mgag200_drv.h.

Function Documentation

void mga_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 1303 of file mgag200_mode.c.

void mga_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 1292 of file mgag200_mode.c.

int mgag200_bo_create ( struct drm_device dev,
int  size,
int  align,
uint32_t  flags,
struct mgag200_bo **  pastbo 

Definition at line 330 of file mgag200_ttm.c.

int mgag200_bo_pin ( struct mgag200_bo bo,
u32  pl_flag,
u64 gpu_addr 

Definition at line 372 of file mgag200_ttm.c.

int mgag200_bo_push_sysram ( struct mgag200_bo bo)

Definition at line 415 of file mgag200_ttm.c.

int mgag200_bo_reserve ( struct mgag200_bo bo,
bool  no_wait 

Definition at line 312 of file mgag200_ttm.c.

int mgag200_bo_unpin ( struct mgag200_bo bo)

Definition at line 395 of file mgag200_ttm.c.

void mgag200_bo_unreserve ( struct mgag200_bo bo)

Definition at line 325 of file mgag200_ttm.c.

int mgag200_driver_load ( struct drm_device dev,
unsigned long  flags 

Definition at line 219 of file mgag200_main.c.

int mgag200_driver_unload ( struct drm_device dev)

Definition at line 255 of file mgag200_main.c.

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

Definition at line 294 of file mgag200_main.c.

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

Definition at line 319 of file mgag200_main.c.

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

Definition at line 362 of file mgag200_main.c.

void mgag200_fbdev_fini ( struct mga_device mdev)

Definition at line 285 of file mgag200_fb.c.

int mgag200_fbdev_init ( struct mga_device mdev)

Definition at line 261 of file mgag200_fb.c.

int mgag200_framebuffer_init ( struct drm_device dev,
struct mga_framebuffer mfb,
struct drm_mode_fb_cmd2 mode_cmd,
struct drm_gem_object *  obj 

Definition at line 38 of file mgag200_main.c.

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

Definition at line 271 of file mgag200_main.c.

void mgag200_gem_free_object ( struct drm_gem_object *  obj)

Definition at line 346 of file mgag200_main.c.

int mgag200_gem_init_object ( struct drm_gem_object *  obj)

Definition at line 326 of file mgag200_main.c.

struct mga_i2c_chan* mgag200_i2c_create ( struct drm_device dev)

Definition at line 88 of file mgag200_i2c.c.

void mgag200_i2c_destroy ( struct mga_i2c_chan i2c)

Definition at line 148 of file mgag200_i2c.c.

void mgag200_mm_fini ( struct mga_device mdev)

Definition at line 280 of file mgag200_ttm.c.

int mgag200_mm_init ( struct mga_device mdev)

Definition at line 248 of file mgag200_ttm.c.

int mgag200_mmap ( struct file filp,
struct vm_area_struct vma 

Definition at line 441 of file mgag200_ttm.c.

void mgag200_modeset_fini ( struct mga_device mdev)

Definition at line 1530 of file mgag200_mode.c.

int mgag200_modeset_init ( struct mga_device mdev)

Definition at line 1492 of file mgag200_mode.c.

void mgag200_ttm_placement ( struct mgag200_bo bo,
int  domain 

Definition at line 295 of file mgag200_ttm.c.