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

Go to the source code of this file.

Data Structures

struct  drm_savage_age
 
struct  drm_savage_buf_priv
 
struct  drm_savage_dma_page
 
union  drm_savage_state_t
 
struct  drm_savage_state_t::drm_savage_common_state
 
struct  drm_savage_private
 

Macros

#define DRIVER_AUTHOR   "Felix Kuehling"
 
#define DRIVER_NAME   "savage"
 
#define DRIVER_DESC   "Savage3D/MX/IX, Savage4, SuperSavage, Twister, ProSavage[DDR]"
 
#define DRIVER_DATE   "20050313"
 
#define DRIVER_MAJOR   2
 
#define DRIVER_MINOR   4
 
#define DRIVER_PATCHLEVEL   1
 
#define SAVAGE_DMA_PAGE_SIZE   1024 /* in dwords */
 
#define SAVAGE_FAKE_DMA_SIZE   (SAVAGE_DMA_PAGE_SIZE*4*4)
 
#define S3_SAVAGE3D_SERIES(chip)   ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE_MX))
 
#define S3_SAVAGE4_SERIES(chip)
 
#define S3_SAVAGE_MOBILE_SERIES(chip)   ((chip==S3_SAVAGE_MX) || (chip==S3_SUPERSAVAGE))
 
#define S3_SAVAGE_SERIES(chip)   ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000))
 
#define S3_MOBILE_TWISTER_SERIES(chip)
 
#define SAVAGE_IS_AGP   1
 
#define SAVAGE_FB_SIZE_S3   0x01000000 /* 16MB */
 
#define SAVAGE_FB_SIZE_S4   0x02000000 /* 32MB */
 
#define SAVAGE_MMIO_SIZE   0x00080000 /* 512kB */
 
#define SAVAGE_APERTURE_OFFSET   0x02000000 /* 32MB */
 
#define SAVAGE_APERTURE_SIZE   0x05000000 /* 5 tiled surfaces, 16MB each */
 
#define SAVAGE_BCI_OFFSET
 
#define SAVAGE_BCI_FIFO_SIZE
 
#define SAVAGE_STATUS_WORD0   0x48C00
 
#define SAVAGE_STATUS_WORD1   0x48C04
 
#define SAVAGE_ALT_STATUS_WORD0   0x48C60
 
#define SAVAGE_FIFO_USED_MASK_S3D   0x0001ffff
 
#define SAVAGE_FIFO_USED_MASK_S4   0x001fffff
 
#define SAVAGE_BD_STRIDE_SHIFT   0
 
#define SAVAGE_BD_BPP_SHIFT   16
 
#define SAVAGE_BD_TILE_SHIFT   24
 
#define SAVAGE_BD_BW_DISABLE   (1<<28)
 
#define SAVAGE_BD_TILE_LINEAR   0
 
#define SAVAGE_BD_TILE_16BPP   2
 
#define SAVAGE_BD_TILE_32BPP   3
 
#define SAVAGE_BD_TILE_DEST   1
 
#define SAVAGE_BD_TILE_TEXTURE   2
 
#define SAVAGE_GBD_BCI_ENABLE   8
 
#define SAVAGE_GBD_BCI_ENABLE_TWISTER   0
 
#define SAVAGE_GBD_BIG_ENDIAN   4
 
#define SAVAGE_GBD_LITTLE_ENDIAN   0
 
#define SAVAGE_GBD_64   1
 
#define SAVAGE_BCI_GLB_BD_LOW   0x8168
 
#define SAVAGE_BCI_GLB_BD_HIGH   0x816C
 
#define SAVAGE_DRAWLOCALCTRL_S4   0x1e
 
#define SAVAGE_TEXPALADDR_S4   0x1f
 
#define SAVAGE_TEXCTRL0_S4   0x20
 
#define SAVAGE_TEXCTRL1_S4   0x21
 
#define SAVAGE_TEXADDR0_S4   0x22
 
#define SAVAGE_TEXADDR1_S4   0x23
 
#define SAVAGE_TEXBLEND0_S4   0x24
 
#define SAVAGE_TEXBLEND1_S4   0x25
 
#define SAVAGE_TEXXPRCLR_S4   0x26 /* never used */
 
#define SAVAGE_TEXDESCR_S4   0x27
 
#define SAVAGE_FOGTABLE_S4   0x28
 
#define SAVAGE_FOGCTRL_S4   0x30
 
#define SAVAGE_STENCILCTRL_S4   0x31
 
#define SAVAGE_ZBUFCTRL_S4   0x32
 
#define SAVAGE_ZBUFOFF_S4   0x33
 
#define SAVAGE_DESTCTRL_S4   0x34
 
#define SAVAGE_DRAWCTRL0_S4   0x35
 
#define SAVAGE_DRAWCTRL1_S4   0x36
 
#define SAVAGE_ZWATERMARK_S4   0x37
 
#define SAVAGE_DESTTEXRWWATERMARK_S4   0x38
 
#define SAVAGE_TEXBLENDCOLOR_S4   0x39
 
#define SAVAGE_TEXPALADDR_S3D   0x18
 
#define SAVAGE_TEXXPRCLR_S3D   0x19 /* never used */
 
#define SAVAGE_TEXADDR_S3D   0x1A
 
#define SAVAGE_TEXDESCR_S3D   0x1B
 
#define SAVAGE_TEXCTRL_S3D   0x1C
 
#define SAVAGE_FOGTABLE_S3D   0x20
 
#define SAVAGE_FOGCTRL_S3D   0x30
 
#define SAVAGE_DRAWCTRL_S3D   0x31
 
#define SAVAGE_ZBUFCTRL_S3D   0x32
 
#define SAVAGE_ZBUFOFF_S3D   0x33
 
