Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions | Variables
r128_drv.h File Reference

Go to the source code of this file.

Data Structures

struct  drm_r128_freelist
 
struct  drm_r128_ring_buffer
 
struct  drm_r128_private
 
struct  drm_r128_buf_priv
 

Macros

#define DRIVER_AUTHOR   "Gareth Hughes, VA Linux Systems Inc."
 
#define DRIVER_NAME   "r128"
 
#define DRIVER_DESC   "ATI Rage 128"
 
#define DRIVER_DATE   "20030725"
 
#define DRIVER_MAJOR   2
 
#define DRIVER_MINOR   5
 
#define DRIVER_PATCHLEVEL   0
 
#define GET_RING_HEAD(dev_priv)   R128_READ(R128_PM4_BUFFER_DL_RPTR)
 
#define R128_AUX_SC_CNTL   0x1660
 
#define R128_AUX1_SC_EN   (1 << 0)
 
#define R128_AUX1_SC_MODE_OR   (0 << 1)
 
#define R128_AUX1_SC_MODE_NAND   (1 << 1)
 
#define R128_AUX2_SC_EN   (1 << 2)
 
#define R128_AUX2_SC_MODE_OR   (0 << 3)
 
#define R128_AUX2_SC_MODE_NAND   (1 << 3)
 
#define R128_AUX3_SC_EN   (1 << 4)
 
#define R128_AUX3_SC_MODE_OR   (0 << 5)
 
#define R128_AUX3_SC_MODE_NAND   (1 << 5)
 
#define R128_AUX1_SC_LEFT   0x1664
 
#define R128_AUX1_SC_RIGHT   0x1668
 
#define R128_AUX1_SC_TOP   0x166c
 
#define R128_AUX1_SC_BOTTOM   0x1670
 
#define R128_AUX2_SC_LEFT   0x1674
 
#define R128_AUX2_SC_RIGHT   0x1678
 
#define R128_AUX2_SC_TOP   0x167c
 
#define R128_AUX2_SC_BOTTOM   0x1680
 
#define R128_AUX3_SC_LEFT   0x1684
 
#define R128_AUX3_SC_RIGHT   0x1688
 
#define R128_AUX3_SC_TOP   0x168c
 
#define R128_AUX3_SC_BOTTOM   0x1690
 
#define R128_BRUSH_DATA0   0x1480
 
#define R128_BUS_CNTL   0x0030
 
#define R128_BUS_MASTER_DIS   (1 << 6)
 
#define R128_CLOCK_CNTL_INDEX   0x0008
 
#define R128_CLOCK_CNTL_DATA   0x000c
 
#define R128_PLL_WR_EN   (1 << 7)
 
#define R128_CONSTANT_COLOR_C   0x1d34
 
#define R128_CRTC_OFFSET   0x0224
 
#define R128_CRTC_OFFSET_CNTL   0x0228
 
#define R128_CRTC_OFFSET_FLIP_CNTL   (1 << 16)
 
#define R128_DP_GUI_MASTER_CNTL   0x146c
 
#define R128_GMC_SRC_PITCH_OFFSET_CNTL   (1 << 0)
 
#define R128_GMC_DST_PITCH_OFFSET_CNTL   (1 << 1)
 
#define R128_GMC_BRUSH_SOLID_COLOR   (13 << 4)
 
#define R128_GMC_BRUSH_NONE   (15 << 4)
 
#define R128_GMC_DST_16BPP   (4 << 8)
 
#define R128_GMC_DST_24BPP   (5 << 8)
 
#define R128_GMC_DST_32BPP   (6 << 8)
 
#define R128_GMC_DST_DATATYPE_SHIFT   8
 
#define R128_GMC_SRC_DATATYPE_COLOR   (3 << 12)
 
#define R128_DP_SRC_SOURCE_MEMORY   (2 << 24)
 
#define R128_DP_SRC_SOURCE_HOST_DATA   (3 << 24)
 
#define R128_GMC_CLR_CMP_CNTL_DIS   (1 << 28)
 
#define R128_GMC_AUX_CLIP_DIS   (1 << 29)
 
#define R128_GMC_WR_MSK_DIS   (1 << 30)
 
#define R128_ROP3_S   0x00cc0000
 
#define R128_ROP3_P   0x00f00000
 
#define R128_DP_WRITE_MASK   0x16cc
 
#define R128_DST_PITCH_OFFSET_C   0x1c80
 
#define R128_DST_TILE   (1 << 31)
 
#define R128_GEN_INT_CNTL   0x0040
 
#define R128_CRTC_VBLANK_INT_EN   (1 << 0)
 
#define R128_GEN_INT_STATUS   0x0044
 
#define R128_CRTC_VBLANK_INT   (1 << 0)
 
#define R128_CRTC_VBLANK_INT_AK   (1 << 0)
 
#define R128_GEN_RESET_CNTL   0x00f0
 
#define R128_SOFT_RESET_GUI   (1 << 0)
 
#define R128_GUI_SCRATCH_REG0   0x15e0
 
#define R128_GUI_SCRATCH_REG1   0x15e4
 
#define R128_GUI_SCRATCH_REG2   0x15e8
 
#define R128_GUI_SCRATCH_REG3   0x15ec
 
#define R128_GUI_SCRATCH_REG4   0x15f0
 
#define R128_GUI_SCRATCH_REG5   0x15f4
 
#define R128_GUI_STAT   0x1740
 
#define R128_GUI_FIFOCNT_MASK   0x0fff
 
#define R128_GUI_ACTIVE   (1 << 31)
 
#define R128_MCLK_CNTL   0x000f
 
#define R128_FORCE_GCP   (1 << 16)
 
