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 _I810_DRM_H_
722851890Sopenharmony_ci#define _I810_DRM_H_
822851890Sopenharmony_ci#include "drm.h"
922851890Sopenharmony_ci#if defined(__cplusplus)
1022851890Sopenharmony_ciextern "C" {
1122851890Sopenharmony_ci#endif
1222851890Sopenharmony_ci#ifndef _I810_DEFINES_
1322851890Sopenharmony_ci#define _I810_DEFINES_
1422851890Sopenharmony_ci#define I810_DMA_BUF_ORDER		12
1522851890Sopenharmony_ci#define I810_DMA_BUF_SZ 		(1<<I810_DMA_BUF_ORDER)
1622851890Sopenharmony_ci#define I810_DMA_BUF_NR 		256
1722851890Sopenharmony_ci#define I810_NR_SAREA_CLIPRECTS 	8
1822851890Sopenharmony_ci#define I810_NR_TEX_REGIONS 64
1922851890Sopenharmony_ci#define I810_LOG_MIN_TEX_REGION_SIZE 16
2022851890Sopenharmony_ci#endif
2122851890Sopenharmony_ci#define I810_UPLOAD_TEX0IMAGE  0x1
2222851890Sopenharmony_ci#define I810_UPLOAD_TEX1IMAGE  0x2
2322851890Sopenharmony_ci#define I810_UPLOAD_CTX        0x4
2422851890Sopenharmony_ci#define I810_UPLOAD_BUFFERS    0x8
2522851890Sopenharmony_ci#define I810_UPLOAD_TEX0       0x10
2622851890Sopenharmony_ci#define I810_UPLOAD_TEX1       0x20
2722851890Sopenharmony_ci#define I810_UPLOAD_CLIPRECTS  0x40
2822851890Sopenharmony_ci#define I810_DESTREG_DI0  0
2922851890Sopenharmony_ci#define I810_DESTREG_DI1  1
3022851890Sopenharmony_ci#define I810_DESTREG_DV0  2
3122851890Sopenharmony_ci#define I810_DESTREG_DV1  3
3222851890Sopenharmony_ci#define I810_DESTREG_DR0  4
3322851890Sopenharmony_ci#define I810_DESTREG_DR1  5
3422851890Sopenharmony_ci#define I810_DESTREG_DR2  6
3522851890Sopenharmony_ci#define I810_DESTREG_DR3  7
3622851890Sopenharmony_ci#define I810_DESTREG_DR4  8
3722851890Sopenharmony_ci#define I810_DEST_SETUP_SIZE 10
3822851890Sopenharmony_ci#define I810_CTXREG_CF0   0
3922851890Sopenharmony_ci#define I810_CTXREG_CF1   1
4022851890Sopenharmony_ci#define I810_CTXREG_ST0   2
4122851890Sopenharmony_ci#define I810_CTXREG_ST1   3
4222851890Sopenharmony_ci#define I810_CTXREG_VF    4
4322851890Sopenharmony_ci#define I810_CTXREG_MT    5
4422851890Sopenharmony_ci#define I810_CTXREG_MC0   6
4522851890Sopenharmony_ci#define I810_CTXREG_MC1   7
4622851890Sopenharmony_ci#define I810_CTXREG_MC2   8
4722851890Sopenharmony_ci#define I810_CTXREG_MA0   9
4822851890Sopenharmony_ci#define I810_CTXREG_MA1   10
4922851890Sopenharmony_ci#define I810_CTXREG_MA2   11
5022851890Sopenharmony_ci#define I810_CTXREG_SDM   12
5122851890Sopenharmony_ci#define I810_CTXREG_FOG   13
5222851890Sopenharmony_ci#define I810_CTXREG_B1    14
5322851890Sopenharmony_ci#define I810_CTXREG_B2    15
5422851890Sopenharmony_ci#define I810_CTXREG_LCS   16
5522851890Sopenharmony_ci#define I810_CTXREG_PV    17
5622851890Sopenharmony_ci#define I810_CTXREG_ZA    18
5722851890Sopenharmony_ci#define I810_CTXREG_AA    19
5822851890Sopenharmony_ci#define I810_CTX_SETUP_SIZE 20
5922851890Sopenharmony_ci#define I810_TEXREG_MI0  0
6022851890Sopenharmony_ci#define I810_TEXREG_MI1  1
6122851890Sopenharmony_ci#define I810_TEXREG_MI2  2
6222851890Sopenharmony_ci#define I810_TEXREG_MI3  3
6322851890Sopenharmony_ci#define I810_TEXREG_MF   4
6422851890Sopenharmony_ci#define I810_TEXREG_MLC  5
6522851890Sopenharmony_ci#define I810_TEXREG_MLL  6
6622851890Sopenharmony_ci#define I810_TEXREG_MCS  7
6722851890Sopenharmony_ci#define I810_TEX_SETUP_SIZE 8
6822851890Sopenharmony_ci#define I810_FRONT   0x1
6922851890Sopenharmony_ci#define I810_BACK    0x2
7022851890Sopenharmony_ci#define I810_DEPTH   0x4
7122851890Sopenharmony_citypedef enum _drm_i810_init_func {
7222851890Sopenharmony_ci	I810_INIT_DMA = 0x01,
7322851890Sopenharmony_ci	I810_CLEANUP_DMA = 0x02,
7422851890Sopenharmony_ci	I810_INIT_DMA_1_4 = 0x03
7522851890Sopenharmony_ci} drm_i810_init_func_t;
7622851890Sopenharmony_citypedef struct _drm_i810_init {
7722851890Sopenharmony_ci	drm_i810_init_func_t func;
7822851890Sopenharmony_ci	unsigned int mmio_offset;
7922851890Sopenharmony_ci	unsigned int buffers_offset;
8022851890Sopenharmony_ci	int sarea_priv_offset;
8122851890Sopenharmony_ci	unsigned int ring_start;
8222851890Sopenharmony_ci	unsigned int ring_end;
8322851890Sopenharmony_ci	unsigned int ring_size;
8422851890Sopenharmony_ci	unsigned int front_offset;
8522851890Sopenharmony_ci	unsigned int back_offset;
8622851890Sopenharmony_ci	unsigned int depth_offset;
8722851890Sopenharmony_ci	unsigned int overlay_offset;
8822851890Sopenharmony_ci	unsigned int overlay_physical;
8922851890Sopenharmony_ci	unsigned int w;
9022851890Sopenharmony_ci	unsigned int h;
9122851890Sopenharmony_ci	unsigned int pitch;
9222851890Sopenharmony_ci	unsigned int pitch_bits;
9322851890Sopenharmony_ci} drm_i810_init_t;
9422851890Sopenharmony_citypedef struct _drm_i810_pre12_init {
9522851890Sopenharmony_ci	drm_i810_init_func_t func;
9622851890Sopenharmony_ci	unsigned int mmio_offset;
9722851890Sopenharmony_ci	unsigned int buffers_offset;
9822851890Sopenharmony_ci	int sarea_priv_offset;
9922851890Sopenharmony_ci	unsigned int ring_start;
10022851890Sopenharmony_ci	unsigned int ring_end;
10122851890Sopenharmony_ci	unsigned int ring_size;
10222851890Sopenharmony_ci	unsigned int front_offset;
10322851890Sopenharmony_ci	unsigned int back_offset;
10422851890Sopenharmony_ci	unsigned int depth_offset;
10522851890Sopenharmony_ci	unsigned int w;
10622851890Sopenharmony_ci	unsigned int h;
10722851890Sopenharmony_ci	unsigned int pitch;
10822851890Sopenharmony_ci	unsigned int pitch_bits;
10922851890Sopenharmony_ci} drm_i810_pre12_init_t;
11022851890Sopenharmony_citypedef struct _drm_i810_tex_region {
11122851890Sopenharmony_ci	unsigned char next, prev;
11222851890Sopenharmony_ci	unsigned char in_use;
11322851890Sopenharmony_ci	int age;
11422851890Sopenharmony_ci} drm_i810_tex_region_t;
11522851890Sopenharmony_citypedef struct _drm_i810_sarea {
11622851890Sopenharmony_ci	unsigned int ContextState[I810_CTX_SETUP_SIZE];
11722851890Sopenharmony_ci	unsigned int BufferState[I810_DEST_SETUP_SIZE];
11822851890Sopenharmony_ci	unsigned int TexState[2][I810_TEX_SETUP_SIZE];
11922851890Sopenharmony_ci	unsigned int dirty;
12022851890Sopenharmony_ci	unsigned int nbox;
12122851890Sopenharmony_ci	struct drm_clip_rect boxes[I810_NR_SAREA_CLIPRECTS];
12222851890Sopenharmony_ci
12322851890Sopenharmony_ci	drm_i810_tex_region_t texList[I810_NR_TEX_REGIONS + 1];
12422851890Sopenharmony_ci
12522851890Sopenharmony_ci	int texAge;
12622851890Sopenharmony_ci	int last_enqueue;
12722851890Sopenharmony_ci	int last_dispatch;
12822851890Sopenharmony_ci	int last_quiescent;
12922851890Sopenharmony_ci	int ctxOwner;
13022851890Sopenharmony_ci	int vertex_prim;
13122851890Sopenharmony_ci	int pf_enabled;
13222851890Sopenharmony_ci	int pf_active;
13322851890Sopenharmony_ci	int pf_current_page;
13422851890Sopenharmony_ci} drm_i810_sarea_t;
13522851890Sopenharmony_ci#define DRM_I810_INIT		0x00
13622851890Sopenharmony_ci#define DRM_I810_VERTEX		0x01
13722851890Sopenharmony_ci#define DRM_I810_CLEAR		0x02
13822851890Sopenharmony_ci#define DRM_I810_FLUSH		0x03
13922851890Sopenharmony_ci#define DRM_I810_GETAGE		0x04
14022851890Sopenharmony_ci#define DRM_I810_GETBUF		0x05
14122851890Sopenharmony_ci#define DRM_I810_SWAP		0x06
14222851890Sopenharmony_ci#define DRM_I810_COPY		0x07
14322851890Sopenharmony_ci#define DRM_I810_DOCOPY		0x08
14422851890Sopenharmony_ci#define DRM_I810_OV0INFO	0x09
14522851890Sopenharmony_ci#define DRM_I810_FSTATUS	0x0a
14622851890Sopenharmony_ci#define DRM_I810_OV0FLIP	0x0b
14722851890Sopenharmony_ci#define DRM_I810_MC		0x0c
14822851890Sopenharmony_ci#define DRM_I810_RSTATUS	0x0d
14922851890Sopenharmony_ci#define DRM_I810_FLIP		0x0e
15022851890Sopenharmony_ci#define DRM_IOCTL_I810_INIT		DRM_IOW( DRM_COMMAND_BASE + DRM_I810_INIT, drm_i810_init_t)
15122851890Sopenharmony_ci#define DRM_IOCTL_I810_VERTEX		DRM_IOW( DRM_COMMAND_BASE + DRM_I810_VERTEX, drm_i810_vertex_t)
15222851890Sopenharmony_ci#define DRM_IOCTL_I810_CLEAR		DRM_IOW( DRM_COMMAND_BASE + DRM_I810_CLEAR, drm_i810_clear_t)
15322851890Sopenharmony_ci#define DRM_IOCTL_I810_FLUSH		DRM_IO(  DRM_COMMAND_BASE + DRM_I810_FLUSH)
15422851890Sopenharmony_ci#define DRM_IOCTL_I810_GETAGE		DRM_IO(  DRM_COMMAND_BASE + DRM_I810_GETAGE)
15522851890Sopenharmony_ci#define DRM_IOCTL_I810_GETBUF		DRM_IOWR(DRM_COMMAND_BASE + DRM_I810_GETBUF, drm_i810_dma_t)
15622851890Sopenharmony_ci#define DRM_IOCTL_I810_SWAP		DRM_IO(  DRM_COMMAND_BASE + DRM_I810_SWAP)
15722851890Sopenharmony_ci#define DRM_IOCTL_I810_COPY		DRM_IOW( DRM_COMMAND_BASE + DRM_I810_COPY, drm_i810_copy_t)
15822851890Sopenharmony_ci#define DRM_IOCTL_I810_DOCOPY		DRM_IO(  DRM_COMMAND_BASE + DRM_I810_DOCOPY)
15922851890Sopenharmony_ci#define DRM_IOCTL_I810_OV0INFO		DRM_IOR( DRM_COMMAND_BASE + DRM_I810_OV0INFO, drm_i810_overlay_t)
16022851890Sopenharmony_ci#define DRM_IOCTL_I810_FSTATUS		DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FSTATUS)
16122851890Sopenharmony_ci#define DRM_IOCTL_I810_OV0FLIP		DRM_IO ( DRM_COMMAND_BASE + DRM_I810_OV0FLIP)
16222851890Sopenharmony_ci#define DRM_IOCTL_I810_MC		DRM_IOW( DRM_COMMAND_BASE + DRM_I810_MC, drm_i810_mc_t)
16322851890Sopenharmony_ci#define DRM_IOCTL_I810_RSTATUS		DRM_IO ( DRM_COMMAND_BASE + DRM_I810_RSTATUS)
16422851890Sopenharmony_ci#define DRM_IOCTL_I810_FLIP             DRM_IO ( DRM_COMMAND_BASE + DRM_I810_FLIP)
16522851890Sopenharmony_citypedef struct _drm_i810_clear {
16622851890Sopenharmony_ci	int clear_color;
16722851890Sopenharmony_ci	int clear_depth;
16822851890Sopenharmony_ci	int flags;
16922851890Sopenharmony_ci} drm_i810_clear_t;
17022851890Sopenharmony_citypedef struct _drm_i810_vertex {
17122851890Sopenharmony_ci	int idx;
17222851890Sopenharmony_ci	int used;
17322851890Sopenharmony_ci	int discard;
17422851890Sopenharmony_ci} drm_i810_vertex_t;
17522851890Sopenharmony_citypedef struct _drm_i810_copy_t {
17622851890Sopenharmony_ci	int idx;
17722851890Sopenharmony_ci	int used;
17822851890Sopenharmony_ci	void *address;
17922851890Sopenharmony_ci} drm_i810_copy_t;
18022851890Sopenharmony_ci#define PR_TRIANGLES         (0x0<<18)
18122851890Sopenharmony_ci#define PR_TRISTRIP_0        (0x1<<18)
18222851890Sopenharmony_ci#define PR_TRISTRIP_1        (0x2<<18)
18322851890Sopenharmony_ci#define PR_TRIFAN            (0x3<<18)
18422851890Sopenharmony_ci#define PR_POLYGON           (0x4<<18)
18522851890Sopenharmony_ci#define PR_LINES             (0x5<<18)
18622851890Sopenharmony_ci#define PR_LINESTRIP         (0x6<<18)
18722851890Sopenharmony_ci#define PR_RECTS             (0x7<<18)
18822851890Sopenharmony_ci#define PR_MASK              (0x7<<18)
18922851890Sopenharmony_citypedef struct drm_i810_dma {
19022851890Sopenharmony_ci	void * __linux_virtual;
19122851890Sopenharmony_ci	int request_idx;
19222851890Sopenharmony_ci	int request_size;
19322851890Sopenharmony_ci	int granted;
19422851890Sopenharmony_ci} drm_i810_dma_t;
19522851890Sopenharmony_citypedef struct _drm_i810_overlay_t {
19622851890Sopenharmony_ci	unsigned int offset;
19722851890Sopenharmony_ci	unsigned int physical;
19822851890Sopenharmony_ci} drm_i810_overlay_t;
19922851890Sopenharmony_citypedef struct _drm_i810_mc {
20022851890Sopenharmony_ci	int idx;
20122851890Sopenharmony_ci	int used;
20222851890Sopenharmony_ci	int num_blocks;
20322851890Sopenharmony_ci	int *length;
20422851890Sopenharmony_ci	unsigned int last_render;
20522851890Sopenharmony_ci} drm_i810_mc_t;
20622851890Sopenharmony_ci#if defined(__cplusplus)
20722851890Sopenharmony_ci}
20822851890Sopenharmony_ci#endif
20922851890Sopenharmony_ci#endif
210