#define SAVAGE_DESTCTRL_S3D   0x34
 
#define SAVAGE_SCSTART_S3D   0x35
 
#define SAVAGE_SCEND_S3D   0x36
 
#define SAVAGE_ZWATERMARK_S3D   0x37
 
#define SAVAGE_DESTTEXRWWATERMARK_S3D   0x38
 
#define SAVAGE_VERTBUFADDR   0x3e
 
#define SAVAGE_BITPLANEWTMASK   0xd7
 
#define SAVAGE_DMABUFADDR   0x51
 
#define SAVAGE_TEXCTRL_TEXEN_MASK   0x00010000 /* S3D */
 
#define SAVAGE_TEXDESCR_TEX0EN_MASK   0x02000000 /* S4 */
 
#define SAVAGE_TEXDESCR_TEX1EN_MASK   0x04000000 /* S4 */
 
#define SAVAGE_DRAWCTRL_S3D_GLOBAL   0x03f3c00c
 
#define SAVAGE_ZBUFCTRL_S3D_GLOBAL   0x00000027
 
#define SAVAGE_SCISSOR_MASK_S4   0x00fff7ff
 
#define SAVAGE_SCISSOR_MASK_S3D   0x07ff07ff
 
#define BCI_CMD_NOP   0x40000000
 
#define BCI_CMD_RECT   0x48000000
 
#define BCI_CMD_RECT_XP   0x01000000
 
#define BCI_CMD_RECT_YP   0x02000000
 
#define BCI_CMD_SCANLINE   0x50000000
 
#define BCI_CMD_LINE   0x5C000000
 
#define BCI_CMD_LINE_LAST_PIXEL   0x58000000
 
#define BCI_CMD_BYTE_TEXT   0x63000000
 
#define BCI_CMD_NT_BYTE_TEXT   0x67000000
 
#define BCI_CMD_BIT_TEXT   0x6C000000
 
#define BCI_CMD_GET_ROP(cmd)   (((cmd) >> 16) & 0xFF)
 
#define BCI_CMD_SET_ROP(cmd, rop)   ((cmd) |= ((rop & 0xFF) << 16))
 
#define BCI_CMD_SEND_COLOR   0x00008000
 
#define BCI_CMD_CLIP_NONE   0x00000000
 
#define BCI_CMD_CLIP_CURRENT   0x00002000
 
#define BCI_CMD_CLIP_LR   0x00004000
 
#define BCI_CMD_CLIP_NEW   0x00006000
 
#define BCI_CMD_DEST_GBD   0x00000000
 
#define BCI_CMD_DEST_PBD   0x00000800
 
#define BCI_CMD_DEST_PBD_NEW   0x00000C00
 
#define BCI_CMD_DEST_SBD   0x00001000
 
#define BCI_CMD_DEST_SBD_NEW   0x00001400
 
#define BCI_CMD_SRC_TRANSPARENT   0x00000200
 
#define BCI_CMD_SRC_SOLID   0x00000000
 
#define BCI_CMD_SRC_GBD   0x00000020
 
#define BCI_CMD_SRC_COLOR   0x00000040
 
#define BCI_CMD_SRC_MONO   0x00000060
 
#define BCI_CMD_SRC_PBD_COLOR   0x00000080
 
#define BCI_CMD_SRC_PBD_MONO   0x000000A0
 
#define BCI_CMD_SRC_PBD_COLOR_NEW   0x000000C0
 
#define BCI_CMD_SRC_PBD_MONO_NEW   0x000000E0
 
#define BCI_CMD_SRC_SBD_COLOR   0x00000100
 
#define BCI_CMD_SRC_SBD_MONO   0x00000120
 
#define BCI_CMD_SRC_SBD_COLOR_NEW   0x00000140
 
#define BCI_CMD_SRC_SBD_MONO_NEW   0x00000160
 
#define BCI_CMD_PAT_TRANSPARENT   0x00000010
 
#define BCI_CMD_PAT_NONE   0x00000000
 
#define BCI_CMD_PAT_COLOR   0x00000002
 
#define BCI_CMD_PAT_MONO   0x00000003
 
#define BCI_CMD_PAT_PBD_COLOR   0x00000004
 
#define BCI_CMD_PAT_PBD_MONO   0x00000005
 
#define BCI_CMD_PAT_PBD_COLOR_NEW   0x00000006
 
#define BCI_CMD_PAT_PBD_MONO_NEW   0x00000007
 
#define BCI_CMD_PAT_SBD_COLOR   0x00000008
 
#define BCI_CMD_PAT_SBD_MONO   0x00000009
 
#define BCI_CMD_PAT_SBD_COLOR_NEW   0x0000000A
 
#define BCI_CMD_PAT_SBD_MONO_NEW   0x0000000B
 
#define BCI_BD_BW_DISABLE   0x10000000
 
#define BCI_BD_TILE_MASK   0x03000000
 
#define BCI_BD_TILE_NONE   0x00000000
 
#define BCI_BD_TILE_16   0x02000000
 
#define BCI_BD_TILE_32   0x03000000
 
#define BCI_BD_GET_BPP(bd)   (((bd) >> 16) & 0xFF)
 
#define BCI_BD_SET_BPP(bd, bpp)   ((bd) |= (((bpp) & 0xFF) << 16))
 
#define BCI_BD_GET_STRIDE(bd)   ((bd) & 0xFFFF)
 
#define BCI_BD_SET_STRIDE(bd, st)   ((bd) |= ((st) & 0xFFFF))
 
#define BCI_CMD_SET_REGISTER   0x96000000
 
#define BCI_CMD_WAIT   0xC0000000
 
#define BCI_CMD_WAIT_3D   0x00010000
 
#define BCI_CMD_WAIT_2D   0x00020000
 