#define R128_FORCE_PIPE3D_CP   (1 << 17)
 
#define R128_FORCE_RCP   (1 << 18)
 
#define R128_PC_GUI_CTLSTAT   0x1748
 
#define R128_PC_NGUI_CTLSTAT   0x0184
 
#define R128_PC_FLUSH_GUI   (3 << 0)
 
#define R128_PC_RI_GUI   (1 << 2)
 
#define R128_PC_FLUSH_ALL   0x00ff
 
#define R128_PC_BUSY   (1 << 31)
 
#define R128_PCI_GART_PAGE   0x017c
 
#define R128_PRIM_TEX_CNTL_C   0x1cb0
 
#define R128_SCALE_3D_CNTL   0x1a00
 
#define R128_SEC_TEX_CNTL_C   0x1d00
 
#define R128_SEC_TEXTURE_BORDER_COLOR_C   0x1d3c
 
#define R128_SETUP_CNTL   0x1bc4
 
#define R128_STEN_REF_MASK_C   0x1d40
 
#define R128_TEX_CNTL_C   0x1c9c
 
#define R128_TEX_CACHE_FLUSH   (1 << 23)
 
#define R128_WAIT_UNTIL   0x1720
 
#define R128_EVENT_CRTC_OFFSET   (1 << 0)
 
#define R128_WINDOW_XY_OFFSET   0x1bcc
 
#define R128_PM4_BUFFER_OFFSET   0x0700
 
#define R128_PM4_BUFFER_CNTL   0x0704
 
#define R128_PM4_MASK   (15 << 28)
 
#define R128_PM4_NONPM4   (0 << 28)
 
#define R128_PM4_192PIO   (1 << 28)
 
#define R128_PM4_192BM   (2 << 28)
 
#define R128_PM4_128PIO_64INDBM   (3 << 28)
 
#define R128_PM4_128BM_64INDBM   (4 << 28)
 
#define R128_PM4_64PIO_128INDBM   (5 << 28)
 
#define R128_PM4_64BM_128INDBM   (6 << 28)
 
#define R128_PM4_64PIO_64VCBM_64INDBM   (7 << 28)
 
#define R128_PM4_64BM_64VCBM_64INDBM   (8 << 28)
 
#define R128_PM4_64PIO_64VCPIO_64INDPIO   (15 << 28)
 
#define R128_PM4_BUFFER_CNTL_NOUPDATE   (1 << 27)
 
#define R128_PM4_BUFFER_WM_CNTL   0x0708
 
#define R128_WMA_SHIFT   0
 
#define R128_WMB_SHIFT   8
 
#define R128_WMC_SHIFT   16
 
#define R128_WB_WM_SHIFT   24
 
#define R128_PM4_BUFFER_DL_RPTR_ADDR   0x070c
 
#define R128_PM4_BUFFER_DL_RPTR   0x0710
 
#define R128_PM4_BUFFER_DL_WPTR   0x0714
 
#define R128_PM4_BUFFER_DL_DONE   (1 << 31)
 
#define R128_PM4_VC_FPU_SETUP   0x071c
 
#define R128_PM4_IW_INDOFF   0x0738
 
#define R128_PM4_IW_INDSIZE   0x073c
 
#define R128_PM4_STAT   0x07b8
 
#define R128_PM4_FIFOCNT_MASK   0x0fff
 
#define R128_PM4_BUSY   (1 << 16)
 
#define R128_PM4_GUI_ACTIVE   (1 << 31)
 
#define R128_PM4_MICROCODE_ADDR   0x07d4
 
#define R128_PM4_MICROCODE_RADDR   0x07d8
 
#define R128_PM4_MICROCODE_DATAH   0x07dc
 
#define R128_PM4_MICROCODE_DATAL   0x07e0
 
#define R128_PM4_BUFFER_ADDR   0x07f0
 
#define R128_PM4_MICRO_CNTL   0x07fc
 
#define R128_PM4_MICRO_FREERUN   (1 << 30)
 
#define R128_PM4_FIFO_DATA_EVEN   0x1000
 
#define R128_PM4_FIFO_DATA_ODD   0x1004
 
#define R128_CCE_PACKET0   0x00000000
 
#define R128_CCE_PACKET1   0x40000000
 
#define R128_CCE_PACKET2   0x80000000
 
#define R128_CCE_PACKET3   0xC0000000
 
#define R128_CNTL_HOSTDATA_BLT   0x00009400
 
#define R128_CNTL_PAINT_MULTI   0x00009A00
 
#define R128_CNTL_BITBLT_MULTI   0x00009B00
 
#define R128_3D_RNDR_GEN_INDX_PRIM   0x00002300
 
#define R128_CCE_PACKET_MASK   0xC0000000
 
#define R128_CCE_PACKET_COUNT_MASK   0x3fff0000
 
#define R128_CCE_PACKET0_REG_MASK   0x000007ff
 
#define R128_CCE_PACKET1_REG0_MASK   0x000007ff
 
#define R128_CCE_PACKET1_REG1_MASK   0x003ff800
 
#define R128_CCE_VC_CNTL_PRIM_TYPE_NONE   0x00000000
 
#define R128_CCE_VC_CNTL_PRIM_TYPE_POINT   0x00000001
 
#define R128_CCE_VC_CNTL_PRIM_TYPE_LINE   0x00000002
 
#define R128_CCE_VC_CNTL_PRIM_TYPE_POLY_LINE   0x00000003
 
#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_LIST   0x00000004
 
#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_FAN   0x00000005
 
#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_STRIP   0x00000006
 
#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_TYPE2   0x00000007
 
#define R128_CCE_VC_CNTL_PRIM_WALK_IND   0x00000010
 
