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 __RADEON_DRM_H__
722851890Sopenharmony_ci#define __RADEON_DRM_H__
822851890Sopenharmony_ci#include "drm.h"
922851890Sopenharmony_ci#if defined(__cplusplus)
1022851890Sopenharmony_ciextern "C" {
1122851890Sopenharmony_ci#endif
1222851890Sopenharmony_ci#ifndef __RADEON_SAREA_DEFINES__
1322851890Sopenharmony_ci#define __RADEON_SAREA_DEFINES__
1422851890Sopenharmony_ci#define RADEON_UPLOAD_CONTEXT		0x00000001
1522851890Sopenharmony_ci#define RADEON_UPLOAD_VERTFMT		0x00000002
1622851890Sopenharmony_ci#define RADEON_UPLOAD_LINE		0x00000004
1722851890Sopenharmony_ci#define RADEON_UPLOAD_BUMPMAP		0x00000008
1822851890Sopenharmony_ci#define RADEON_UPLOAD_MASKS		0x00000010
1922851890Sopenharmony_ci#define RADEON_UPLOAD_VIEWPORT		0x00000020
2022851890Sopenharmony_ci#define RADEON_UPLOAD_SETUP		0x00000040
2122851890Sopenharmony_ci#define RADEON_UPLOAD_TCL		0x00000080
2222851890Sopenharmony_ci#define RADEON_UPLOAD_MISC		0x00000100
2322851890Sopenharmony_ci#define RADEON_UPLOAD_TEX0		0x00000200
2422851890Sopenharmony_ci#define RADEON_UPLOAD_TEX1		0x00000400
2522851890Sopenharmony_ci#define RADEON_UPLOAD_TEX2		0x00000800
2622851890Sopenharmony_ci#define RADEON_UPLOAD_TEX0IMAGES	0x00001000
2722851890Sopenharmony_ci#define RADEON_UPLOAD_TEX1IMAGES	0x00002000
2822851890Sopenharmony_ci#define RADEON_UPLOAD_TEX2IMAGES	0x00004000
2922851890Sopenharmony_ci#define RADEON_UPLOAD_CLIPRECTS		0x00008000
3022851890Sopenharmony_ci#define RADEON_REQUIRE_QUIESCENCE	0x00010000
3122851890Sopenharmony_ci#define RADEON_UPLOAD_ZBIAS		0x00020000
3222851890Sopenharmony_ci#define RADEON_UPLOAD_ALL		0x003effff
3322851890Sopenharmony_ci#define RADEON_UPLOAD_CONTEXT_ALL       0x003e01ff
3422851890Sopenharmony_ci#define RADEON_EMIT_PP_MISC                         0
3522851890Sopenharmony_ci#define RADEON_EMIT_PP_CNTL                         1
3622851890Sopenharmony_ci#define RADEON_EMIT_RB3D_COLORPITCH                 2
3722851890Sopenharmony_ci#define RADEON_EMIT_RE_LINE_PATTERN                 3
3822851890Sopenharmony_ci#define RADEON_EMIT_SE_LINE_WIDTH                   4
3922851890Sopenharmony_ci#define RADEON_EMIT_PP_LUM_MATRIX                   5
4022851890Sopenharmony_ci#define RADEON_EMIT_PP_ROT_MATRIX_0                 6
4122851890Sopenharmony_ci#define RADEON_EMIT_RB3D_STENCILREFMASK             7
4222851890Sopenharmony_ci#define RADEON_EMIT_SE_VPORT_XSCALE                 8
4322851890Sopenharmony_ci#define RADEON_EMIT_SE_CNTL                         9
4422851890Sopenharmony_ci#define RADEON_EMIT_SE_CNTL_STATUS                  10
4522851890Sopenharmony_ci#define RADEON_EMIT_RE_MISC                         11
4622851890Sopenharmony_ci#define RADEON_EMIT_PP_TXFILTER_0                   12
4722851890Sopenharmony_ci#define RADEON_EMIT_PP_BORDER_COLOR_0               13
4822851890Sopenharmony_ci#define RADEON_EMIT_PP_TXFILTER_1                   14
4922851890Sopenharmony_ci#define RADEON_EMIT_PP_BORDER_COLOR_1               15
5022851890Sopenharmony_ci#define RADEON_EMIT_PP_TXFILTER_2                   16
5122851890Sopenharmony_ci#define RADEON_EMIT_PP_BORDER_COLOR_2               17
5222851890Sopenharmony_ci#define RADEON_EMIT_SE_ZBIAS_FACTOR                 18
5322851890Sopenharmony_ci#define RADEON_EMIT_SE_TCL_OUTPUT_VTX_FMT           19
5422851890Sopenharmony_ci#define RADEON_EMIT_SE_TCL_MATERIAL_EMMISSIVE_RED   20
5522851890Sopenharmony_ci#define R200_EMIT_PP_TXCBLEND_0                     21
5622851890Sopenharmony_ci#define R200_EMIT_PP_TXCBLEND_1                     22
5722851890Sopenharmony_ci#define R200_EMIT_PP_TXCBLEND_2                     23
5822851890Sopenharmony_ci#define R200_EMIT_PP_TXCBLEND_3                     24
5922851890Sopenharmony_ci#define R200_EMIT_PP_TXCBLEND_4                     25
6022851890Sopenharmony_ci#define R200_EMIT_PP_TXCBLEND_5                     26
6122851890Sopenharmony_ci#define R200_EMIT_PP_TXCBLEND_6                     27
6222851890Sopenharmony_ci#define R200_EMIT_PP_TXCBLEND_7                     28
6322851890Sopenharmony_ci#define R200_EMIT_TCL_LIGHT_MODEL_CTL_0             29
6422851890Sopenharmony_ci#define R200_EMIT_TFACTOR_0                         30
6522851890Sopenharmony_ci#define R200_EMIT_VTX_FMT_0                         31
6622851890Sopenharmony_ci#define R200_EMIT_VAP_CTL                           32
6722851890Sopenharmony_ci#define R200_EMIT_MATRIX_SELECT_0                   33
6822851890Sopenharmony_ci#define R200_EMIT_TEX_PROC_CTL_2                    34
6922851890Sopenharmony_ci#define R200_EMIT_TCL_UCP_VERT_BLEND_CTL            35
7022851890Sopenharmony_ci#define R200_EMIT_PP_TXFILTER_0                     36
7122851890Sopenharmony_ci#define R200_EMIT_PP_TXFILTER_1                     37
7222851890Sopenharmony_ci#define R200_EMIT_PP_TXFILTER_2                     38
7322851890Sopenharmony_ci#define R200_EMIT_PP_TXFILTER_3                     39
7422851890Sopenharmony_ci#define R200_EMIT_PP_TXFILTER_4                     40
7522851890Sopenharmony_ci#define R200_EMIT_PP_TXFILTER_5                     41
7622851890Sopenharmony_ci#define R200_EMIT_PP_TXOFFSET_0                     42
7722851890Sopenharmony_ci#define R200_EMIT_PP_TXOFFSET_1                     43
7822851890Sopenharmony_ci#define R200_EMIT_PP_TXOFFSET_2                     44
7922851890Sopenharmony_ci#define R200_EMIT_PP_TXOFFSET_3                     45
8022851890Sopenharmony_ci#define R200_EMIT_PP_TXOFFSET_4                     46
8122851890Sopenharmony_ci#define R200_EMIT_PP_TXOFFSET_5                     47
8222851890Sopenharmony_ci#define R200_EMIT_VTE_CNTL                          48
8322851890Sopenharmony_ci#define R200_EMIT_OUTPUT_VTX_COMP_SEL               49
8422851890Sopenharmony_ci#define R200_EMIT_PP_TAM_DEBUG3                     50
8522851890Sopenharmony_ci#define R200_EMIT_PP_CNTL_X                         51
8622851890Sopenharmony_ci#define R200_EMIT_RB3D_DEPTHXY_OFFSET               52
8722851890Sopenharmony_ci#define R200_EMIT_RE_AUX_SCISSOR_CNTL               53
8822851890Sopenharmony_ci#define R200_EMIT_RE_SCISSOR_TL_0                   54
8922851890Sopenharmony_ci#define R200_EMIT_RE_SCISSOR_TL_1                   55
9022851890Sopenharmony_ci#define R200_EMIT_RE_SCISSOR_TL_2                   56
9122851890Sopenharmony_ci#define R200_EMIT_SE_VAP_CNTL_STATUS                57
9222851890Sopenharmony_ci#define R200_EMIT_SE_VTX_STATE_CNTL                 58
9322851890Sopenharmony_ci#define R200_EMIT_RE_POINTSIZE                      59
9422851890Sopenharmony_ci#define R200_EMIT_TCL_INPUT_VTX_VECTOR_ADDR_0       60
9522851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_FACES_0                  61
9622851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_OFFSETS_0                62
9722851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_FACES_1                  63
9822851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_OFFSETS_1                64
9922851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_FACES_2                  65
10022851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_OFFSETS_2                66
10122851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_FACES_3                  67
10222851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_OFFSETS_3                68
10322851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_FACES_4                  69
10422851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_OFFSETS_4                70
10522851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_FACES_5                  71
10622851890Sopenharmony_ci#define R200_EMIT_PP_CUBIC_OFFSETS_5                72
10722851890Sopenharmony_ci#define RADEON_EMIT_PP_TEX_SIZE_0                   73
10822851890Sopenharmony_ci#define RADEON_EMIT_PP_TEX_SIZE_1                   74
10922851890Sopenharmony_ci#define RADEON_EMIT_PP_TEX_SIZE_2                   75
11022851890Sopenharmony_ci#define R200_EMIT_RB3D_BLENDCOLOR                   76
11122851890Sopenharmony_ci#define R200_EMIT_TCL_POINT_SPRITE_CNTL             77
11222851890Sopenharmony_ci#define RADEON_EMIT_PP_CUBIC_FACES_0                78
11322851890Sopenharmony_ci#define RADEON_EMIT_PP_CUBIC_OFFSETS_T0             79
11422851890Sopenharmony_ci#define RADEON_EMIT_PP_CUBIC_FACES_1                80
11522851890Sopenharmony_ci#define RADEON_EMIT_PP_CUBIC_OFFSETS_T1             81
11622851890Sopenharmony_ci#define RADEON_EMIT_PP_CUBIC_FACES_2                82
11722851890Sopenharmony_ci#define RADEON_EMIT_PP_CUBIC_OFFSETS_T2             83
11822851890Sopenharmony_ci#define R200_EMIT_PP_TRI_PERF_CNTL                  84
11922851890Sopenharmony_ci#define R200_EMIT_PP_AFS_0                          85
12022851890Sopenharmony_ci#define R200_EMIT_PP_AFS_1                          86
12122851890Sopenharmony_ci#define R200_EMIT_ATF_TFACTOR                       87
12222851890Sopenharmony_ci#define R200_EMIT_PP_TXCTLALL_0                     88
12322851890Sopenharmony_ci#define R200_EMIT_PP_TXCTLALL_1                     89
12422851890Sopenharmony_ci#define R200_EMIT_PP_TXCTLALL_2                     90
12522851890Sopenharmony_ci#define R200_EMIT_PP_TXCTLALL_3                     91
12622851890Sopenharmony_ci#define R200_EMIT_PP_TXCTLALL_4                     92
12722851890Sopenharmony_ci#define R200_EMIT_PP_TXCTLALL_5                     93
12822851890Sopenharmony_ci#define R200_EMIT_VAP_PVS_CNTL                      94
12922851890Sopenharmony_ci#define RADEON_MAX_STATE_PACKETS                    95
13022851890Sopenharmony_ci#define RADEON_CMD_PACKET      1
13122851890Sopenharmony_ci#define RADEON_CMD_SCALARS     2
13222851890Sopenharmony_ci#define RADEON_CMD_VECTORS     3
13322851890Sopenharmony_ci#define RADEON_CMD_DMA_DISCARD 4
13422851890Sopenharmony_ci#define RADEON_CMD_PACKET3     5
13522851890Sopenharmony_ci#define RADEON_CMD_PACKET3_CLIP 6
13622851890Sopenharmony_ci#define RADEON_CMD_SCALARS2     7
13722851890Sopenharmony_ci#define RADEON_CMD_WAIT         8
13822851890Sopenharmony_ci#define RADEON_CMD_VECLINEAR	9
13922851890Sopenharmony_citypedef union {
14022851890Sopenharmony_ci	int i;
14122851890Sopenharmony_ci	struct {
14222851890Sopenharmony_ci		unsigned char cmd_type, pad0, pad1, pad2;
14322851890Sopenharmony_ci	} header;
14422851890Sopenharmony_ci	struct {
14522851890Sopenharmony_ci		unsigned char cmd_type, packet_id, pad0, pad1;
14622851890Sopenharmony_ci	} packet;
14722851890Sopenharmony_ci	struct {
14822851890Sopenharmony_ci		unsigned char cmd_type, offset, stride, count;
14922851890Sopenharmony_ci	} scalars;
15022851890Sopenharmony_ci	struct {
15122851890Sopenharmony_ci		unsigned char cmd_type, offset, stride, count;
15222851890Sopenharmony_ci	} vectors;
15322851890Sopenharmony_ci	struct {
15422851890Sopenharmony_ci		unsigned char cmd_type, addr_lo, addr_hi, count;
15522851890Sopenharmony_ci	} veclinear;
15622851890Sopenharmony_ci	struct {
15722851890Sopenharmony_ci		unsigned char cmd_type, buf_idx, pad0, pad1;
15822851890Sopenharmony_ci	} dma;
15922851890Sopenharmony_ci	struct {
16022851890Sopenharmony_ci		unsigned char cmd_type, flags, pad0, pad1;
16122851890Sopenharmony_ci	} wait;
16222851890Sopenharmony_ci} drm_radeon_cmd_header_t;
16322851890Sopenharmony_ci#define RADEON_WAIT_2D  0x1
16422851890Sopenharmony_ci#define RADEON_WAIT_3D  0x2
16522851890Sopenharmony_ci#define R300_CMD_PACKET3_CLEAR		0
16622851890Sopenharmony_ci#define R300_CMD_PACKET3_RAW		1
16722851890Sopenharmony_ci#define R300_CMD_PACKET0		1
16822851890Sopenharmony_ci#define R300_CMD_VPU			2
16922851890Sopenharmony_ci#define R300_CMD_PACKET3		3
17022851890Sopenharmony_ci#define R300_CMD_END3D			4
17122851890Sopenharmony_ci#define R300_CMD_CP_DELAY		5
17222851890Sopenharmony_ci#define R300_CMD_DMA_DISCARD		6
17322851890Sopenharmony_ci#define R300_CMD_WAIT			7
17422851890Sopenharmony_ci#	define R300_WAIT_2D		0x1
17522851890Sopenharmony_ci#	define R300_WAIT_3D		0x2
17622851890Sopenharmony_ci#	define R300_WAIT_2D_CLEAN	0x3
17722851890Sopenharmony_ci#	define R300_WAIT_3D_CLEAN	0x4
17822851890Sopenharmony_ci#	define R300_NEW_WAIT_2D_3D	0x3
17922851890Sopenharmony_ci#	define R300_NEW_WAIT_2D_2D_CLEAN	0x4
18022851890Sopenharmony_ci#	define R300_NEW_WAIT_3D_3D_CLEAN	0x6
18122851890Sopenharmony_ci#	define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN	0x8
18222851890Sopenharmony_ci#define R300_CMD_SCRATCH		8
18322851890Sopenharmony_ci#define R300_CMD_R500FP                 9
18422851890Sopenharmony_citypedef union {
18522851890Sopenharmony_ci	unsigned int u;
18622851890Sopenharmony_ci	struct {
18722851890Sopenharmony_ci		unsigned char cmd_type, pad0, pad1, pad2;
18822851890Sopenharmony_ci	} header;
18922851890Sopenharmony_ci	struct {
19022851890Sopenharmony_ci		unsigned char cmd_type, count, reglo, reghi;
19122851890Sopenharmony_ci	} packet0;
19222851890Sopenharmony_ci	struct {
19322851890Sopenharmony_ci		unsigned char cmd_type, count, adrlo, adrhi;
19422851890Sopenharmony_ci	} vpu;
19522851890Sopenharmony_ci	struct {
19622851890Sopenharmony_ci		unsigned char cmd_type, packet, pad0, pad1;
19722851890Sopenharmony_ci	} packet3;
19822851890Sopenharmony_ci	struct {
19922851890Sopenharmony_ci		unsigned char cmd_type, packet;
20022851890Sopenharmony_ci		unsigned short count;
20122851890Sopenharmony_ci	} delay;
20222851890Sopenharmony_ci	struct {
20322851890Sopenharmony_ci		unsigned char cmd_type, buf_idx, pad0, pad1;
20422851890Sopenharmony_ci	} dma;
20522851890Sopenharmony_ci	struct {
20622851890Sopenharmony_ci		unsigned char cmd_type, flags, pad0, pad1;
20722851890Sopenharmony_ci	} wait;
20822851890Sopenharmony_ci	struct {
20922851890Sopenharmony_ci		unsigned char cmd_type, reg, n_bufs, flags;
21022851890Sopenharmony_ci	} scratch;
21122851890Sopenharmony_ci	struct {
21222851890Sopenharmony_ci		unsigned char cmd_type, count, adrlo, adrhi_flags;
21322851890Sopenharmony_ci	} r500fp;
21422851890Sopenharmony_ci} drm_r300_cmd_header_t;
21522851890Sopenharmony_ci#define RADEON_FRONT			0x1
21622851890Sopenharmony_ci#define RADEON_BACK			0x2
21722851890Sopenharmony_ci#define RADEON_DEPTH			0x4
21822851890Sopenharmony_ci#define RADEON_STENCIL			0x8
21922851890Sopenharmony_ci#define RADEON_CLEAR_FASTZ		0x80000000
22022851890Sopenharmony_ci#define RADEON_USE_HIERZ		0x40000000
22122851890Sopenharmony_ci#define RADEON_USE_COMP_ZBUF		0x20000000
22222851890Sopenharmony_ci#define R500FP_CONSTANT_TYPE  (1 << 1)
22322851890Sopenharmony_ci#define R500FP_CONSTANT_CLAMP (1 << 2)
22422851890Sopenharmony_ci#define RADEON_POINTS			0x1
22522851890Sopenharmony_ci#define RADEON_LINES			0x2
22622851890Sopenharmony_ci#define RADEON_LINE_STRIP		0x3
22722851890Sopenharmony_ci#define RADEON_TRIANGLES		0x4
22822851890Sopenharmony_ci#define RADEON_TRIANGLE_FAN		0x5
22922851890Sopenharmony_ci#define RADEON_TRIANGLE_STRIP		0x6
23022851890Sopenharmony_ci#define RADEON_BUFFER_SIZE		65536
23122851890Sopenharmony_ci#define RADEON_INDEX_PRIM_OFFSET	20
23222851890Sopenharmony_ci#define RADEON_SCRATCH_REG_OFFSET	32
23322851890Sopenharmony_ci#define R600_SCRATCH_REG_OFFSET         256
23422851890Sopenharmony_ci#define RADEON_NR_SAREA_CLIPRECTS	12
23522851890Sopenharmony_ci#define RADEON_LOCAL_TEX_HEAP		0
23622851890Sopenharmony_ci#define RADEON_GART_TEX_HEAP		1
23722851890Sopenharmony_ci#define RADEON_NR_TEX_HEAPS		2
23822851890Sopenharmony_ci#define RADEON_NR_TEX_REGIONS		64
23922851890Sopenharmony_ci#define RADEON_LOG_TEX_GRANULARITY	16
24022851890Sopenharmony_ci#define RADEON_MAX_TEXTURE_LEVELS	12
24122851890Sopenharmony_ci#define RADEON_MAX_TEXTURE_UNITS	3
24222851890Sopenharmony_ci#define RADEON_MAX_SURFACES		8
24322851890Sopenharmony_ci#define RADEON_OFFSET_SHIFT             10
24422851890Sopenharmony_ci#define RADEON_OFFSET_ALIGN             (1 << RADEON_OFFSET_SHIFT)
24522851890Sopenharmony_ci#define RADEON_OFFSET_MASK              (RADEON_OFFSET_ALIGN - 1)
24622851890Sopenharmony_ci#endif
24722851890Sopenharmony_citypedef struct {
24822851890Sopenharmony_ci	unsigned int red;
24922851890Sopenharmony_ci	unsigned int green;
25022851890Sopenharmony_ci	unsigned int blue;
25122851890Sopenharmony_ci	unsigned int alpha;
25222851890Sopenharmony_ci} radeon_color_regs_t;
25322851890Sopenharmony_citypedef struct {
25422851890Sopenharmony_ci
25522851890Sopenharmony_ci	unsigned int pp_misc;
25622851890Sopenharmony_ci	unsigned int pp_fog_color;
25722851890Sopenharmony_ci	unsigned int re_solid_color;
25822851890Sopenharmony_ci	unsigned int rb3d_blendcntl;
25922851890Sopenharmony_ci	unsigned int rb3d_depthoffset;
26022851890Sopenharmony_ci	unsigned int rb3d_depthpitch;
26122851890Sopenharmony_ci	unsigned int rb3d_zstencilcntl;
26222851890Sopenharmony_ci	unsigned int pp_cntl;
26322851890Sopenharmony_ci	unsigned int rb3d_cntl;
26422851890Sopenharmony_ci	unsigned int rb3d_coloroffset;
26522851890Sopenharmony_ci	unsigned int re_width_height;
26622851890Sopenharmony_ci	unsigned int rb3d_colorpitch;
26722851890Sopenharmony_ci	unsigned int se_cntl;
26822851890Sopenharmony_ci
26922851890Sopenharmony_ci	unsigned int se_coord_fmt;
27022851890Sopenharmony_ci
27122851890Sopenharmony_ci	unsigned int re_line_pattern;
27222851890Sopenharmony_ci	unsigned int re_line_state;
27322851890Sopenharmony_ci	unsigned int se_line_width;
27422851890Sopenharmony_ci
27522851890Sopenharmony_ci	unsigned int pp_lum_matrix;
27622851890Sopenharmony_ci	unsigned int pp_rot_matrix_0;
27722851890Sopenharmony_ci	unsigned int pp_rot_matrix_1;
27822851890Sopenharmony_ci
27922851890Sopenharmony_ci	unsigned int rb3d_stencilrefmask;
28022851890Sopenharmony_ci	unsigned int rb3d_ropcntl;
28122851890Sopenharmony_ci	unsigned int rb3d_planemask;
28222851890Sopenharmony_ci
28322851890Sopenharmony_ci	unsigned int se_vport_xscale;
28422851890Sopenharmony_ci	unsigned int se_vport_xoffset;
28522851890Sopenharmony_ci	unsigned int se_vport_yscale;
28622851890Sopenharmony_ci	unsigned int se_vport_yoffset;
28722851890Sopenharmony_ci	unsigned int se_vport_zscale;
28822851890Sopenharmony_ci	unsigned int se_vport_zoffset;
28922851890Sopenharmony_ci
29022851890Sopenharmony_ci	unsigned int se_cntl_status;
29122851890Sopenharmony_ci
29222851890Sopenharmony_ci	unsigned int re_top_left;
29322851890Sopenharmony_ci	unsigned int re_misc;
29422851890Sopenharmony_ci} drm_radeon_context_regs_t;
29522851890Sopenharmony_citypedef struct {
29622851890Sopenharmony_ci
29722851890Sopenharmony_ci	unsigned int se_zbias_factor;
29822851890Sopenharmony_ci	unsigned int se_zbias_constant;
29922851890Sopenharmony_ci} drm_radeon_context2_regs_t;
30022851890Sopenharmony_citypedef struct {
30122851890Sopenharmony_ci	unsigned int pp_txfilter;
30222851890Sopenharmony_ci	unsigned int pp_txformat;
30322851890Sopenharmony_ci	unsigned int pp_txoffset;
30422851890Sopenharmony_ci	unsigned int pp_txcblend;
30522851890Sopenharmony_ci	unsigned int pp_txablend;
30622851890Sopenharmony_ci	unsigned int pp_tfactor;
30722851890Sopenharmony_ci	unsigned int pp_border_color;
30822851890Sopenharmony_ci} drm_radeon_texture_regs_t;
30922851890Sopenharmony_citypedef struct {
31022851890Sopenharmony_ci	unsigned int start;
31122851890Sopenharmony_ci	unsigned int finish;
31222851890Sopenharmony_ci	unsigned int prim:8;
31322851890Sopenharmony_ci	unsigned int stateidx:8;
31422851890Sopenharmony_ci	unsigned int numverts:16;
31522851890Sopenharmony_ci	unsigned int vc_format;
31622851890Sopenharmony_ci} drm_radeon_prim_t;
31722851890Sopenharmony_citypedef struct {
31822851890Sopenharmony_ci	drm_radeon_context_regs_t context;
31922851890Sopenharmony_ci	drm_radeon_texture_regs_t tex[RADEON_MAX_TEXTURE_UNITS];
32022851890Sopenharmony_ci	drm_radeon_context2_regs_t context2;
32122851890Sopenharmony_ci	unsigned int dirty;
32222851890Sopenharmony_ci} drm_radeon_state_t;
32322851890Sopenharmony_citypedef struct {
32422851890Sopenharmony_ci
32522851890Sopenharmony_ci	drm_radeon_context_regs_t context_state;
32622851890Sopenharmony_ci	drm_radeon_texture_regs_t tex_state[RADEON_MAX_TEXTURE_UNITS];
32722851890Sopenharmony_ci	unsigned int dirty;
32822851890Sopenharmony_ci	unsigned int vertsize;
32922851890Sopenharmony_ci	unsigned int vc_format;
33022851890Sopenharmony_ci
33122851890Sopenharmony_ci	struct drm_clip_rect boxes[RADEON_NR_SAREA_CLIPRECTS];
33222851890Sopenharmony_ci	unsigned int nbox;
33322851890Sopenharmony_ci
33422851890Sopenharmony_ci	unsigned int last_frame;
33522851890Sopenharmony_ci	unsigned int last_dispatch;
33622851890Sopenharmony_ci	unsigned int last_clear;
33722851890Sopenharmony_ci	struct drm_tex_region tex_list[RADEON_NR_TEX_HEAPS][RADEON_NR_TEX_REGIONS +
33822851890Sopenharmony_ci						       1];
33922851890Sopenharmony_ci	unsigned int tex_age[RADEON_NR_TEX_HEAPS];
34022851890Sopenharmony_ci	int ctx_owner;
34122851890Sopenharmony_ci	int pfState;
34222851890Sopenharmony_ci	int pfCurrentPage;
34322851890Sopenharmony_ci	int crtc2_base;
34422851890Sopenharmony_ci	int tiling_enabled;
34522851890Sopenharmony_ci} drm_radeon_sarea_t;
34622851890Sopenharmony_ci#define DRM_RADEON_CP_INIT    0x00
34722851890Sopenharmony_ci#define DRM_RADEON_CP_START   0x01
34822851890Sopenharmony_ci#define DRM_RADEON_CP_STOP    0x02
34922851890Sopenharmony_ci#define DRM_RADEON_CP_RESET   0x03
35022851890Sopenharmony_ci#define DRM_RADEON_CP_IDLE    0x04
35122851890Sopenharmony_ci#define DRM_RADEON_RESET      0x05
35222851890Sopenharmony_ci#define DRM_RADEON_FULLSCREEN 0x06
35322851890Sopenharmony_ci#define DRM_RADEON_SWAP       0x07
35422851890Sopenharmony_ci#define DRM_RADEON_CLEAR      0x08
35522851890Sopenharmony_ci#define DRM_RADEON_VERTEX     0x09
35622851890Sopenharmony_ci#define DRM_RADEON_INDICES    0x0A
35722851890Sopenharmony_ci#define DRM_RADEON_NOT_USED
35822851890Sopenharmony_ci#define DRM_RADEON_STIPPLE    0x0C
35922851890Sopenharmony_ci#define DRM_RADEON_INDIRECT   0x0D
36022851890Sopenharmony_ci#define DRM_RADEON_TEXTURE    0x0E
36122851890Sopenharmony_ci#define DRM_RADEON_VERTEX2    0x0F
36222851890Sopenharmony_ci#define DRM_RADEON_CMDBUF     0x10
36322851890Sopenharmony_ci#define DRM_RADEON_GETPARAM   0x11
36422851890Sopenharmony_ci#define DRM_RADEON_FLIP       0x12
36522851890Sopenharmony_ci#define DRM_RADEON_ALLOC      0x13
36622851890Sopenharmony_ci#define DRM_RADEON_FREE       0x14
36722851890Sopenharmony_ci#define DRM_RADEON_INIT_HEAP  0x15
36822851890Sopenharmony_ci#define DRM_RADEON_IRQ_EMIT   0x16
36922851890Sopenharmony_ci#define DRM_RADEON_IRQ_WAIT   0x17
37022851890Sopenharmony_ci#define DRM_RADEON_CP_RESUME  0x18
37122851890Sopenharmony_ci#define DRM_RADEON_SETPARAM   0x19
37222851890Sopenharmony_ci#define DRM_RADEON_SURF_ALLOC 0x1a
37322851890Sopenharmony_ci#define DRM_RADEON_SURF_FREE  0x1b
37422851890Sopenharmony_ci#define DRM_RADEON_GEM_INFO		0x1c
37522851890Sopenharmony_ci#define DRM_RADEON_GEM_CREATE		0x1d
37622851890Sopenharmony_ci#define DRM_RADEON_GEM_MMAP		0x1e
37722851890Sopenharmony_ci#define DRM_RADEON_GEM_PREAD		0x21
37822851890Sopenharmony_ci#define DRM_RADEON_GEM_PWRITE		0x22
37922851890Sopenharmony_ci#define DRM_RADEON_GEM_SET_DOMAIN	0x23
38022851890Sopenharmony_ci#define DRM_RADEON_GEM_WAIT_IDLE	0x24
38122851890Sopenharmony_ci#define DRM_RADEON_CS			0x26
38222851890Sopenharmony_ci#define DRM_RADEON_INFO			0x27
38322851890Sopenharmony_ci#define DRM_RADEON_GEM_SET_TILING	0x28
38422851890Sopenharmony_ci#define DRM_RADEON_GEM_GET_TILING	0x29
38522851890Sopenharmony_ci#define DRM_RADEON_GEM_BUSY		0x2a
38622851890Sopenharmony_ci#define DRM_RADEON_GEM_VA		0x2b
38722851890Sopenharmony_ci#define DRM_RADEON_GEM_OP		0x2c
38822851890Sopenharmony_ci#define DRM_RADEON_GEM_USERPTR		0x2d
38922851890Sopenharmony_ci#define DRM_IOCTL_RADEON_CP_INIT    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_INIT, drm_radeon_init_t)
39022851890Sopenharmony_ci#define DRM_IOCTL_RADEON_CP_START   DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_CP_START)
39122851890Sopenharmony_ci#define DRM_IOCTL_RADEON_CP_STOP    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CP_STOP, drm_radeon_cp_stop_t)
39222851890Sopenharmony_ci#define DRM_IOCTL_RADEON_CP_RESET   DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_CP_RESET)
39322851890Sopenharmony_ci#define DRM_IOCTL_RADEON_CP_IDLE    DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_CP_IDLE)
39422851890Sopenharmony_ci#define DRM_IOCTL_RADEON_RESET      DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_RESET)
39522851890Sopenharmony_ci#define DRM_IOCTL_RADEON_FULLSCREEN DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FULLSCREEN, drm_radeon_fullscreen_t)
39622851890Sopenharmony_ci#define DRM_IOCTL_RADEON_SWAP       DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_SWAP)
39722851890Sopenharmony_ci#define DRM_IOCTL_RADEON_CLEAR      DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CLEAR, drm_radeon_clear_t)
39822851890Sopenharmony_ci#define DRM_IOCTL_RADEON_VERTEX     DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX, drm_radeon_vertex_t)
39922851890Sopenharmony_ci#define DRM_IOCTL_RADEON_INDICES    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INDICES, drm_radeon_indices_t)
40022851890Sopenharmony_ci#define DRM_IOCTL_RADEON_STIPPLE    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_STIPPLE, drm_radeon_stipple_t)
40122851890Sopenharmony_ci#define DRM_IOCTL_RADEON_INDIRECT   DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INDIRECT, drm_radeon_indirect_t)
40222851890Sopenharmony_ci#define DRM_IOCTL_RADEON_TEXTURE    DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_TEXTURE, drm_radeon_texture_t)
40322851890Sopenharmony_ci#define DRM_IOCTL_RADEON_VERTEX2    DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_VERTEX2, drm_radeon_vertex2_t)
40422851890Sopenharmony_ci#define DRM_IOCTL_RADEON_CMDBUF     DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_CMDBUF, drm_radeon_cmd_buffer_t)
40522851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GETPARAM   DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GETPARAM, drm_radeon_getparam_t)
40622851890Sopenharmony_ci#define DRM_IOCTL_RADEON_FLIP       DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_FLIP)
40722851890Sopenharmony_ci#define DRM_IOCTL_RADEON_ALLOC      DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_ALLOC, drm_radeon_mem_alloc_t)
40822851890Sopenharmony_ci#define DRM_IOCTL_RADEON_FREE       DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_FREE, drm_radeon_mem_free_t)
40922851890Sopenharmony_ci#define DRM_IOCTL_RADEON_INIT_HEAP  DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_INIT_HEAP, drm_radeon_mem_init_heap_t)
41022851890Sopenharmony_ci#define DRM_IOCTL_RADEON_IRQ_EMIT   DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_IRQ_EMIT, drm_radeon_irq_emit_t)
41122851890Sopenharmony_ci#define DRM_IOCTL_RADEON_IRQ_WAIT   DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_IRQ_WAIT, drm_radeon_irq_wait_t)
41222851890Sopenharmony_ci#define DRM_IOCTL_RADEON_CP_RESUME  DRM_IO(  DRM_COMMAND_BASE + DRM_RADEON_CP_RESUME)
41322851890Sopenharmony_ci#define DRM_IOCTL_RADEON_SETPARAM   DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SETPARAM, drm_radeon_setparam_t)
41422851890Sopenharmony_ci#define DRM_IOCTL_RADEON_SURF_ALLOC DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_ALLOC, drm_radeon_surface_alloc_t)
41522851890Sopenharmony_ci#define DRM_IOCTL_RADEON_SURF_FREE  DRM_IOW( DRM_COMMAND_BASE + DRM_RADEON_SURF_FREE, drm_radeon_surface_free_t)
41622851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_INFO	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_INFO, struct drm_radeon_gem_info)
41722851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_CREATE	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_CREATE, struct drm_radeon_gem_create)
41822851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_MMAP	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_MMAP, struct drm_radeon_gem_mmap)
41922851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_PREAD	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PREAD, struct drm_radeon_gem_pread)
42022851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_PWRITE	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_PWRITE, struct drm_radeon_gem_pwrite)
42122851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_SET_DOMAIN	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_DOMAIN, struct drm_radeon_gem_set_domain)
42222851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_WAIT_IDLE	DRM_IOW(DRM_COMMAND_BASE + DRM_RADEON_GEM_WAIT_IDLE, struct drm_radeon_gem_wait_idle)
42322851890Sopenharmony_ci#define DRM_IOCTL_RADEON_CS		DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_CS, struct drm_radeon_cs)
42422851890Sopenharmony_ci#define DRM_IOCTL_RADEON_INFO		DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_INFO, struct drm_radeon_info)
42522851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_SET_TILING	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_SET_TILING, struct drm_radeon_gem_set_tiling)
42622851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_GET_TILING	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_GET_TILING, struct drm_radeon_gem_get_tiling)
42722851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_BUSY	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_BUSY, struct drm_radeon_gem_busy)
42822851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_VA		DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_VA, struct drm_radeon_gem_va)
42922851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_OP		DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_OP, struct drm_radeon_gem_op)
43022851890Sopenharmony_ci#define DRM_IOCTL_RADEON_GEM_USERPTR	DRM_IOWR(DRM_COMMAND_BASE + DRM_RADEON_GEM_USERPTR, struct drm_radeon_gem_userptr)
43122851890Sopenharmony_citypedef struct drm_radeon_init {
43222851890Sopenharmony_ci	enum {
43322851890Sopenharmony_ci		RADEON_INIT_CP = 0x01,
43422851890Sopenharmony_ci		RADEON_CLEANUP_CP = 0x02,
43522851890Sopenharmony_ci		RADEON_INIT_R200_CP = 0x03,
43622851890Sopenharmony_ci		RADEON_INIT_R300_CP = 0x04,
43722851890Sopenharmony_ci		RADEON_INIT_R600_CP = 0x05
43822851890Sopenharmony_ci	} func;
43922851890Sopenharmony_ci	unsigned long sarea_priv_offset;
44022851890Sopenharmony_ci	int is_pci;
44122851890Sopenharmony_ci	int cp_mode;
44222851890Sopenharmony_ci	int gart_size;
44322851890Sopenharmony_ci	int ring_size;
44422851890Sopenharmony_ci	int usec_timeout;
44522851890Sopenharmony_ci	unsigned int fb_bpp;
44622851890Sopenharmony_ci	unsigned int front_offset, front_pitch;
44722851890Sopenharmony_ci	unsigned int back_offset, back_pitch;
44822851890Sopenharmony_ci	unsigned int depth_bpp;
44922851890Sopenharmony_ci	unsigned int depth_offset, depth_pitch;
45022851890Sopenharmony_ci	unsigned long fb_offset;
45122851890Sopenharmony_ci	unsigned long mmio_offset;
45222851890Sopenharmony_ci	unsigned long ring_offset;
45322851890Sopenharmony_ci	unsigned long ring_rptr_offset;
45422851890Sopenharmony_ci	unsigned long buffers_offset;
45522851890Sopenharmony_ci	unsigned long gart_textures_offset;
45622851890Sopenharmony_ci} drm_radeon_init_t;
45722851890Sopenharmony_citypedef struct drm_radeon_cp_stop {
45822851890Sopenharmony_ci	int flush;
45922851890Sopenharmony_ci	int idle;
46022851890Sopenharmony_ci} drm_radeon_cp_stop_t;
46122851890Sopenharmony_citypedef struct drm_radeon_fullscreen {
46222851890Sopenharmony_ci	enum {
46322851890Sopenharmony_ci		RADEON_INIT_FULLSCREEN = 0x01,
46422851890Sopenharmony_ci		RADEON_CLEANUP_FULLSCREEN = 0x02
46522851890Sopenharmony_ci	} func;
46622851890Sopenharmony_ci} drm_radeon_fullscreen_t;
46722851890Sopenharmony_ci#define CLEAR_X1	0
46822851890Sopenharmony_ci#define CLEAR_Y1	1
46922851890Sopenharmony_ci#define CLEAR_X2	2
47022851890Sopenharmony_ci#define CLEAR_Y2	3
47122851890Sopenharmony_ci#define CLEAR_DEPTH	4
47222851890Sopenharmony_citypedef union drm_radeon_clear_rect {
47322851890Sopenharmony_ci	float f[5];
47422851890Sopenharmony_ci	unsigned int ui[5];
47522851890Sopenharmony_ci} drm_radeon_clear_rect_t;
47622851890Sopenharmony_citypedef struct drm_radeon_clear {
47722851890Sopenharmony_ci	unsigned int flags;
47822851890Sopenharmony_ci	unsigned int clear_color;
47922851890Sopenharmony_ci	unsigned int clear_depth;
48022851890Sopenharmony_ci	unsigned int color_mask;
48122851890Sopenharmony_ci	unsigned int depth_mask;
48222851890Sopenharmony_ci	drm_radeon_clear_rect_t __user *depth_boxes;
48322851890Sopenharmony_ci} drm_radeon_clear_t;
48422851890Sopenharmony_citypedef struct drm_radeon_vertex {
48522851890Sopenharmony_ci	int prim;
48622851890Sopenharmony_ci	int idx;
48722851890Sopenharmony_ci	int count;
48822851890Sopenharmony_ci	int discard;
48922851890Sopenharmony_ci} drm_radeon_vertex_t;
49022851890Sopenharmony_citypedef struct drm_radeon_indices {
49122851890Sopenharmony_ci	int prim;
49222851890Sopenharmony_ci	int idx;
49322851890Sopenharmony_ci	int start;
49422851890Sopenharmony_ci	int end;
49522851890Sopenharmony_ci	int discard;
49622851890Sopenharmony_ci} drm_radeon_indices_t;
49722851890Sopenharmony_citypedef struct drm_radeon_vertex2 {
49822851890Sopenharmony_ci	int idx;
49922851890Sopenharmony_ci	int discard;
50022851890Sopenharmony_ci	int nr_states;
50122851890Sopenharmony_ci	drm_radeon_state_t __user *state;
50222851890Sopenharmony_ci	int nr_prims;
50322851890Sopenharmony_ci	drm_radeon_prim_t __user *prim;
50422851890Sopenharmony_ci} drm_radeon_vertex2_t;
50522851890Sopenharmony_citypedef struct drm_radeon_cmd_buffer {
50622851890Sopenharmony_ci	int bufsz;
50722851890Sopenharmony_ci	char __user *buf;
50822851890Sopenharmony_ci	int nbox;
50922851890Sopenharmony_ci	struct drm_clip_rect __user *boxes;
51022851890Sopenharmony_ci} drm_radeon_cmd_buffer_t;
51122851890Sopenharmony_citypedef struct drm_radeon_tex_image {
51222851890Sopenharmony_ci	unsigned int x, y;
51322851890Sopenharmony_ci	unsigned int width, height;
51422851890Sopenharmony_ci	const void __user *data;
51522851890Sopenharmony_ci} drm_radeon_tex_image_t;
51622851890Sopenharmony_citypedef struct drm_radeon_texture {
51722851890Sopenharmony_ci	unsigned int offset;
51822851890Sopenharmony_ci	int pitch;
51922851890Sopenharmony_ci	int format;
52022851890Sopenharmony_ci	int width;
52122851890Sopenharmony_ci	int height;
52222851890Sopenharmony_ci	drm_radeon_tex_image_t __user *image;
52322851890Sopenharmony_ci} drm_radeon_texture_t;
52422851890Sopenharmony_citypedef struct drm_radeon_stipple {
52522851890Sopenharmony_ci	unsigned int __user *mask;
52622851890Sopenharmony_ci} drm_radeon_stipple_t;
52722851890Sopenharmony_citypedef struct drm_radeon_indirect {
52822851890Sopenharmony_ci	int idx;
52922851890Sopenharmony_ci	int start;
53022851890Sopenharmony_ci	int end;
53122851890Sopenharmony_ci	int discard;
53222851890Sopenharmony_ci} drm_radeon_indirect_t;
53322851890Sopenharmony_ci#define RADEON_CARD_PCI 0
53422851890Sopenharmony_ci#define RADEON_CARD_AGP 1
53522851890Sopenharmony_ci#define RADEON_CARD_PCIE 2
53622851890Sopenharmony_ci#define RADEON_PARAM_GART_BUFFER_OFFSET    1
53722851890Sopenharmony_ci#define RADEON_PARAM_LAST_FRAME            2
53822851890Sopenharmony_ci#define RADEON_PARAM_LAST_DISPATCH         3
53922851890Sopenharmony_ci#define RADEON_PARAM_LAST_CLEAR            4
54022851890Sopenharmony_ci#define RADEON_PARAM_IRQ_NR                5
54122851890Sopenharmony_ci#define RADEON_PARAM_GART_BASE             6
54222851890Sopenharmony_ci#define RADEON_PARAM_REGISTER_HANDLE       7
54322851890Sopenharmony_ci#define RADEON_PARAM_STATUS_HANDLE         8
54422851890Sopenharmony_ci#define RADEON_PARAM_SAREA_HANDLE          9
54522851890Sopenharmony_ci#define RADEON_PARAM_GART_TEX_HANDLE       10
54622851890Sopenharmony_ci#define RADEON_PARAM_SCRATCH_OFFSET        11
54722851890Sopenharmony_ci#define RADEON_PARAM_CARD_TYPE             12
54822851890Sopenharmony_ci#define RADEON_PARAM_VBLANK_CRTC           13
54922851890Sopenharmony_ci#define RADEON_PARAM_FB_LOCATION           14
55022851890Sopenharmony_ci#define RADEON_PARAM_NUM_GB_PIPES          15
55122851890Sopenharmony_ci#define RADEON_PARAM_DEVICE_ID             16
55222851890Sopenharmony_ci#define RADEON_PARAM_NUM_Z_PIPES           17
55322851890Sopenharmony_citypedef struct drm_radeon_getparam {
55422851890Sopenharmony_ci	int param;
55522851890Sopenharmony_ci	void __user *value;
55622851890Sopenharmony_ci} drm_radeon_getparam_t;
55722851890Sopenharmony_ci#define RADEON_MEM_REGION_GART 1
55822851890Sopenharmony_ci#define RADEON_MEM_REGION_FB   2
55922851890Sopenharmony_citypedef struct drm_radeon_mem_alloc {
56022851890Sopenharmony_ci	int region;
56122851890Sopenharmony_ci	int alignment;
56222851890Sopenharmony_ci	int size;
56322851890Sopenharmony_ci	int __user *region_offset;
56422851890Sopenharmony_ci} drm_radeon_mem_alloc_t;
56522851890Sopenharmony_citypedef struct drm_radeon_mem_free {
56622851890Sopenharmony_ci	int region;
56722851890Sopenharmony_ci	int region_offset;
56822851890Sopenharmony_ci} drm_radeon_mem_free_t;
56922851890Sopenharmony_citypedef struct drm_radeon_mem_init_heap {
57022851890Sopenharmony_ci	int region;
57122851890Sopenharmony_ci	int size;
57222851890Sopenharmony_ci	int start;
57322851890Sopenharmony_ci} drm_radeon_mem_init_heap_t;
57422851890Sopenharmony_citypedef struct drm_radeon_irq_emit {
57522851890Sopenharmony_ci	int __user *irq_seq;
57622851890Sopenharmony_ci} drm_radeon_irq_emit_t;
57722851890Sopenharmony_citypedef struct drm_radeon_irq_wait {
57822851890Sopenharmony_ci	int irq_seq;
57922851890Sopenharmony_ci} drm_radeon_irq_wait_t;
58022851890Sopenharmony_citypedef struct drm_radeon_setparam {
58122851890Sopenharmony_ci	unsigned int param;
58222851890Sopenharmony_ci	__s64 value;
58322851890Sopenharmony_ci} drm_radeon_setparam_t;
58422851890Sopenharmony_ci#define RADEON_SETPARAM_FB_LOCATION    1
58522851890Sopenharmony_ci#define RADEON_SETPARAM_SWITCH_TILING  2
58622851890Sopenharmony_ci#define RADEON_SETPARAM_PCIGART_LOCATION 3
58722851890Sopenharmony_ci#define RADEON_SETPARAM_NEW_MEMMAP 4
58822851890Sopenharmony_ci#define RADEON_SETPARAM_PCIGART_TABLE_SIZE 5
58922851890Sopenharmony_ci#define RADEON_SETPARAM_VBLANK_CRTC 6
59022851890Sopenharmony_citypedef struct drm_radeon_surface_alloc {
59122851890Sopenharmony_ci	unsigned int address;
59222851890Sopenharmony_ci	unsigned int size;
59322851890Sopenharmony_ci	unsigned int flags;
59422851890Sopenharmony_ci} drm_radeon_surface_alloc_t;
59522851890Sopenharmony_citypedef struct drm_radeon_surface_free {
59622851890Sopenharmony_ci	unsigned int address;
59722851890Sopenharmony_ci} drm_radeon_surface_free_t;
59822851890Sopenharmony_ci#define	DRM_RADEON_VBLANK_CRTC1		1
59922851890Sopenharmony_ci#define	DRM_RADEON_VBLANK_CRTC2		2
60022851890Sopenharmony_ci#define RADEON_GEM_DOMAIN_CPU		0x1
60122851890Sopenharmony_ci#define RADEON_GEM_DOMAIN_GTT		0x2
60222851890Sopenharmony_ci#define RADEON_GEM_DOMAIN_VRAM		0x4
60322851890Sopenharmony_cistruct drm_radeon_gem_info {
60422851890Sopenharmony_ci	__u64	gart_size;
60522851890Sopenharmony_ci	__u64	vram_size;
60622851890Sopenharmony_ci	__u64	vram_visible;
60722851890Sopenharmony_ci};
60822851890Sopenharmony_ci#define RADEON_GEM_NO_BACKING_STORE	(1 << 0)
60922851890Sopenharmony_ci#define RADEON_GEM_GTT_UC		(1 << 1)
61022851890Sopenharmony_ci#define RADEON_GEM_GTT_WC		(1 << 2)
61122851890Sopenharmony_ci#define RADEON_GEM_CPU_ACCESS		(1 << 3)
61222851890Sopenharmony_ci#define RADEON_GEM_NO_CPU_ACCESS	(1 << 4)
61322851890Sopenharmony_cistruct drm_radeon_gem_create {
61422851890Sopenharmony_ci	__u64	size;
61522851890Sopenharmony_ci	__u64	alignment;
61622851890Sopenharmony_ci	__u32	handle;
61722851890Sopenharmony_ci	__u32	initial_domain;
61822851890Sopenharmony_ci	__u32	flags;
61922851890Sopenharmony_ci};
62022851890Sopenharmony_ci#define RADEON_GEM_USERPTR_READONLY	(1 << 0)
62122851890Sopenharmony_ci#define RADEON_GEM_USERPTR_ANONONLY	(1 << 1)
62222851890Sopenharmony_ci#define RADEON_GEM_USERPTR_VALIDATE	(1 << 2)
62322851890Sopenharmony_ci#define RADEON_GEM_USERPTR_REGISTER	(1 << 3)
62422851890Sopenharmony_cistruct drm_radeon_gem_userptr {
62522851890Sopenharmony_ci	__u64		addr;
62622851890Sopenharmony_ci	__u64		size;
62722851890Sopenharmony_ci	__u32		flags;
62822851890Sopenharmony_ci	__u32		handle;
62922851890Sopenharmony_ci};
63022851890Sopenharmony_ci#define RADEON_TILING_MACRO				0x1
63122851890Sopenharmony_ci#define RADEON_TILING_MICRO				0x2
63222851890Sopenharmony_ci#define RADEON_TILING_SWAP_16BIT			0x4
63322851890Sopenharmony_ci#define RADEON_TILING_SWAP_32BIT			0x8
63422851890Sopenharmony_ci#define RADEON_TILING_SURFACE				0x10
63522851890Sopenharmony_ci#define RADEON_TILING_MICRO_SQUARE			0x20
63622851890Sopenharmony_ci#define RADEON_TILING_EG_BANKW_SHIFT			8
63722851890Sopenharmony_ci#define RADEON_TILING_EG_BANKW_MASK			0xf
63822851890Sopenharmony_ci#define RADEON_TILING_EG_BANKH_SHIFT			12
63922851890Sopenharmony_ci#define RADEON_TILING_EG_BANKH_MASK			0xf
64022851890Sopenharmony_ci#define RADEON_TILING_EG_MACRO_TILE_ASPECT_SHIFT	16
64122851890Sopenharmony_ci#define RADEON_TILING_EG_MACRO_TILE_ASPECT_MASK		0xf
64222851890Sopenharmony_ci#define RADEON_TILING_EG_TILE_SPLIT_SHIFT		24
64322851890Sopenharmony_ci#define RADEON_TILING_EG_TILE_SPLIT_MASK		0xf
64422851890Sopenharmony_ci#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_SHIFT	28
64522851890Sopenharmony_ci#define RADEON_TILING_EG_STENCIL_TILE_SPLIT_MASK	0xf
64622851890Sopenharmony_cistruct drm_radeon_gem_set_tiling {
64722851890Sopenharmony_ci	__u32	handle;
64822851890Sopenharmony_ci	__u32	tiling_flags;
64922851890Sopenharmony_ci	__u32	pitch;
65022851890Sopenharmony_ci};
65122851890Sopenharmony_cistruct drm_radeon_gem_get_tiling {
65222851890Sopenharmony_ci	__u32	handle;
65322851890Sopenharmony_ci	__u32	tiling_flags;
65422851890Sopenharmony_ci	__u32	pitch;
65522851890Sopenharmony_ci};
65622851890Sopenharmony_cistruct drm_radeon_gem_mmap {
65722851890Sopenharmony_ci	__u32	handle;
65822851890Sopenharmony_ci	__u32	pad;
65922851890Sopenharmony_ci	__u64	offset;
66022851890Sopenharmony_ci	__u64	size;
66122851890Sopenharmony_ci	__u64	addr_ptr;
66222851890Sopenharmony_ci};
66322851890Sopenharmony_cistruct drm_radeon_gem_set_domain {
66422851890Sopenharmony_ci	__u32	handle;
66522851890Sopenharmony_ci	__u32	read_domains;
66622851890Sopenharmony_ci	__u32	write_domain;
66722851890Sopenharmony_ci};
66822851890Sopenharmony_cistruct drm_radeon_gem_wait_idle {
66922851890Sopenharmony_ci	__u32	handle;
67022851890Sopenharmony_ci	__u32	pad;
67122851890Sopenharmony_ci};
67222851890Sopenharmony_cistruct drm_radeon_gem_busy {
67322851890Sopenharmony_ci	__u32	handle;
67422851890Sopenharmony_ci	__u32        domain;
67522851890Sopenharmony_ci};
67622851890Sopenharmony_cistruct drm_radeon_gem_pread {
67722851890Sopenharmony_ci
67822851890Sopenharmony_ci	__u32 handle;
67922851890Sopenharmony_ci	__u32 pad;
68022851890Sopenharmony_ci
68122851890Sopenharmony_ci	__u64 offset;
68222851890Sopenharmony_ci
68322851890Sopenharmony_ci	__u64 size;
68422851890Sopenharmony_ci
68522851890Sopenharmony_ci
68622851890Sopenharmony_ci	__u64 data_ptr;
68722851890Sopenharmony_ci};
68822851890Sopenharmony_cistruct drm_radeon_gem_pwrite {
68922851890Sopenharmony_ci
69022851890Sopenharmony_ci	__u32 handle;
69122851890Sopenharmony_ci	__u32 pad;
69222851890Sopenharmony_ci
69322851890Sopenharmony_ci	__u64 offset;
69422851890Sopenharmony_ci
69522851890Sopenharmony_ci	__u64 size;
69622851890Sopenharmony_ci
69722851890Sopenharmony_ci
69822851890Sopenharmony_ci	__u64 data_ptr;
69922851890Sopenharmony_ci};
70022851890Sopenharmony_cistruct drm_radeon_gem_op {
70122851890Sopenharmony_ci	__u32	handle;
70222851890Sopenharmony_ci	__u32	op;
70322851890Sopenharmony_ci	__u64	value;
70422851890Sopenharmony_ci};
70522851890Sopenharmony_ci#define RADEON_GEM_OP_GET_INITIAL_DOMAIN	0
70622851890Sopenharmony_ci#define RADEON_GEM_OP_SET_INITIAL_DOMAIN	1
70722851890Sopenharmony_ci#define RADEON_VA_MAP			1
70822851890Sopenharmony_ci#define RADEON_VA_UNMAP			2
70922851890Sopenharmony_ci#define RADEON_VA_RESULT_OK		0
71022851890Sopenharmony_ci#define RADEON_VA_RESULT_ERROR		1
71122851890Sopenharmony_ci#define RADEON_VA_RESULT_VA_EXIST	2
71222851890Sopenharmony_ci#define RADEON_VM_PAGE_VALID		(1 << 0)
71322851890Sopenharmony_ci#define RADEON_VM_PAGE_READABLE		(1 << 1)
71422851890Sopenharmony_ci#define RADEON_VM_PAGE_WRITEABLE	(1 << 2)
71522851890Sopenharmony_ci#define RADEON_VM_PAGE_SYSTEM		(1 << 3)
71622851890Sopenharmony_ci#define RADEON_VM_PAGE_SNOOPED		(1 << 4)
71722851890Sopenharmony_cistruct drm_radeon_gem_va {
71822851890Sopenharmony_ci	__u32		handle;
71922851890Sopenharmony_ci	__u32		operation;
72022851890Sopenharmony_ci	__u32		vm_id;
72122851890Sopenharmony_ci	__u32		flags;
72222851890Sopenharmony_ci	__u64		offset;
72322851890Sopenharmony_ci};
72422851890Sopenharmony_ci#define RADEON_CHUNK_ID_RELOCS	0x01
72522851890Sopenharmony_ci#define RADEON_CHUNK_ID_IB	0x02
72622851890Sopenharmony_ci#define RADEON_CHUNK_ID_FLAGS	0x03
72722851890Sopenharmony_ci#define RADEON_CHUNK_ID_CONST_IB	0x04
72822851890Sopenharmony_ci#define RADEON_CS_KEEP_TILING_FLAGS 0x01
72922851890Sopenharmony_ci#define RADEON_CS_USE_VM            0x02
73022851890Sopenharmony_ci#define RADEON_CS_END_OF_FRAME      0x04
73122851890Sopenharmony_ci#define RADEON_CS_RING_GFX          0
73222851890Sopenharmony_ci#define RADEON_CS_RING_COMPUTE      1
73322851890Sopenharmony_ci#define RADEON_CS_RING_DMA          2
73422851890Sopenharmony_ci#define RADEON_CS_RING_UVD          3
73522851890Sopenharmony_ci#define RADEON_CS_RING_VCE          4
73622851890Sopenharmony_cistruct drm_radeon_cs_chunk {
73722851890Sopenharmony_ci	__u32		chunk_id;
73822851890Sopenharmony_ci	__u32		length_dw;
73922851890Sopenharmony_ci	__u64		chunk_data;
74022851890Sopenharmony_ci};
74122851890Sopenharmony_ci#define RADEON_RELOC_PRIO_MASK		(0xf << 0)
74222851890Sopenharmony_cistruct drm_radeon_cs_reloc {
74322851890Sopenharmony_ci	__u32		handle;
74422851890Sopenharmony_ci	__u32		read_domains;
74522851890Sopenharmony_ci	__u32		write_domain;
74622851890Sopenharmony_ci	__u32		flags;
74722851890Sopenharmony_ci};
74822851890Sopenharmony_cistruct drm_radeon_cs {
74922851890Sopenharmony_ci	__u32		num_chunks;
75022851890Sopenharmony_ci	__u32		cs_id;
75122851890Sopenharmony_ci
75222851890Sopenharmony_ci	__u64		chunks;
75322851890Sopenharmony_ci
75422851890Sopenharmony_ci	__u64		gart_limit;
75522851890Sopenharmony_ci	__u64		vram_limit;
75622851890Sopenharmony_ci};
75722851890Sopenharmony_ci#define RADEON_INFO_DEVICE_ID		0x00
75822851890Sopenharmony_ci#define RADEON_INFO_NUM_GB_PIPES	0x01
75922851890Sopenharmony_ci#define RADEON_INFO_NUM_Z_PIPES 	0x02
76022851890Sopenharmony_ci#define RADEON_INFO_ACCEL_WORKING	0x03
76122851890Sopenharmony_ci#define RADEON_INFO_CRTC_FROM_ID	0x04
76222851890Sopenharmony_ci#define RADEON_INFO_ACCEL_WORKING2	0x05
76322851890Sopenharmony_ci#define RADEON_INFO_TILING_CONFIG	0x06
76422851890Sopenharmony_ci#define RADEON_INFO_WANT_HYPERZ		0x07
76522851890Sopenharmony_ci#define RADEON_INFO_WANT_CMASK		0x08
76622851890Sopenharmony_ci#define RADEON_INFO_CLOCK_CRYSTAL_FREQ	0x09
76722851890Sopenharmony_ci#define RADEON_INFO_NUM_BACKENDS	0x0a
76822851890Sopenharmony_ci#define RADEON_INFO_NUM_TILE_PIPES	0x0b
76922851890Sopenharmony_ci#define RADEON_INFO_FUSION_GART_WORKING	0x0c
77022851890Sopenharmony_ci#define RADEON_INFO_BACKEND_MAP		0x0d
77122851890Sopenharmony_ci#define RADEON_INFO_VA_START		0x0e
77222851890Sopenharmony_ci#define RADEON_INFO_IB_VM_MAX_SIZE	0x0f
77322851890Sopenharmony_ci#define RADEON_INFO_MAX_PIPES		0x10
77422851890Sopenharmony_ci#define RADEON_INFO_TIMESTAMP		0x11
77522851890Sopenharmony_ci#define RADEON_INFO_MAX_SE		0x12
77622851890Sopenharmony_ci#define RADEON_INFO_MAX_SH_PER_SE	0x13
77722851890Sopenharmony_ci#define RADEON_INFO_FASTFB_WORKING	0x14
77822851890Sopenharmony_ci#define RADEON_INFO_RING_WORKING	0x15
77922851890Sopenharmony_ci#define RADEON_INFO_SI_TILE_MODE_ARRAY	0x16
78022851890Sopenharmony_ci#define RADEON_INFO_SI_CP_DMA_COMPUTE	0x17
78122851890Sopenharmony_ci#define RADEON_INFO_CIK_MACROTILE_MODE_ARRAY	0x18
78222851890Sopenharmony_ci#define RADEON_INFO_SI_BACKEND_ENABLED_MASK	0x19
78322851890Sopenharmony_ci#define RADEON_INFO_MAX_SCLK		0x1a
78422851890Sopenharmony_ci#define RADEON_INFO_VCE_FW_VERSION	0x1b
78522851890Sopenharmony_ci#define RADEON_INFO_VCE_FB_VERSION	0x1c
78622851890Sopenharmony_ci#define RADEON_INFO_NUM_BYTES_MOVED	0x1d
78722851890Sopenharmony_ci#define RADEON_INFO_VRAM_USAGE		0x1e
78822851890Sopenharmony_ci#define RADEON_INFO_GTT_USAGE		0x1f
78922851890Sopenharmony_ci#define RADEON_INFO_ACTIVE_CU_COUNT	0x20
79022851890Sopenharmony_ci#define RADEON_INFO_CURRENT_GPU_TEMP	0x21
79122851890Sopenharmony_ci#define RADEON_INFO_CURRENT_GPU_SCLK	0x22
79222851890Sopenharmony_ci#define RADEON_INFO_CURRENT_GPU_MCLK	0x23
79322851890Sopenharmony_ci#define RADEON_INFO_READ_REG		0x24
79422851890Sopenharmony_ci#define RADEON_INFO_VA_UNMAP_WORKING	0x25
79522851890Sopenharmony_ci#define RADEON_INFO_GPU_RESET_COUNTER	0x26
79622851890Sopenharmony_cistruct drm_radeon_info {
79722851890Sopenharmony_ci	__u32		request;
79822851890Sopenharmony_ci	__u32		pad;
79922851890Sopenharmony_ci	__u64		value;
80022851890Sopenharmony_ci};
80122851890Sopenharmony_ci#define SI_TILE_MODE_COLOR_LINEAR_ALIGNED	8
80222851890Sopenharmony_ci#define SI_TILE_MODE_COLOR_1D			13
80322851890Sopenharmony_ci#define SI_TILE_MODE_COLOR_1D_SCANOUT		9
80422851890Sopenharmony_ci#define SI_TILE_MODE_COLOR_2D_8BPP		14
80522851890Sopenharmony_ci#define SI_TILE_MODE_COLOR_2D_16BPP		15
80622851890Sopenharmony_ci#define SI_TILE_MODE_COLOR_2D_32BPP		16
80722851890Sopenharmony_ci#define SI_TILE_MODE_COLOR_2D_64BPP		17
80822851890Sopenharmony_ci#define SI_TILE_MODE_COLOR_2D_SCANOUT_16BPP	11
80922851890Sopenharmony_ci#define SI_TILE_MODE_COLOR_2D_SCANOUT_32BPP	12
81022851890Sopenharmony_ci#define SI_TILE_MODE_DEPTH_STENCIL_1D		4
81122851890Sopenharmony_ci#define SI_TILE_MODE_DEPTH_STENCIL_2D		0
81222851890Sopenharmony_ci#define SI_TILE_MODE_DEPTH_STENCIL_2D_2AA	3
81322851890Sopenharmony_ci#define SI_TILE_MODE_DEPTH_STENCIL_2D_4AA	3
81422851890Sopenharmony_ci#define SI_TILE_MODE_DEPTH_STENCIL_2D_8AA	2
81522851890Sopenharmony_ci#define CIK_TILE_MODE_DEPTH_STENCIL_1D		5
81622851890Sopenharmony_ci#if defined(__cplusplus)
81722851890Sopenharmony_ci}
81822851890Sopenharmony_ci#endif
81922851890Sopenharmony_ci#endif
820