#define BCI_CMD_UPDATE_EVENT_TAG   0x98000000
 
#define BCI_CMD_DRAW_PRIM   0x80000000
 
#define BCI_CMD_DRAW_INDEXED_PRIM   0x88000000
 
#define BCI_CMD_DRAW_CONT   0x01000000
 
#define BCI_CMD_DRAW_TRILIST   0x00000000
 
#define BCI_CMD_DRAW_TRISTRIP   0x02000000
 
#define BCI_CMD_DRAW_TRIFAN   0x04000000
 
#define BCI_CMD_DRAW_SKIPFLAGS   0x000000ff
 
#define BCI_CMD_DRAW_NO_Z   0x00000001
 
#define BCI_CMD_DRAW_NO_W   0x00000002
 
#define BCI_CMD_DRAW_NO_CD   0x00000004
 
#define BCI_CMD_DRAW_NO_CS   0x00000008
 
#define BCI_CMD_DRAW_NO_U0   0x00000010
 
#define BCI_CMD_DRAW_NO_V0   0x00000020
 
#define BCI_CMD_DRAW_NO_UV0   0x00000030
 
#define BCI_CMD_DRAW_NO_U1   0x00000040
 
#define BCI_CMD_DRAW_NO_V1   0x00000080
 
#define BCI_CMD_DRAW_NO_UV1   0x000000c0
 
#define BCI_CMD_DMA   0xa8000000
 
#define BCI_W_H(w, h)   ((((h) << 16) | (w)) & 0x0FFF0FFF)
 
#define BCI_X_Y(x, y)   ((((y) << 16) | (x)) & 0x0FFF0FFF)
 
#define BCI_X_W(x, y)   ((((w) << 16) | (x)) & 0x0FFF0FFF)
 
#define BCI_CLIP_LR(l, r)   ((((r) << 16) | (l)) & 0x0FFF0FFF)
 
#define BCI_CLIP_TL(t, l)   ((((t) << 16) | (l)) & 0x0FFF0FFF)
 
#define BCI_CLIP_BR(b, r)   ((((b) << 16) | (r)) & 0x0FFF0FFF)
 
#define BCI_LINE_X_Y(x, y)   (((y) << 16) | ((x) & 0xFFFF))
 
#define BCI_LINE_STEPS(diag, axi)   (((axi) << 16) | ((diag) & 0xFFFF))
 
#define BCI_LINE_MISC(maj, ym, xp, yp, err)
 
#define BCI_SET_REGISTERS(first, n)
 
#define DMA_SET_REGISTERS(first, n)
 
#define BCI_DRAW_PRIMITIVE(n, type, skip)
 
#define DMA_DRAW_PRIMITIVE(n, type, skip)
 
#define BCI_DRAW_INDICES_S3D(n, type, i0)
 
#define BCI_DRAW_INDICES_S4(n, type, skip)
 
#define BCI_DMA(n)   BCI_WRITE(BCI_CMD_DMA | (((n) >> 1) - 1))
 
#define SAVAGE_READ(reg)   DRM_READ32( dev_priv->mmio, (reg) )
 
#define SAVAGE_WRITE(reg)   DRM_WRITE32( dev_priv->mmio, (reg) )
 
#define SAVAGE_BCI_DEBUG   1
 
#define BCI_LOCALS   volatile uint32_t *bci_ptr;
 
#define BEGIN_BCI(n)
 
#define BCI_WRITE(val)   *bci_ptr++ = (uint32_t)(val)
 
#define SAVAGE_DMA_DEBUG   1
 
#define DMA_LOCALS   uint32_t *dma_ptr;
 
#define BEGIN_DMA(n)
 
#define DMA_WRITE(val)   *dma_ptr++ = (uint32_t)(val)
 
#define DMA_COPY(src, n)
 
#define DMA_COMMIT()
 
#define DMA_FLUSH()   dev_priv->dma_flush(dev_priv)
 
#define UPDATE_EVENT_COUNTER()
 
#define SET_AGE(age, e, w)
 
#define TEST_AGE(age, e, w)   ( (age)->wrap < (w) || ( (age)->wrap == (w) && (age)->event <= (e) ) )
 

Typedefs

typedef struct drm_savage_age drm_savage_age_t
 
typedef struct drm_savage_buf_priv drm_savage_buf_priv_t
 
typedef struct drm_savage_dma_page drm_savage_dma_page_t
 
typedef struct drm_savage_private drm_savage_private_t
 

Enumerations

enum  savage_family {
  S3_UNKNOWN = 0, S3_SAVAGE3D, S3_SAVAGE_MX, S3_SAVAGE4,
  S3_PROSAVAGE, S3_TWISTER, S3_PROSAVAGEDDR, S3_SUPERSAVAGE,
  S3_SAVAGE2000, S3_LAST
}
 

Functions