#define R128_CCE_VC_CNTL_PRIM_WALK_LIST   0x00000020
 
#define R128_CCE_VC_CNTL_PRIM_WALK_RING   0x00000030
 
#define R128_CCE_VC_CNTL_NUM_SHIFT   16
 
#define R128_DATATYPE_VQ   0
 
#define R128_DATATYPE_CI4   1
 
#define R128_DATATYPE_CI8   2
 
#define R128_DATATYPE_ARGB1555   3
 
#define R128_DATATYPE_RGB565   4
 
#define R128_DATATYPE_RGB888   5
 
#define R128_DATATYPE_ARGB8888   6
 
#define R128_DATATYPE_RGB332   7
 
#define R128_DATATYPE_Y8   8
 
#define R128_DATATYPE_RGB8   9
 
#define R128_DATATYPE_CI16   10
 
#define R128_DATATYPE_YVYU422   11
 
#define R128_DATATYPE_VYUY422   12
 
#define R128_DATATYPE_AYUV444   14
 
#define R128_DATATYPE_ARGB4444   15
 
#define R128_AGP_OFFSET   0x02000000
 
#define R128_WATERMARK_L   16
 
#define R128_WATERMARK_M   8
 
#define R128_WATERMARK_N   8
 
#define R128_WATERMARK_K   128
 
#define R128_MAX_USEC_TIMEOUT   100000 /* 100 ms */
 
#define R128_LAST_FRAME_REG   R128_GUI_SCRATCH_REG0
 
#define R128_LAST_DISPATCH_REG   R128_GUI_SCRATCH_REG1
 
#define R128_MAX_VB_AGE   0x7fffffff
 
#define R128_MAX_VB_VERTS   (0xffff)
 
#define R128_RING_HIGH_MARK   128
 
#define R128_PERFORMANCE_BOXES   0
 
#define R128_PCIGART_TABLE_SIZE   32768
 
#define R128_READ(reg)   DRM_READ32(dev_priv->mmio, (reg))
 
#define R128_WRITE(reg, val)   DRM_WRITE32(dev_priv->mmio, (reg), (val))
 
#define R128_READ8(reg)   DRM_READ8(dev_priv->mmio, (reg))
 
#define R128_WRITE8(reg, val)   DRM_WRITE8(dev_priv->mmio, (reg), (val))
 
#define R128_WRITE_PLL(addr, val)
 
#define CCE_PACKET0(reg, n)
 
#define CCE_PACKET1(reg0, reg1)
 
#define CCE_PACKET2()   (R128_CCE_PACKET2)
 
#define CCE_PACKET3(pkt, n)
 
#define DEV_INIT_TEST_WITH_RETURN(_dev_priv)
 
#define RING_SPACE_TEST_WITH_RETURN(dev_priv)
 
#define VB_AGE_TEST_WITH_RETURN(dev_priv)
 
#define R128_WAIT_UNTIL_PAGE_FLIPPED()
 
#define R128_VERBOSE   0
 
#define RING_LOCALS   int write, _nr; unsigned int tail_mask; volatile u32 *ring;
 
#define BEGIN_RING(n)
 
#define R128_BROKEN_CCE   1
 
#define ADVANCE_RING()
 
#define COMMIT_RING()
 
#define OUT_RING(x)
 

Typedefs

typedef struct drm_r128_freelist drm_r128_freelist_t
 
typedef struct drm_r128_ring_buffer drm_r128_ring_buffer_t
 
typedef struct drm_r128_private drm_r128_private_t
 
typedef struct drm_r128_buf_priv drm_r128_buf_priv_t
 

Functions

