122851890Sopenharmony_ci/*
222851890Sopenharmony_ci * This header was generated from the Linux kernel headers by update_headers.py,
322851890Sopenharmony_ci * to provide necessary information from kernel to userspace, such as constants,
422851890Sopenharmony_ci * structures, and macros, and thus, contains no copyrightable information.
522851890Sopenharmony_ci */
622851890Sopenharmony_ci#ifndef __SAVAGE_DRM_H__
722851890Sopenharmony_ci#define __SAVAGE_DRM_H__
822851890Sopenharmony_ci#include "drm.h"
922851890Sopenharmony_ci#if defined(__cplusplus)
1022851890Sopenharmony_ciextern "C" {
1122851890Sopenharmony_ci#endif
1222851890Sopenharmony_ci#ifndef __SAVAGE_SAREA_DEFINES__
1322851890Sopenharmony_ci#define __SAVAGE_SAREA_DEFINES__
1422851890Sopenharmony_ci#define SAVAGE_CARD_HEAP		0
1522851890Sopenharmony_ci#define SAVAGE_AGP_HEAP			1
1622851890Sopenharmony_ci#define SAVAGE_NR_TEX_HEAPS		2
1722851890Sopenharmony_ci#define SAVAGE_NR_TEX_REGIONS		16
1822851890Sopenharmony_ci#define SAVAGE_LOG_MIN_TEX_REGION_SIZE	16
1922851890Sopenharmony_ci#endif
2022851890Sopenharmony_citypedef struct _drm_savage_sarea {
2122851890Sopenharmony_ci
2222851890Sopenharmony_ci	struct drm_tex_region texList[SAVAGE_NR_TEX_HEAPS][SAVAGE_NR_TEX_REGIONS +
2322851890Sopenharmony_ci						      1];
2422851890Sopenharmony_ci	unsigned int texAge[SAVAGE_NR_TEX_HEAPS];
2522851890Sopenharmony_ci
2622851890Sopenharmony_ci	int ctxOwner;
2722851890Sopenharmony_ci} drm_savage_sarea_t, *drm_savage_sarea_ptr;
2822851890Sopenharmony_ci#define DRM_SAVAGE_BCI_INIT		0x00
2922851890Sopenharmony_ci#define DRM_SAVAGE_BCI_CMDBUF           0x01
3022851890Sopenharmony_ci#define DRM_SAVAGE_BCI_EVENT_EMIT	0x02
3122851890Sopenharmony_ci#define DRM_SAVAGE_BCI_EVENT_WAIT	0x03
3222851890Sopenharmony_ci#define DRM_IOCTL_SAVAGE_BCI_INIT		DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_INIT, drm_savage_init_t)
3322851890Sopenharmony_ci#define DRM_IOCTL_SAVAGE_BCI_CMDBUF		DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_CMDBUF, drm_savage_cmdbuf_t)
3422851890Sopenharmony_ci#define DRM_IOCTL_SAVAGE_BCI_EVENT_EMIT	DRM_IOWR(DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_EMIT, drm_savage_event_emit_t)
3522851890Sopenharmony_ci#define DRM_IOCTL_SAVAGE_BCI_EVENT_WAIT	DRM_IOW( DRM_COMMAND_BASE + DRM_SAVAGE_BCI_EVENT_WAIT, drm_savage_event_wait_t)
3622851890Sopenharmony_ci#define SAVAGE_DMA_PCI	1
3722851890Sopenharmony_ci#define SAVAGE_DMA_AGP	3
3822851890Sopenharmony_citypedef struct drm_savage_init {
3922851890Sopenharmony_ci	enum {
4022851890Sopenharmony_ci		SAVAGE_INIT_BCI = 1,
4122851890Sopenharmony_ci		SAVAGE_CLEANUP_BCI = 2
4222851890Sopenharmony_ci	} func;
4322851890Sopenharmony_ci	unsigned int sarea_priv_offset;
4422851890Sopenharmony_ci
4522851890Sopenharmony_ci	unsigned int cob_size;
4622851890Sopenharmony_ci	unsigned int bci_threshold_lo, bci_threshold_hi;
4722851890Sopenharmony_ci	unsigned int dma_type;
4822851890Sopenharmony_ci
4922851890Sopenharmony_ci	unsigned int fb_bpp;
5022851890Sopenharmony_ci	unsigned int front_offset, front_pitch;
5122851890Sopenharmony_ci	unsigned int back_offset, back_pitch;
5222851890Sopenharmony_ci	unsigned int depth_bpp;
5322851890Sopenharmony_ci	unsigned int depth_offset, depth_pitch;
5422851890Sopenharmony_ci
5522851890Sopenharmony_ci	unsigned int texture_offset;
5622851890Sopenharmony_ci	unsigned int texture_size;
5722851890Sopenharmony_ci
5822851890Sopenharmony_ci	unsigned long status_offset;
5922851890Sopenharmony_ci	unsigned long buffers_offset;
6022851890Sopenharmony_ci	unsigned long agp_textures_offset;
6122851890Sopenharmony_ci	unsigned long cmd_dma_offset;
6222851890Sopenharmony_ci} drm_savage_init_t;
6322851890Sopenharmony_citypedef union drm_savage_cmd_header drm_savage_cmd_header_t;
6422851890Sopenharmony_citypedef struct drm_savage_cmdbuf {
6522851890Sopenharmony_ci
6622851890Sopenharmony_ci	drm_savage_cmd_header_t __user *cmd_addr;
6722851890Sopenharmony_ci	unsigned int size;
6822851890Sopenharmony_ci	unsigned int dma_idx;
6922851890Sopenharmony_ci	int discard;
7022851890Sopenharmony_ci
7122851890Sopenharmony_ci	unsigned int __user *vb_addr;
7222851890Sopenharmony_ci	unsigned int vb_size;
7322851890Sopenharmony_ci	unsigned int vb_stride;
7422851890Sopenharmony_ci
7522851890Sopenharmony_ci	struct drm_clip_rect __user *box_addr;
7622851890Sopenharmony_ci	unsigned int nbox;
7722851890Sopenharmony_ci} drm_savage_cmdbuf_t;
7822851890Sopenharmony_ci#define SAVAGE_WAIT_2D  0x1
7922851890Sopenharmony_ci#define SAVAGE_WAIT_3D  0x2
8022851890Sopenharmony_ci#define SAVAGE_WAIT_IRQ 0x4
8122851890Sopenharmony_citypedef struct drm_savage_event {
8222851890Sopenharmony_ci	unsigned int count;
8322851890Sopenharmony_ci	unsigned int flags;
8422851890Sopenharmony_ci} drm_savage_event_emit_t, drm_savage_event_wait_t;
8522851890Sopenharmony_ci#define SAVAGE_CMD_STATE	0
8622851890Sopenharmony_ci#define SAVAGE_CMD_DMA_PRIM	1
8722851890Sopenharmony_ci#define SAVAGE_CMD_VB_PRIM	2
8822851890Sopenharmony_ci#define SAVAGE_CMD_DMA_IDX	3
8922851890Sopenharmony_ci#define SAVAGE_CMD_VB_IDX	4
9022851890Sopenharmony_ci#define SAVAGE_CMD_CLEAR	5
9122851890Sopenharmony_ci#define SAVAGE_CMD_SWAP		6
9222851890Sopenharmony_ci#define SAVAGE_PRIM_TRILIST	0
9322851890Sopenharmony_ci#define SAVAGE_PRIM_TRISTRIP	1
9422851890Sopenharmony_ci#define SAVAGE_PRIM_TRIFAN	2
9522851890Sopenharmony_ci#define SAVAGE_PRIM_TRILIST_201	3
9622851890Sopenharmony_ci#define SAVAGE_SKIP_Z		0x01
9722851890Sopenharmony_ci#define SAVAGE_SKIP_W		0x02
9822851890Sopenharmony_ci#define SAVAGE_SKIP_C0		0x04
9922851890Sopenharmony_ci#define SAVAGE_SKIP_C1		0x08
10022851890Sopenharmony_ci#define SAVAGE_SKIP_S0		0x10
10122851890Sopenharmony_ci#define SAVAGE_SKIP_T0		0x20
10222851890Sopenharmony_ci#define SAVAGE_SKIP_ST0		0x30
10322851890Sopenharmony_ci#define SAVAGE_SKIP_S1		0x40
10422851890Sopenharmony_ci#define SAVAGE_SKIP_T1		0x80
10522851890Sopenharmony_ci#define SAVAGE_SKIP_ST1		0xc0
10622851890Sopenharmony_ci#define SAVAGE_SKIP_ALL_S3D	0x3f
10722851890Sopenharmony_ci#define SAVAGE_SKIP_ALL_S4	0xff
10822851890Sopenharmony_ci#define SAVAGE_FRONT		0x1
10922851890Sopenharmony_ci#define SAVAGE_BACK		0x2
11022851890Sopenharmony_ci#define SAVAGE_DEPTH		0x4
11122851890Sopenharmony_ciunion drm_savage_cmd_header {
11222851890Sopenharmony_ci	struct {
11322851890Sopenharmony_ci		unsigned char cmd;
11422851890Sopenharmony_ci		unsigned char pad0;
11522851890Sopenharmony_ci		unsigned short pad1;
11622851890Sopenharmony_ci		unsigned short pad2;
11722851890Sopenharmony_ci		unsigned short pad3;
11822851890Sopenharmony_ci	} cmd;
11922851890Sopenharmony_ci	struct {
12022851890Sopenharmony_ci		unsigned char cmd;
12122851890Sopenharmony_ci		unsigned char global;
12222851890Sopenharmony_ci		unsigned short count;
12322851890Sopenharmony_ci		unsigned short start;
12422851890Sopenharmony_ci		unsigned short pad3;
12522851890Sopenharmony_ci	} state;
12622851890Sopenharmony_ci	struct {
12722851890Sopenharmony_ci		unsigned char cmd;
12822851890Sopenharmony_ci		unsigned char prim;
12922851890Sopenharmony_ci		unsigned short skip;
13022851890Sopenharmony_ci		unsigned short count;
13122851890Sopenharmony_ci		unsigned short start;
13222851890Sopenharmony_ci	} prim;
13322851890Sopenharmony_ci	struct {
13422851890Sopenharmony_ci		unsigned char cmd;
13522851890Sopenharmony_ci		unsigned char prim;
13622851890Sopenharmony_ci		unsigned short skip;
13722851890Sopenharmony_ci		unsigned short count;
13822851890Sopenharmony_ci		unsigned short pad3;
13922851890Sopenharmony_ci	} idx;
14022851890Sopenharmony_ci	struct {
14122851890Sopenharmony_ci		unsigned char cmd;
14222851890Sopenharmony_ci		unsigned char pad0;
14322851890Sopenharmony_ci		unsigned short pad1;
14422851890Sopenharmony_ci		unsigned int flags;
14522851890Sopenharmony_ci	} clear0;
14622851890Sopenharmony_ci	struct {
14722851890Sopenharmony_ci		unsigned int mask;
14822851890Sopenharmony_ci		unsigned int value;
14922851890Sopenharmony_ci	} clear1;
15022851890Sopenharmony_ci};
15122851890Sopenharmony_ci#if defined(__cplusplus)
15222851890Sopenharmony_ci}
15322851890Sopenharmony_ci#endif
15422851890Sopenharmony_ci#endif
155