int savage_bci_cmdbuf (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
int savage_bci_buffers (struct drm_device *dev, void *data, struct drm_file *file_priv)
 
uint16_t savage_bci_emit_event (drm_savage_private_t *dev_priv, unsigned int flags)
 
void savage_freelist_put (struct drm_device *dev, struct drm_buf *buf)
 
void savage_dma_reset (drm_savage_private_t *dev_priv)
 
void savage_dma_wait (drm_savage_private_t *dev_priv, unsigned int page)
 
uint32_tsavage_dma_alloc (drm_savage_private_t *dev_priv, unsigned int n)
 
int savage_driver_load (struct drm_device *dev, unsigned long chipset)
 
int savage_driver_firstopen (struct drm_device *dev)
 
void savage_driver_lastclose (struct drm_device *dev)
 
int savage_driver_unload (struct drm_device *dev)
 
void savage_reclaim_buffers (struct drm_device *dev, struct drm_file *file_priv)
 
void savage_emit_clip_rect_s3d (drm_savage_private_t *dev_priv, const struct drm_clip_rect *pbox)
 
void savage_emit_clip_rect_s4 (drm_savage_private_t *dev_priv, const struct drm_clip_rect *pbox)
 

Variables

struct drm_ioctl_desc savage_ioctls []
 
int savage_max_ioctl
 

Macro Definition Documentation

#define BCI_BD_BW_DISABLE   0x10000000

Definition at line 399 of file savage_drv.h.

#define BCI_BD_GET_BPP (   bd)    (((bd) >> 16) & 0xFF)

Definition at line 404 of file savage_drv.h.

#define BCI_BD_GET_STRIDE (   bd)    ((bd) & 0xFFFF)

Definition at line 406 of file savage_drv.h.

#define BCI_BD_SET_BPP (   bd,
  bpp 
)    ((bd) |= (((bpp) & 0xFF) << 16))

Definition at line 405 of file savage_drv.h.

#define BCI_BD_SET_STRIDE (   bd,
  st 
)    ((bd) |= ((st) & 0xFFFF))

Definition at line 407 of file savage_drv.h.

#define BCI_BD_TILE_16   0x02000000

Definition at line 402 of file savage_drv.h.

#define BCI_BD_TILE_32   0x03000000

Definition at line 403 of file savage_drv.h.

#define BCI_BD_TILE_MASK   0x03000000

Definition at line 400 of file savage_drv.h.

#define BCI_BD_TILE_NONE   0x00000000

Definition at line 401 of file savage_drv.h.

#define BCI_CLIP_BR (   b,
  r 
)    ((((b) << 16) | (r)) & 0x0FFF0FFF)

Definition at line 442 of file savage_drv.h.

#define BCI_CLIP_LR (   l,
  r 
)    ((((r) << 16) | (l)) & 0x0FFF0FFF)

Definition at line 440 of file savage_drv.h.

#define BCI_CLIP_TL (   t,
  l 
)    ((((t) << 16) | (l)) & 0x0FFF0FFF)

Definition at line 441 of file savage_drv.h.

#define BCI_CMD_BIT_TEXT   0x6C000000

Definition at line 356 of file savage_drv.h.

#define BCI_CMD_BYTE_TEXT   0x63000000

Definition at line 354 of file savage_drv.h.

#define BCI_CMD_CLIP_CURRENT   0x00002000

Definition at line 362 of file savage_drv.h.

#define BCI_CMD_CLIP_LR   0x00004000

Definition at line 363 of file savage_drv.h.

#define BCI_CMD_CLIP_NEW   0x00006000

Definition at line 364 of file savage_drv.h.

#define BCI_CMD_CLIP_NONE   0x00000000

Definition at line 361 of file savage_drv.h.

#define BCI_CMD_DEST_GBD   0x00000000

Definition at line 366 of file savage_drv.h.

#define BCI_CMD_DEST_PBD   0x00000800

Definition at line 367 of file savage_drv.h.

#define BCI_CMD_DEST_PBD_NEW   0x00000C00

Definition at line 368 of file savage_drv.h.

#define BCI_CMD_DEST_SBD   0x00001000

Definition at line 369 of file savage_drv.h.

#define BCI_CMD_DEST_SBD_NEW   0x00001400

Definition at line 370 of file savage_drv.h.

#define BCI_CMD_DMA   0xa8000000

Definition at line 435 of file savage_drv.h.

#define BCI_CMD_DRAW_CONT   0x01000000

Definition at line 419 of file savage_drv.h.

#define BCI_CMD_DRAW_INDEXED_PRIM   0x88000000

Definition at line 418 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_CD   0x00000004

Definition at line 426 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_CS   0x00000008

Definition at line 427 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_U0   0x00000010

Definition at line 428 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_U1   0x00000040

Definition at line 431 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_UV0   0x00000030

Definition at line 430 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_UV1   0x000000c0

Definition at line 433 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_V0   0x00000020

Definition at line 429 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_V1   0x00000080

Definition at line 432 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_W   0x00000002

Definition at line 425 of file savage_drv.h.

#define BCI_CMD_DRAW_NO_Z   0x00000001

Definition at line 424 of file savage_drv.h.

#define BCI_CMD_DRAW_PRIM   0x80000000

Definition at line 417 of file savage_drv.h.

#define BCI_CMD_DRAW_SKIPFLAGS   0x000000ff

Definition at line 423 of file savage_drv.h.

#define BCI_CMD_DRAW_TRIFAN   0x04000000

Definition at line 422 of file savage_drv.h.

#define BCI_CMD_DRAW_TRILIST   0x00000000

Definition at line 420 of file savage_drv.h.

#define BCI_CMD_DRAW_TRISTRIP   0x02000000

Definition at line 421 of file savage_drv.h.

#define BCI_CMD_GET_ROP (   cmd)    (((cmd) >> 16) & 0xFF)

Definition at line 357 of file savage_drv.h.

#define BCI_CMD_LINE   0x5C000000

Definition at line 352 of file savage_drv.h.

#define BCI_CMD_LINE_LAST_PIXEL   0x58000000

Definition at line 353 of file savage_drv.h.

#define BCI_CMD_NOP   0x40000000

Definition at line 347 of file savage_drv.h.

#define BCI_CMD_NT_BYTE_TEXT   0x67000000

Definition at line 355 of file savage_drv.h.

#define BCI_CMD_PAT_COLOR   0x00000002

Definition at line 388 of file savage_drv.h.

#define BCI_CMD_PAT_MONO   0x00000003

Definition at line 389 of file savage_drv.h.

#define BCI_CMD_PAT_NONE   0x00000000

Definition at line 387 of file savage_drv.h.