int r128_cce_init (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int r128_cce_start (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int r128_cce_stop (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int r128_cce_reset (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int r128_cce_idle (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int r128_engine_reset (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int r128_fullscreen (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int r128_cce_buffers (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
void r128_freelist_reset (struct drm_device *dev)
 
int r128_wait_ring (drm_r128_private_t *dev_priv, int n)
 
int r128_do_cce_idle (drm_r128_private_t *dev_priv)
 
int r128_do_cleanup_cce (struct drm_device *dev)
 
int r128_enable_vblank (struct drm_device *dev, int crtc)
 
void r128_disable_vblank (struct drm_device *dev, int crtc)
 
u32 r128_get_vblank_counter (struct drm_device *dev, int crtc)
 
irqreturn_t r128_driver_irq_handler (DRM_IRQ_ARGS)
 
void r128_driver_irq_preinstall (struct drm_device *dev)
 
int r128_driver_irq_postinstall (struct drm_device *dev)
 
void r128_driver_irq_uninstall (struct drm_device *dev)
 
void r128_driver_lastclose (struct drm_device *dev)
 
int r128_driver_load (struct drm_device *dev, unsigned long flags)
 
void r128_driver_preclose (struct drm_device *dev, struct drm_file *file_priv)
 
long r128_compat_ioctl (struct file *filp, unsigned int cmd, unsigned long arg)
 

Variables

struct drm_ioctl_desc r128_ioctls []
 
int r128_max_ioctl
 

Macro Definition Documentation

#define ADVANCE_RING ( )
Value:
do { \
if (R128_VERBOSE) \
DRM_INFO("ADVANCE_RING() wr=0x%06x tail=0x%06x\n", \
write, dev_priv->ring.tail); \
if (R128_BROKEN_CCE && write < 32) \
memcpy(dev_priv->ring.end, \
dev_priv->ring.start, \
write * sizeof(u32)); \
if (((dev_priv->ring.tail + _nr) & tail_mask) != write) \
DRM_ERROR( \
"ADVANCE_RING(): mismatch: nr: %x write: %x line: %d\n", \
((dev_priv->ring.tail + _nr) & tail_mask), \
write, __LINE__); \
else \
dev_priv->ring.tail = write; \
} while (0)

Definition at line 496 of file r128_drv.h.

#define BEGIN_RING (   n)
Value:
do { \
if (R128_VERBOSE) \
DRM_INFO("BEGIN_RING(%d)\n", (n)); \
if (dev_priv->ring.space <= (n) * sizeof(u32)) { \
COMMIT_RING(); \
r128_wait_ring(dev_priv, (n) * sizeof(u32)); \
} \
_nr = n; dev_priv->ring.space -= (n) * sizeof(u32); \
ring = dev_priv->ring.start; \
write = dev_priv->ring.tail; \
tail_mask = dev_priv->ring.tail_mask; \
} while (0)

Definition at line 476 of file r128_drv.h.

#define CCE_PACKET0 (   reg,
  n 
)
Value:
((n) << 16) | ((reg) >> 2))

Definition at line 405 of file r128_drv.h.

#define CCE_PACKET1 (   reg0,
  reg1 
)
Value:
(((reg1) >> 2) << 11) | ((reg0) >> 2))

Definition at line 407 of file r128_drv.h.

#define CCE_PACKET2 ( )    (R128_CCE_PACKET2)

Definition at line 409 of file r128_drv.h.

#define CCE_PACKET3 (   pkt,
  n 
)
Value:
(pkt) | ((n) << 16))

Definition at line 410 of file r128_drv.h.

#define COMMIT_RING ( )
Value:
do { \
if (R128_VERBOSE) \
DRM_INFO("COMMIT_RING() tail=0x%06x\n", \
dev_priv->ring.tail); \
DRM_MEMORYBARRIER(); \
R128_WRITE(R128_PM4_BUFFER_DL_WPTR, dev_priv->ring.tail); \
} while (0)

Definition at line 513 of file r128_drv.h.

#define DEV_INIT_TEST_WITH_RETURN (   _dev_priv)
Value:
do { \
if (!_dev_priv) { \
DRM_ERROR("called with no initialization\n"); \
return -EINVAL; \
} \
} while (0)

Definition at line 425 of file r128_drv.h.

#define DRIVER_AUTHOR   "Gareth Hughes, VA Linux Systems Inc."

Definition at line 40 of file r128_drv.h.

#define DRIVER_DATE   "20030725"

Definition at line 44 of file r128_drv.h.

#define DRIVER_DESC   "ATI Rage 128"

Definition at line 43 of file r128_drv.h.

#define DRIVER_MAJOR   2

Definition at line 52 of file r128_drv.h.

#define DRIVER_MINOR   5

Definition at line 53 of file r128_drv.h.

#define DRIVER_NAME   "r128"

Definition at line 42 of file r128_drv.h.

#define DRIVER_PATCHLEVEL   0

Definition at line 54 of file r128_drv.h.

#define GET_RING_HEAD (   dev_priv)    R128_READ(R128_PM4_BUFFER_DL_RPTR)

Definition at line 56 of file r128_drv.h.

#define OUT_RING (   x)
Value:
do { \
if (R128_VERBOSE) \
DRM_INFO(" OUT_RING( 0x%08x ) at 0x%x\n", \
(unsigned int)(x), write); \
write &= tail_mask; \
} while (0)

Definition at line 522 of file r128_drv.h.

#define R128_3D_RNDR_GEN_INDX_PRIM   0x00002300

Definition at line 335 of file r128_drv.h.

#define R128_AGP_OFFSET   0x02000000

Definition at line 373 of file r128_drv.h.

#define R128_AUX1_SC_BOTTOM   0x1670

Definition at line 186 of file r128_drv.h.

#define R128_AUX1_SC_EN   (1 << 0)

Definition at line 174 of file r128_drv.h.

#define R128_AUX1_SC_LEFT   0x1664

Definition at line 183 of file r128_drv.h.

#define R128_AUX1_SC_MODE_NAND   (1 << 1)

Definition at line 176 of file r128_drv.h.

#define R128_AUX1_SC_MODE_OR   (0 << 1)

Definition at line 175 of file r128_drv.h.

#define R128_AUX1_SC_RIGHT   0x1668

Definition at line 184 of file r128_drv.h.

#define R128_AUX1_SC_TOP   0x166c

Definition at line 185 of file r128_drv.h.

#define R128_AUX2_SC_BOTTOM   0x1680

Definition at line 190 of file r128_drv.h.

#define R128_AUX2_SC_EN   (1 << 2)

Definition at line 177 of file r128_drv.h.

#define R128_AUX2_SC_LEFT   0x1674

Definition at line 187 of file r128_drv.h.

#define R128_AUX2_SC_MODE_NAND   (1 << 3)

Definition at line 179 of file r128_drv.h.

#define R128_AUX2_SC_MODE_OR   (0 << 3)

Definition at line 178 of file r128_drv.h.

#define R128_AUX2_SC_RIGHT   0x1678

Definition at line 188 of file r128_drv.h.

#define R128_AUX2_SC_TOP   0x167c

Definition at line 189 of file r128_drv.h.

#define R128_AUX3_SC_BOTTOM   0x1690

Definition at line 194 of file r128_drv.h.

#define R128_AUX3_SC_EN   (1 << 4)

Definition at line 180 of file r128_drv.h.

#define R128_AUX3_SC_LEFT   0x1684

Definition at line 191 of file r128_drv.h.

#define R128_AUX3_SC_MODE_NAND   (1 << 5)

Definition at line 182 of file r128_drv.h.

#define R128_AUX3_SC_MODE_OR   (0 << 5)

Definition at line 181 of file r128_drv.h.

#define R128_AUX3_SC_RIGHT   0x1688

Definition at line 192 of file r128_drv.h.

#define R128_AUX3_SC_TOP   0x168c

Definition at line 193 of file r128_drv.h.

#define R128_AUX_SC_CNTL   0x1660

Definition at line 173 of file r128_drv.h.

#define R128_BROKEN_CCE   1

Definition at line 494 of file r128_drv.h.

#define R128_BRUSH_DATA0   0x1480

Definition at line 196 of file r128_drv.h.

#define R128_BUS_CNTL   0x0030

Definition at line 197 of file r128_drv.h.

#define R128_BUS_MASTER_DIS   (1 << 6)

Definition at line 198 of file r128_drv.h.

#define R128_CCE_PACKET0   0x00000000

Definition at line 328 of file r128_drv.h.

#define R128_CCE_PACKET0_REG_MASK   0x000007ff

Definition at line 339 of file r128_drv.h.

#define R128_CCE_PACKET1   0x40000000

Definition at line 329 of file r128_drv.h.

#define R128_CCE_PACKET1_REG0_MASK   0x000007ff

Definition at line 340 of file r128_drv.h.

#define R128_CCE_PACKET1_REG1_MASK   0x003ff800

Definition at line 341 of file r128_drv.h.

#define R128_CCE_PACKET2   0x80000000

Definition at line 330 of file r128_drv.h.

#define R128_CCE_PACKET3   0xC0000000

Definition at line 331 of file r128_drv.h.

#define R128_CCE_PACKET_COUNT_MASK   0x3fff0000

Definition at line 338 of file r128_drv.h.

#define R128_CCE_PACKET_MASK   0xC0000000

Definition at line 337 of file r128_drv.h.

#define R128_CCE_VC_CNTL_NUM_SHIFT   16

Definition at line 354 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_TYPE_LINE   0x00000002

Definition at line 345 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_TYPE_NONE   0x00000000

Definition at line 343 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_TYPE_POINT   0x00000001

Definition at line 344 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_TYPE_POLY_LINE   0x00000003

Definition at line 346 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_FAN   0x00000005

Definition at line 348 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_LIST   0x00000004

Definition at line 347 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_STRIP   0x00000006

Definition at line 349 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_TYPE_TRI_TYPE2   0x00000007

Definition at line 350 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_WALK_IND   0x00000010

Definition at line 351 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_WALK_LIST   0x00000020

Definition at line 352 of file r128_drv.h.

#define R128_CCE_VC_CNTL_PRIM_WALK_RING   0x00000030

Definition at line 353 of file r128_drv.h.

#define R128_CLOCK_CNTL_DATA   0x000c

Definition at line 201 of file r128_drv.h.

#define R128_CLOCK_CNTL_INDEX   0x0008

Definition at line 200 of file r128_drv.h.

#define R128_CNTL_BITBLT_MULTI   0x00009B00

Definition at line 334 of file r128_drv.h.

#define R128_CNTL_HOSTDATA_BLT   0x00009400

Definition at line 332 of file r128_drv.h.

#define R128_CNTL_PAINT_MULTI   0x00009A00

Definition at line 333 of file r128_drv.h.

#define R128_CONSTANT_COLOR_C   0x1d34

Definition at line 203 of file r128_drv.h.

#define R128_CRTC_OFFSET   0x0224

Definition at line 204 of file r128_drv.h.

#define R128_CRTC_OFFSET_CNTL   0x0228

Definition at line 205 of file r128_drv.h.

#define R128_CRTC_OFFSET_FLIP_CNTL   (1 << 16)

Definition at line 206 of file r128_drv.h.

#define R128_CRTC_VBLANK_INT   (1 << 0)

Definition at line 232 of file r128_drv.h.

#define R128_CRTC_VBLANK_INT_AK   (1 << 0)

Definition at line 233 of file r128_drv.h.

#define R128_CRTC_VBLANK_INT_EN   (1 << 0)

Definition at line 230 of file r128_drv.h.

#define R128_DATATYPE_ARGB1555   3

Definition at line 359 of file r128_drv.h.

#define R128_DATATYPE_ARGB4444   15

Definition at line 370 of file r128_drv.h.

#define R128_DATATYPE_ARGB8888   6

Definition at line 362 of file r128_drv.h.

#define R128_DATATYPE_AYUV444   14

Definition at line 369 of file r128_drv.h.

#define R128_DATATYPE_CI16   10

Definition at line 366 of file r128_drv.h.

#define R128_DATATYPE_CI4   1

Definition at line 357 of file r128_drv.h.

#define R128_DATATYPE_CI8   2

Definition at line 358 of file r128_drv.h.

#define R128_DATATYPE_RGB332   7

Definition at line 363 of file r128_drv.h.

#define R128_DATATYPE_RGB565   4

Definition at line 360 of file r128_drv.h.

#define R128_DATATYPE_RGB8   9

Definition at line 365 of file r128_drv.h.

#define R128_DATATYPE_RGB888   5

Definition at line 361 of file r128_drv.h.

#define R128_DATATYPE_VQ   0

Definition at line 356 of file r128_drv.h.

#define R128_DATATYPE_VYUY422   12

Definition at line 368 of file r128_drv.h.

#define R128_DATATYPE_Y8   8

Definition at line 364 of file r128_drv.h.

#define R128_DATATYPE_YVYU422   11

Definition at line 367 of file r128_drv.h.

#define R128_DP_GUI_MASTER_CNTL   0x146c

Definition at line 208 of file r128_drv.h.

#define R128_DP_SRC_SOURCE_HOST_DATA   (3 << 24)

Definition at line 219 of file r128_drv.h.

#define R128_DP_SRC_SOURCE_MEMORY   (2 << 24)

Definition at line 218 of file r128_drv.h.

#define R128_DP_WRITE_MASK   0x16cc

Definition at line 225 of file r128_drv.h.

#define R128_DST_PITCH_OFFSET_C   0x1c80

Definition at line 226 of file r128_drv.h.

#define R128_DST_TILE   (1 << 31)

Definition at line 227 of file r128_drv.h.

#define R128_EVENT_CRTC_OFFSET   (1 << 0)

Definition at line 273 of file r128_drv.h.

#define R128_FORCE_GCP   (1 << 16)

Definition at line 249 of file r128_drv.h.

#define R128_FORCE_PIPE3D_CP   (1 << 17)

Definition at line 250 of file r128_drv.h.

#define R128_FORCE_RCP   (1 << 18)

Definition at line 251 of file r128_drv.h.

#define R128_GEN_INT_CNTL   0x0040

Definition at line 229 of file r128_drv.h.

#define R128_GEN_INT_STATUS   0x0044

Definition at line 231 of file r128_drv.h.

#define R128_GEN_RESET_CNTL   0x00f0

Definition at line 234 of file r128_drv.h.

#define R128_GMC_AUX_CLIP_DIS   (1 << 29)

Definition at line 221 of file r128_drv.h.

#define R128_GMC_BRUSH_NONE   (15 << 4)

Definition at line 212 of file r128_drv.h.

#define R128_GMC_BRUSH_SOLID_COLOR   (13 << 4)

Definition at line 211 of file r128_drv.h.

#define R128_GMC_CLR_CMP_CNTL_DIS   (1 << 28)

Definition at line 220 of file r128_drv.h.

#define R128_GMC_DST_16BPP   (4 << 8)

Definition at line 213 of file r128_drv.h.

#define R128_GMC_DST_24BPP   (5 << 8)

Definition at line 214 of file r128_drv.h.

#define R128_GMC_DST_32BPP   (6 << 8)

Definition at line 215 of file r128_drv.h.

#define R128_GMC_DST_DATATYPE_SHIFT   8

Definition at line 216 of file r128_drv.h.

#define R128_GMC_DST_PITCH_OFFSET_CNTL   (1 << 1)

Definition at line 210 of file r128_drv.h.

#define R128_GMC_SRC_DATATYPE_COLOR   (3 << 12)

Definition at line 217 of file r128_drv.h.

#define R128_GMC_SRC_PITCH_OFFSET_CNTL   (1 << 0)

Definition at line 209 of file r128_drv.h.

#define R128_GMC_WR_MSK_DIS   (1 << 30)

Definition at line 222 of file r128_drv.h.

#define R128_GUI_ACTIVE   (1 << 31)

Definition at line 246 of file r128_drv.h.

#define R128_GUI_FIFOCNT_MASK   0x0fff

Definition at line 245 of file r128_drv.h.

#define R128_GUI_SCRATCH_REG0   0x15e0

Definition at line 237 of file r128_drv.h.

#define R128_GUI_SCRATCH_REG1   0x15e4

Definition at line 238 of file r128_drv.h.

#define R128_GUI_SCRATCH_REG2   0x15e8

Definition at line 239 of file r128_drv.h.

#define R128_GUI_SCRATCH_REG3   0x15ec

Definition at line 240 of file r128_drv.h.

#define R128_GUI_SCRATCH_REG4   0x15f0

Definition at line 241 of file r128_drv.h.

#define R128_GUI_SCRATCH_REG5   0x15f4

Definition at line 242 of file r128_drv.h.

#define R128_GUI_STAT   0x1740

Definition at line 244 of file r128_drv.h.

#define R128_LAST_DISPATCH_REG   R128_GUI_SCRATCH_REG1

Definition at line 383 of file r128_drv.h.

#define R128_LAST_FRAME_REG   R128_GUI_SCRATCH_REG0

Definition at line 382 of file r128_drv.h.

#define R128_MAX_USEC_TIMEOUT   100000 /* 100 ms */

Definition at line 380 of file r128_drv.h.

#define R128_MAX_VB_AGE   0x7fffffff

Definition at line 384 of file r128_drv.h.

#define R128_MAX_VB_VERTS   (0xffff)

Definition at line 385 of file r128_drv.h.

#define R128_MCLK_CNTL   0x000f

Definition at line 248 of file r128_drv.h.

#define R128_PC_BUSY   (1 << 31)

Definition at line 258 of file r128_drv.h.

#define R128_PC_FLUSH_ALL   0x00ff

Definition at line 257 of file r128_drv.h.

#define R128_PC_FLUSH_GUI   (3 << 0)

Definition at line 255 of file r128_drv.h.

#define R128_PC_GUI_CTLSTAT   0x1748

Definition at line 253 of file r128_drv.h.

#define R128_PC_NGUI_CTLSTAT   0x0184

Definition at line 254 of file r128_drv.h.

#define R128_PC_RI_GUI   (1 << 2)

Definition at line 256 of file r128_drv.h.

#define R128_PCI_GART_PAGE   0x017c

Definition at line 260 of file r128_drv.h.

#define R128_PCIGART_TABLE_SIZE   32768

Definition at line 391 of file r128_drv.h.

#define R128_PERFORMANCE_BOXES   0

Definition at line 389 of file r128_drv.h.

#define R128_PLL_WR_EN   (1 << 7)

Definition at line 202 of file r128_drv.h.

#define R128_PM4_128BM_64INDBM   (4 << 28)

Definition at line 285 of file r128_drv.h.

#define R128_PM4_128PIO_64INDBM   (3 << 28)

Definition at line 284 of file r128_drv.h.

#define R128_PM4_192BM   (2 << 28)

Definition at line 283 of file r128_drv.h.

#define R128_PM4_192PIO   (1 << 28)

Definition at line 282 of file r128_drv.h.

#define R128_PM4_64BM_128INDBM   (6 << 28)

Definition at line 287 of file r128_drv.h.

#define R128_PM4_64BM_64VCBM_64INDBM   (8 << 28)

Definition at line 289 of file r128_drv.h.

#define R128_PM4_64PIO_128INDBM   (5 << 28)

Definition at line 286 of file r128_drv.h.

#define R128_PM4_64PIO_64VCBM_64INDBM   (7 << 28)

Definition at line 288 of file r128_drv.h.

#define R128_PM4_64PIO_64VCPIO_64INDPIO   (15 << 28)

Definition at line 290 of file r128_drv.h.

#define R128_PM4_BUFFER_ADDR   0x07f0

Definition at line 319 of file r128_drv.h.

#define R128_PM4_BUFFER_CNTL   0x0704

Definition at line 279 of file r128_drv.h.

#define R128_PM4_BUFFER_CNTL_NOUPDATE   (1 << 27)

Definition at line 291 of file r128_drv.h.

#define R128_PM4_BUFFER_DL_DONE   (1 << 31)

Definition at line 302 of file r128_drv.h.

#define R128_PM4_BUFFER_DL_RPTR   0x0710

Definition at line 300 of file r128_drv.h.

#define R128_PM4_BUFFER_DL_RPTR_ADDR   0x070c

Definition at line 299 of file r128_drv.h.

#define R128_PM4_BUFFER_DL_WPTR   0x0714

Definition at line 301 of file r128_drv.h.

#define R128_PM4_BUFFER_OFFSET   0x0700

Definition at line 278 of file r128_drv.h.

#define R128_PM4_BUFFER_WM_CNTL   0x0708

Definition at line 293 of file r128_drv.h.

#define R128_PM4_BUSY   (1 << 16)

Definition at line 311 of file r128_drv.h.

#define R128_PM4_FIFO_DATA_EVEN   0x1000

Definition at line 323 of file r128_drv.h.

#define R128_PM4_FIFO_DATA_ODD   0x1004

Definition at line 324 of file r128_drv.h.

#define R128_PM4_FIFOCNT_MASK   0x0fff

Definition at line 310 of file r128_drv.h.

#define R128_PM4_GUI_ACTIVE   (1 << 31)

Definition at line 312 of file r128_drv.h.

#define R128_PM4_IW_INDOFF   0x0738

Definition at line 306 of file r128_drv.h.

#define R128_PM4_IW_INDSIZE   0x073c

Definition at line 307 of file r128_drv.h.

#define R128_PM4_MASK   (15 << 28)

Definition at line 280 of file r128_drv.h.

#define R128_PM4_MICRO_CNTL   0x07fc

Definition at line 320 of file r128_drv.h.

#define R128_PM4_MICRO_FREERUN   (1 << 30)

Definition at line 321 of file r128_drv.h.

#define R128_PM4_MICROCODE_ADDR   0x07d4

Definition at line 314 of file r128_drv.h.

#define R128_PM4_MICROCODE_DATAH   0x07dc

Definition at line 316 of file r128_drv.h.

#define R128_PM4_MICROCODE_DATAL   0x07e0

Definition at line 317 of file r128_drv.h.

#define R128_PM4_MICROCODE_RADDR   0x07d8

Definition at line 315 of file r128_drv.h.

#define R128_PM4_NONPM4   (0 << 28)

Definition at line 281 of file r128_drv.h.

#define R128_PM4_STAT   0x07b8

Definition at line 309 of file r128_drv.h.

#define R128_PM4_VC_FPU_SETUP   0x071c

Definition at line 304 of file r128_drv.h.

#define R128_PRIM_TEX_CNTL_C   0x1cb0

Definition at line 261 of file r128_drv.h.

#define R128_READ (   reg)    DRM_READ32(dev_priv->mmio, (reg))

Definition at line 393 of file r128_drv.h.

#define R128_READ8 (   reg)    DRM_READ8(dev_priv->mmio, (reg))

Definition at line 395 of file r128_drv.h.

#define R128_RING_HIGH_MARK   128

Definition at line 387 of file r128_drv.h.

#define R128_ROP3_P   0x00f00000

Definition at line 224 of file r128_drv.h.

#define R128_ROP3_S   0x00cc0000

Definition at line 223 of file r128_drv.h.

#define R128_SCALE_3D_CNTL   0x1a00

Definition at line 263 of file r128_drv.h.

#define R128_SEC_TEX_CNTL_C   0x1d00

Definition at line 264 of file r128_drv.h.

#define R128_SEC_TEXTURE_BORDER_COLOR_C   0x1d3c

Definition at line 265 of file r128_drv.h.

#define R128_SETUP_CNTL   0x1bc4

Definition at line 266 of file r128_drv.h.

#define R128_SOFT_RESET_GUI   (1 << 0)

Definition at line 235 of file r128_drv.h.

#define R128_STEN_REF_MASK_C   0x1d40

Definition at line 267 of file r128_drv.h.

#define R128_TEX_CACHE_FLUSH   (1 << 23)

Definition at line 270 of file r128_drv.h.

#define R128_TEX_CNTL_C   0x1c9c

Definition at line 269 of file r128_drv.h.

#define R128_VERBOSE   0

Definition at line 471 of file r128_drv.h.

#define R128_WAIT_UNTIL   0x1720

Definition at line 272 of file r128_drv.h.

#define R128_WAIT_UNTIL_PAGE_FLIPPED ( )
Value:
do { \
OUT_RING(CCE_PACKET0(R128_WAIT_UNTIL, 0)); \
} while (0)

Definition at line 462 of file r128_drv.h.

#define R128_WATERMARK_K   128

Definition at line 378 of file r128_drv.h.

#define R128_WATERMARK_L   16

Definition at line 375 of file r128_drv.h.

#define R128_WATERMARK_M   8

Definition at line 376 of file r128_drv.h.

#define R128_WATERMARK_N   8

Definition at line 377 of file r128_drv.h.

#define R128_WB_WM_SHIFT   24

Definition at line 297 of file r128_drv.h.

#define R128_WINDOW_XY_OFFSET   0x1bcc

Definition at line 274 of file r128_drv.h.

#define R128_WMA_SHIFT   0

Definition at line 294 of file r128_drv.h.

#define R128_WMB_SHIFT   8

Definition at line 295 of file r128_drv.h.

#define R128_WMC_SHIFT   16

Definition at line 296 of file r128_drv.h.

#define R128_WRITE (   reg,
  val 
)    DRM_WRITE32(dev_priv->mmio, (reg), (val))

Definition at line 394 of file r128_drv.h.

#define R128_WRITE8 (   reg,
  val 
)    DRM_WRITE8(dev_priv->mmio, (reg), (val))