#define BCI_CMD_PAT_PBD_COLOR   0x00000004

Definition at line 390 of file savage_drv.h.

#define BCI_CMD_PAT_PBD_COLOR_NEW   0x00000006

Definition at line 392 of file savage_drv.h.

#define BCI_CMD_PAT_PBD_MONO   0x00000005

Definition at line 391 of file savage_drv.h.

#define BCI_CMD_PAT_PBD_MONO_NEW   0x00000007

Definition at line 393 of file savage_drv.h.

#define BCI_CMD_PAT_SBD_COLOR   0x00000008

Definition at line 394 of file savage_drv.h.

#define BCI_CMD_PAT_SBD_COLOR_NEW   0x0000000A

Definition at line 396 of file savage_drv.h.

#define BCI_CMD_PAT_SBD_MONO   0x00000009

Definition at line 395 of file savage_drv.h.

#define BCI_CMD_PAT_SBD_MONO_NEW   0x0000000B

Definition at line 397 of file savage_drv.h.

#define BCI_CMD_PAT_TRANSPARENT   0x00000010

Definition at line 386 of file savage_drv.h.

#define BCI_CMD_RECT   0x48000000

Definition at line 348 of file savage_drv.h.

#define BCI_CMD_RECT_XP   0x01000000

Definition at line 349 of file savage_drv.h.

#define BCI_CMD_RECT_YP   0x02000000

Definition at line 350 of file savage_drv.h.

#define BCI_CMD_SCANLINE   0x50000000

Definition at line 351 of file savage_drv.h.

#define BCI_CMD_SEND_COLOR   0x00008000

Definition at line 359 of file savage_drv.h.

#define BCI_CMD_SET_REGISTER   0x96000000

Definition at line 409 of file savage_drv.h.

#define BCI_CMD_SET_ROP (   cmd,
  rop 
)    ((cmd) |= ((rop & 0xFF) << 16))

Definition at line 358 of file savage_drv.h.

#define BCI_CMD_SRC_COLOR   0x00000040

Definition at line 375 of file savage_drv.h.

#define BCI_CMD_SRC_GBD   0x00000020

Definition at line 374 of file savage_drv.h.

#define BCI_CMD_SRC_MONO   0x00000060

Definition at line 376 of file savage_drv.h.

#define BCI_CMD_SRC_PBD_COLOR   0x00000080

Definition at line 377 of file savage_drv.h.

#define BCI_CMD_SRC_PBD_COLOR_NEW   0x000000C0

Definition at line 379 of file savage_drv.h.

#define BCI_CMD_SRC_PBD_MONO   0x000000A0

Definition at line 378 of file savage_drv.h.

#define BCI_CMD_SRC_PBD_MONO_NEW   0x000000E0

Definition at line 380 of file savage_drv.h.

#define BCI_CMD_SRC_SBD_COLOR   0x00000100

Definition at line 381 of file savage_drv.h.

#define BCI_CMD_SRC_SBD_COLOR_NEW   0x00000140

Definition at line 383 of file savage_drv.h.

#define BCI_CMD_SRC_SBD_MONO   0x00000120

Definition at line 382 of file savage_drv.h.

#define BCI_CMD_SRC_SBD_MONO_NEW   0x00000160

Definition at line 384 of file savage_drv.h.

#define BCI_CMD_SRC_SOLID   0x00000000

Definition at line 373 of file savage_drv.h.

#define BCI_CMD_SRC_TRANSPARENT   0x00000200

Definition at line 372 of file savage_drv.h.

#define BCI_CMD_UPDATE_EVENT_TAG   0x98000000

Definition at line 415 of file savage_drv.h.

#define BCI_CMD_WAIT   0xC0000000

Definition at line 411 of file savage_drv.h.

#define BCI_CMD_WAIT_2D   0x00020000

Definition at line 413 of file savage_drv.h.

#define BCI_CMD_WAIT_3D   0x00010000

Definition at line 412 of file savage_drv.h.

#define BCI_DMA (   n)    BCI_WRITE(BCI_CMD_DMA | (((n) >> 1) - 1))

Definition at line 480 of file savage_drv.h.

#define BCI_DRAW_INDICES_S3D (   n,
  type,
  i0 
)
Value:
((n) << 16) | (i0))

Definition at line 472 of file savage_drv.h.

#define BCI_DRAW_INDICES_S4 (   n,
  type,
  skip 
)
Value:

Definition at line 476 of file savage_drv.h.

#define BCI_DRAW_PRIMITIVE (   n,
  type,
  skip 
)
Value:
((n) << 16))

Definition at line 465 of file savage_drv.h.

#define BCI_LINE_MISC (   maj,
  ym,
  xp,
  yp,
  err 
)
Value:
(((maj) & 0x1FFF) | \
((ym) ? 1<<13 : 0) | \
((xp) ? 1<<14 : 0) | \
((yp) ? 1<<15 : 0) | \
((err) << 16))

Definition at line 446 of file savage_drv.h.

#define BCI_LINE_STEPS (   diag,
  axi 
)    (((axi) << 16) | ((diag) & 0xFFFF))

Definition at line 445 of file savage_drv.h.

#define BCI_LINE_X_Y (   x,
  y 
)    (((y) << 16) | ((x) & 0xFFFF))

Definition at line 444 of file savage_drv.h.

#define BCI_LOCALS   volatile uint32_t *bci_ptr;

Definition at line 494 of file savage_drv.h.

#define BCI_SET_REGISTERS (   first,
  n 
)
Value:
((uint32_t)(n) & 0xff) << 16 | \
((uint32_t)(first) & 0xffff))

Definition at line 456 of file savage_drv.h.

#define BCI_W_H (   w,
  h 
)    ((((h) << 16) | (w)) & 0x0FFF0FFF)

Definition at line 437 of file savage_drv.h.

#define BCI_WRITE (   val)    *bci_ptr++ = (uint32_t)(val)

Definition at line 501 of file savage_drv.h.

#define BCI_X_W (   x,
  y 
)    ((((w) << 16) | (x)) & 0x0FFF0FFF)

Definition at line 439 of file savage_drv.h.

#define BCI_X_Y (   x,
  y 
)    ((((y) << 16) | (x)) & 0x0FFF0FFF)

Definition at line 438 of file savage_drv.h.

#define BEGIN_BCI (   n)
Value:
do { \
dev_priv->wait_fifo(dev_priv, (n)); \
bci_ptr = dev_priv->bci_ptr; \
} while(0)

Definition at line 496 of file savage_drv.h.

#define BEGIN_DMA (   n)
Value:
do { \
unsigned int cur = dev_priv->current_dma_page; \
unsigned int rest = SAVAGE_DMA_PAGE_SIZE - \
dev_priv->dma_pages[cur].used; \
if ((n) > rest) { \
dma_ptr = savage_dma_alloc(dev_priv, (n)); \
} else { /* fast path for small allocations */ \
dma_ptr = (uint32_t *)dev_priv->cmd_dma->handle + \
dev_priv->dma_pages[cur].used; \
if (dev_priv->dma_pages[cur].used == 0) \
savage_dma_wait(dev_priv, cur); \
dev_priv->dma_pages[cur].used += (n); \
} \
} while(0)

Definition at line 510 of file savage_drv.h.

#define DMA_COMMIT ( )
Value:
do { \
unsigned int cur = dev_priv->current_dma_page; \
uint32_t *expected = (uint32_t *)dev_priv->cmd_dma->handle + \
dev_priv->dma_pages[cur].used; \
if (dma_ptr != expected) { \
DRM_ERROR("DMA allocation and use don't match: " \
"%p != %p\n", expected, dma_ptr); \
savage_dma_reset(dev_priv); \
} \
} while(0)

Definition at line 534 of file savage_drv.h.

#define DMA_COPY (   src,
  n 
)
Value:
do { \
memcpy(dma_ptr, (src), (n)*4); \
dma_ptr += n; \
} while(0)

Definition at line 528 of file savage_drv.h.

#define DMA_DRAW_PRIMITIVE (   n,
  type,
  skip 
)
Value:
((n) << 16))

Definition at line 468 of file savage_drv.h.

#define DMA_FLUSH ( )    dev_priv->dma_flush(dev_priv)

Definition at line 549 of file savage_drv.h.

#define DMA_LOCALS   uint32_t *dma_ptr;

Definition at line 508 of file savage_drv.h.

#define DMA_SET_REGISTERS (   first,
  n 
)
Value:
((uint32_t)(n) & 0xff) << 16 | \
((uint32_t)(first) & 0xffff))

Definition at line 460 of file savage_drv.h.

#define DMA_WRITE (   val)    *dma_ptr++ = (uint32_t)(val)

Definition at line 526 of file savage_drv.h.

#define DRIVER_AUTHOR   "Felix Kuehling"

Definition at line 29 of file savage_drv.h.

#define DRIVER_DATE   "20050313"

Definition at line 33 of file savage_drv.h.

#define DRIVER_DESC   "Savage3D/MX/IX, Savage4, SuperSavage, Twister, ProSavage[DDR]"

Definition at line 32 of file savage_drv.h.

#define DRIVER_MAJOR   2

Definition at line 35 of file savage_drv.h.

#define DRIVER_MINOR   4

Definition at line 36 of file savage_drv.h.

#define DRIVER_NAME   "savage"

Definition at line 31 of file savage_drv.h.

#define DRIVER_PATCHLEVEL   1

Definition at line 37 of file savage_drv.h.

#define S3_MOBILE_TWISTER_SERIES (   chip)
Value:

Definition at line 121 of file savage_drv.h.

#define S3_SAVAGE3D_SERIES (   chip)    ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE_MX))

Definition at line 110 of file savage_drv.h.

#define S3_SAVAGE4_SERIES (   chip)
Value:

Definition at line 112 of file savage_drv.h.

#define S3_SAVAGE_MOBILE_SERIES (   chip)    ((chip==S3_SAVAGE_MX) || (chip==S3_SUPERSAVAGE))

Definition at line 117 of file savage_drv.h.

#define S3_SAVAGE_SERIES (   chip)    ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000))

Definition at line 119 of file savage_drv.h.

#define SAVAGE_ALT_STATUS_WORD0   0x48C60

Definition at line 238 of file savage_drv.h.

#define SAVAGE_APERTURE_OFFSET   0x02000000 /* 32MB */

Definition at line 227 of file savage_drv.h.

#define SAVAGE_APERTURE_SIZE   0x05000000 /* 5 tiled surfaces, 16MB each */

Definition at line 228 of file savage_drv.h.

#define SAVAGE_BCI_DEBUG   1

Definition at line 492 of file savage_drv.h.

#define SAVAGE_BCI_FIFO_SIZE
Value:
32 /* number of entries in on-chip
* BCI FIFO */

Definition at line 231 of file savage_drv.h.

#define SAVAGE_BCI_GLB_BD_HIGH   0x816C

Definition at line 270 of file savage_drv.h.

#define SAVAGE_BCI_GLB_BD_LOW   0x8168

Definition at line 269 of file savage_drv.h.

#define SAVAGE_BCI_OFFSET
Value:
0x00010000 /* offset of the BCI region
* inside the MMIO region */

Definition at line 230 of file savage_drv.h.

#define SAVAGE_BD_BPP_SHIFT   16

Definition at line 247 of file savage_drv.h.