Definition at line 396 of file r128_drv.h.

#define R128_WRITE_PLL (   addr,
  val 
)
Value:
do { \
R128_WRITE8(R128_CLOCK_CNTL_INDEX, \
((addr) & 0x1f) | R128_PLL_WR_EN); \
R128_WRITE(R128_CLOCK_CNTL_DATA, (val)); \
} while (0)

Definition at line 398 of file r128_drv.h.

#define RING_LOCALS   int write, _nr; unsigned int tail_mask; volatile u32 *ring;

Definition at line 473 of file r128_drv.h.

#define RING_SPACE_TEST_WITH_RETURN (   dev_priv)
Value:
do { \
if (ring->space < ring->high_mark) { \
for (i = 0 ; i < dev_priv->usec_timeout ; i++) { \
r128_update_ring_snapshot(dev_priv); \
if (ring->space >= ring->high_mark) \
goto __ring_space_done; \
DRM_UDELAY(1); \
} \
DRM_ERROR("ring space check failed!\n"); \
return -EBUSY; \
} \
__ring_space_done: \
; \
} while (0)

Definition at line 433 of file r128_drv.h.

#define VB_AGE_TEST_WITH_RETURN (   dev_priv)
Value:
do { \
drm_r128_sarea_t *sarea_priv = dev_priv->sarea_priv; \
if (sarea_priv->last_dispatch >= R128_MAX_VB_AGE) { \
int __ret = r128_do_cce_idle(dev_priv); \
if (__ret) \
return __ret; \
sarea_priv->last_dispatch = 0; \
r128_freelist_reset(dev); \
} \
} while (0)