#define SAVAGE_BD_BW_DISABLE   (1<<28)

Definition at line 249 of file savage_drv.h.

#define SAVAGE_BD_STRIDE_SHIFT   0

Definition at line 246 of file savage_drv.h.

#define SAVAGE_BD_TILE_16BPP   2

Definition at line 253 of file savage_drv.h.

#define SAVAGE_BD_TILE_32BPP   3

Definition at line 254 of file savage_drv.h.

#define SAVAGE_BD_TILE_DEST   1

Definition at line 256 of file savage_drv.h.

#define SAVAGE_BD_TILE_LINEAR   0

Definition at line 251 of file savage_drv.h.

#define SAVAGE_BD_TILE_SHIFT   24

Definition at line 248 of file savage_drv.h.

#define SAVAGE_BD_TILE_TEXTURE   2

Definition at line 257 of file savage_drv.h.

#define SAVAGE_BITPLANEWTMASK   0xd7

Definition at line 315 of file savage_drv.h.

#define SAVAGE_DESTCTRL_S3D   0x34

Definition at line 308 of file savage_drv.h.

#define SAVAGE_DESTCTRL_S4   0x34

Definition at line 291 of file savage_drv.h.

#define SAVAGE_DESTTEXRWWATERMARK_S3D   0x38

Definition at line 312 of file savage_drv.h.

#define SAVAGE_DESTTEXRWWATERMARK_S4   0x38

Definition at line 295 of file savage_drv.h.

#define SAVAGE_DMA_DEBUG   1

Definition at line 506 of file savage_drv.h.

#define SAVAGE_DMA_PAGE_SIZE   1024 /* in dwords */

Definition at line 68 of file savage_drv.h.

#define SAVAGE_DMABUFADDR   0x51

Definition at line 316 of file savage_drv.h.

#define SAVAGE_DRAWCTRL0_S4   0x35

Definition at line 292 of file savage_drv.h.

#define SAVAGE_DRAWCTRL1_S4   0x36

Definition at line 293 of file savage_drv.h.

#define SAVAGE_DRAWCTRL_S3D   0x31

Definition at line 305 of file savage_drv.h.

#define SAVAGE_DRAWCTRL_S3D_GLOBAL   0x03f3c00c

Definition at line 336 of file savage_drv.h.

#define SAVAGE_DRAWLOCALCTRL_S4   0x1e

Definition at line 276 of file savage_drv.h.

#define SAVAGE_FAKE_DMA_SIZE   (SAVAGE_DMA_PAGE_SIZE*4*4)

Definition at line 72 of file savage_drv.h.

#define SAVAGE_FB_SIZE_S3   0x01000000 /* 16MB */

Definition at line 224 of file savage_drv.h.

#define SAVAGE_FB_SIZE_S4   0x02000000 /* 32MB */

Definition at line 225 of file savage_drv.h.

#define SAVAGE_FIFO_USED_MASK_S3D   0x0001ffff

Definition at line 240 of file savage_drv.h.

#define SAVAGE_FIFO_USED_MASK_S4   0x001fffff

Definition at line 241 of file savage_drv.h.

#define SAVAGE_FOGCTRL_S3D   0x30

Definition at line 304 of file savage_drv.h.

#define SAVAGE_FOGCTRL_S4   0x30

Definition at line 287 of file savage_drv.h.

#define SAVAGE_FOGTABLE_S3D   0x20

Definition at line 303 of file savage_drv.h.

#define SAVAGE_FOGTABLE_S4   0x28

Definition at line 286 of file savage_drv.h.

#define SAVAGE_GBD_64   1

Definition at line 266 of file savage_drv.h.

#define SAVAGE_GBD_BCI_ENABLE   8

Definition at line 260 of file savage_drv.h.

#define SAVAGE_GBD_BCI_ENABLE_TWISTER   0

Definition at line 262 of file savage_drv.h.

#define SAVAGE_GBD_BIG_ENDIAN   4

Definition at line 264 of file savage_drv.h.

#define SAVAGE_GBD_LITTLE_ENDIAN   0

Definition at line 265 of file savage_drv.h.

#define SAVAGE_IS_AGP   1

Definition at line 125 of file savage_drv.h.

#define SAVAGE_MMIO_SIZE   0x00080000 /* 512kB */

Definition at line 226 of file savage_drv.h.

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

Definition at line 486 of file savage_drv.h.

#define SAVAGE_SCEND_S3D   0x36

Definition at line 310 of file savage_drv.h.

#define SAVAGE_SCISSOR_MASK_S3D   0x07ff07ff

Definition at line 342 of file savage_drv.h.

#define SAVAGE_SCISSOR_MASK_S4   0x00fff7ff

Definition at line 341 of file savage_drv.h.

#define SAVAGE_SCSTART_S3D   0x35

Definition at line 309 of file savage_drv.h.

#define SAVAGE_STATUS_WORD0   0x48C00

Definition at line 236 of file savage_drv.h.

#define SAVAGE_STATUS_WORD1   0x48C04

Definition at line 237 of file savage_drv.h.

#define SAVAGE_STENCILCTRL_S4   0x31

Definition at line 288 of file savage_drv.h.

#define SAVAGE_TEXADDR0_S4   0x22

Definition at line 280 of file savage_drv.h.

#define SAVAGE_TEXADDR1_S4   0x23

Definition at line 281 of file savage_drv.h.

#define SAVAGE_TEXADDR_S3D   0x1A

Definition at line 300 of file savage_drv.h.

#define SAVAGE_TEXBLEND0_S4   0x24

Definition at line 282 of file savage_drv.h.

#define SAVAGE_TEXBLEND1_S4   0x25

Definition at line 283 of file savage_drv.h.

#define SAVAGE_TEXBLENDCOLOR_S4   0x39