Definition at line 450 of file r128_drv.h.

Typedef Documentation

Function Documentation

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

Definition at line 907 of file r128_cce.c.

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

Definition at line 727 of file r128_cce.c.

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

Definition at line 630 of file r128_cce.c.

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

Definition at line 710 of file r128_cce.c.

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

Definition at line 648 of file r128_cce.c.

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

Definition at line 670 of file r128_cce.c.

long r128_compat_ioctl ( struct file filp,
unsigned int  cmd,
unsigned long  arg 
)

Called whenever a 32-bit process running under a 64-bit kernel performs an ioctl on /dev/dri/card<n>.

Parameters
filpfile pointer.
cmdcommand.
arguser argument.
Returns
zero on success or negative number on failure.

Definition at line 196 of file r128_ioc32.c.

void r128_disable_vblank ( struct drm_device dev,
int  crtc 
)

Definition at line 78 of file r128_irq.c.

int r128_do_cce_idle ( drm_r128_private_t dev_priv)

Definition at line 201 of file r128_cce.c.

int r128_do_cleanup_cce ( struct drm_device dev)

Definition at line 590 of file r128_cce.c.

irqreturn_t r128_driver_irq_handler ( DRM_IRQ_ARGS  )

Definition at line 47 of file r128_irq.c.

int r128_driver_irq_postinstall ( struct drm_device dev)

Definition at line 102 of file r128_irq.c.

void r128_driver_irq_preinstall ( struct drm_device dev)

Definition at line 92 of file r128_irq.c.

void r128_driver_irq_uninstall ( struct drm_device dev)

Definition at line 107 of file r128_irq.c.

void r128_driver_lastclose ( struct drm_device dev)

Definition at line 1641 of file r128_state.c.

int r128_driver_load ( struct drm_device dev,
unsigned long  flags 
)

Definition at line 84 of file r128_drv.c.

void r128_driver_preclose ( struct drm_device dev,
struct drm_file *  file_priv 
)

Definition at line 1633 of file r128_state.c.

int r128_enable_vblank ( struct drm_device dev,
int  crtc 
)

Definition at line 65 of file r128_irq.c.

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

Definition at line 742 of file r128_cce.c.

void r128_freelist_reset ( struct drm_device dev)

Definition at line 848 of file r128_cce.c.

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

Definition at line 753 of file r128_cce.c.

u32 r128_get_vblank_counter ( struct drm_device dev,
int  crtc 
)

Definition at line 37 of file r128_irq.c.

int r128_wait_ring ( drm_r128_private_t dev_priv,
int  n 
)

Definition at line 864 of file r128_cce.c.

Variable Documentation

struct drm_ioctl_desc r128_ioctls[]

Definition at line 1646 of file r128_state.c.

int r128_max_ioctl

Definition at line 1666 of file r128_state.c.