Definition at line 296 of file savage_drv.h.

#define SAVAGE_TEXCTRL0_S4   0x20

Definition at line 278 of file savage_drv.h.

#define SAVAGE_TEXCTRL1_S4   0x21

Definition at line 279 of file savage_drv.h.

#define SAVAGE_TEXCTRL_S3D   0x1C

Definition at line 302 of file savage_drv.h.

#define SAVAGE_TEXCTRL_TEXEN_MASK   0x00010000 /* S3D */

Definition at line 319 of file savage_drv.h.

#define SAVAGE_TEXDESCR_S3D   0x1B

Definition at line 301 of file savage_drv.h.

#define SAVAGE_TEXDESCR_S4   0x27

Definition at line 285 of file savage_drv.h.

#define SAVAGE_TEXDESCR_TEX0EN_MASK   0x02000000 /* S4 */

Definition at line 320 of file savage_drv.h.

#define SAVAGE_TEXDESCR_TEX1EN_MASK   0x04000000 /* S4 */

Definition at line 321 of file savage_drv.h.

#define SAVAGE_TEXPALADDR_S3D   0x18

Definition at line 298 of file savage_drv.h.

#define SAVAGE_TEXPALADDR_S4   0x1f

Definition at line 277 of file savage_drv.h.

#define SAVAGE_TEXXPRCLR_S3D   0x19 /* never used */

Definition at line 299 of file savage_drv.h.

#define SAVAGE_TEXXPRCLR_S4   0x26 /* never used */

Definition at line 284 of file savage_drv.h.

#define SAVAGE_VERTBUFADDR   0x3e

Definition at line 314 of file savage_drv.h.

#define SAVAGE_WRITE (   reg)    DRM_WRITE32( dev_priv->mmio, (reg) )

Definition at line 487 of file savage_drv.h.

#define SAVAGE_ZBUFCTRL_S3D   0x32

Definition at line 306 of file savage_drv.h.

#define SAVAGE_ZBUFCTRL_S3D_GLOBAL   0x00000027

Definition at line 337 of file savage_drv.h.

#define SAVAGE_ZBUFCTRL_S4   0x32

Definition at line 289 of file savage_drv.h.

#define SAVAGE_ZBUFOFF_S3D   0x33

Definition at line 307 of file savage_drv.h.

#define SAVAGE_ZBUFOFF_S4   0x33

Definition at line 290 of file savage_drv.h.

#define SAVAGE_ZWATERMARK_S3D   0x37

Definition at line 311 of file savage_drv.h.

#define SAVAGE_ZWATERMARK_S4   0x37

Definition at line 294 of file savage_drv.h.

#define SET_AGE (   age,
  e,
  w 
)
Value:
do { \
(age)->event = e; \
(age)->wrap = w; \
} while(0)

Definition at line 565 of file savage_drv.h.

#define TEST_AGE (   age,
  e,
  w 
)    ( (age)->wrap < (w) || ( (age)->wrap == (w) && (age)->event <= (e) ) )

Definition at line 570 of file savage_drv.h.

#define UPDATE_EVENT_COUNTER ( )
Value:
do { \
if (dev_priv->status_ptr) { \
/* coordinate with Xserver */ \
count = dev_priv->status_ptr[1023]; \
if (count < dev_priv->event_counter) \
dev_priv->event_wrap++; \
dev_priv->event_counter = count; \
} \
} while(0)

Definition at line 554 of file savage_drv.h.

Typedef Documentation

Enumeration Type Documentation

Enumerator:
S3_UNKNOWN 
S3_SAVAGE3D 
S3_SAVAGE_MX 
S3_SAVAGE4 
S3_PROSAVAGE 
S3_TWISTER 
S3_PROSAVAGEDDR 
S3_SUPERSAVAGE 
S3_SAVAGE2000 
S3_LAST 

Definition at line 94 of file savage_drv.h.

Function Documentation

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

Definition at line 1018 of file savage_bci.c.

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

Definition at line 956 of file savage_state.c.

uint16_t savage_bci_emit_event ( drm_savage_private_t dev_priv,
unsigned int  flags 
)

Definition at line 164 of file savage_bci.c.

uint32_t* savage_dma_alloc ( drm_savage_private_t dev_priv,
unsigned int  n 
)

Definition at line 362 of file savage_bci.c.

void savage_dma_reset ( drm_savage_private_t dev_priv)

Definition at line 319 of file savage_bci.c.

void savage_dma_wait ( drm_savage_private_t dev_priv,
unsigned int  page 
)

Definition at line 334 of file savage_bci.c.

int savage_driver_firstopen ( struct drm_device dev)

Definition at line 562 of file savage_bci.c.

void savage_driver_lastclose ( struct drm_device dev)

Definition at line 658 of file savage_bci.c.

int savage_driver_load ( struct drm_device dev,
unsigned long  chipset 
)

Definition at line 538 of file savage_bci.c.

int savage_driver_unload ( struct drm_device dev)

Definition at line 670 of file savage_bci.c.

void savage_emit_clip_rect_s3d ( drm_savage_private_t dev_priv,
const struct drm_clip_rect pbox 
)

Definition at line 29 of file savage_state.c.

void savage_emit_clip_rect_s4 ( drm_savage_private_t dev_priv,
const struct drm_clip_rect pbox 
)

Definition at line 55 of file savage_state.c.

void savage_freelist_put ( struct drm_device dev,
struct drm_buf *  buf 
)

Definition at line 272 of file savage_bci.c.

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

Definition at line 1051 of file savage_bci.c.

Variable Documentation

struct drm_ioctl_desc savage_ioctls[]

Definition at line 1088 of file savage_bci.c.

int savage_max_ioctl

Definition at line 1095 of file savage_bci.c.