sna_reg.h revision 428d7b3d
1#ifndef SNA_REG_H
2#define SNA_REG_H
3
4/* Flush */
5#define MI_FLUSH			(0x04<<23)
6#define MI_FLUSH_DW			(0x26<<23)
7
8#define MI_WRITE_DIRTY_STATE		(1<<4)
9#define MI_END_SCENE			(1<<3)
10#define MI_GLOBAL_SNAPSHOT_COUNT_RESET	(1<<3)
11#define MI_INHIBIT_RENDER_CACHE_FLUSH	(1<<2)
12#define MI_STATE_INSTRUCTION_CACHE_FLUSH (1<<1)
13#define MI_INVALIDATE_MAP_CACHE		(1<<0)
14/* broadwater flush bits */
15#define BRW_MI_GLOBAL_SNAPSHOT_RESET   (1 << 3)
16
17#define MI_BATCH_BUFFER_END	(0xA << 23)
18
19/* Noop */
20#define MI_NOOP				0x00
21#define MI_NOOP_WRITE_ID		(1<<22)
22#define MI_NOOP_ID_MASK			(1<<22 - 1)
23
24/* Wait for Events */
25#define MI_WAIT_FOR_EVENT			(0x03<<23)
26#define MI_WAIT_FOR_PIPEB_SVBLANK		(1<<18)
27#define MI_WAIT_FOR_PIPEA_SVBLANK		(1<<17)
28#define MI_WAIT_FOR_OVERLAY_FLIP		(1<<16)
29#define MI_WAIT_FOR_PIPEB_VBLANK		(1<<7)
30#define MI_WAIT_FOR_PIPEB_SCAN_LINE_WINDOW	(1<<5)
31#define MI_WAIT_FOR_PIPEA_VBLANK		(1<<3)
32#define MI_WAIT_FOR_PIPEA_SCAN_LINE_WINDOW	(1<<1)
33
34/* Set the scan line for MI_WAIT_FOR_PIPE?_SCAN_LINE_WINDOW */
35#define MI_LOAD_SCAN_LINES_INCL			(0x12<<23)
36#define MI_LOAD_SCAN_LINES_DISPLAY_PIPEA	(0)
37#define MI_LOAD_SCAN_LINES_DISPLAY_PIPEB	(0x1<<20)
38
39/* BLT commands */
40#define BLT_WRITE_ALPHA		(1<<21)
41#define BLT_WRITE_RGB		(1<<20)
42#define BLT_SRC_TILED		(1<<15)
43#define BLT_DST_TILED		(1<<11)
44
45#define COLOR_BLT_CMD			(2<<29|0x40<<22|(0x3))
46#define XY_COLOR_BLT			(2<<29|0x50<<22|(0x4))
47#define XY_SETUP_BLT			(2<<29|0x01<<22)
48#define XY_SETUP_MONO_PATTERN_SL_BLT	(2<<29|0x11<<22)
49#define XY_SETUP_CLIP			(2<<29|0x03<<22|1)
50#define XY_PIXEL_BLT			(2<<29|0x24<<22)
51#define XY_SCANLINE_BLT			(2<<29|0x25<<22|1)
52#define XY_TEXT_IMMEDIATE_BLT		(2<<29|0x31<<22|(1<<16))
53#define XY_SRC_COPY_BLT_CMD		(2<<29|0x53<<22)
54#define SRC_COPY_BLT_CMD		(2<<29|0x43<<22|0x4)
55#define XY_PAT_BLT			(2<<29|0x51<<22)
56#define XY_PAT_BLT_IMMEDIATE		(2<<29|0x72<<22)
57#define XY_MONO_PAT			(2<<29|0x52<<22)
58#define XY_MONO_SRC_COPY		(2<<29|0x54<<22)
59#define XY_MONO_SRC_COPY_IMM		(2<<29|0x71<<22)
60#define XY_FULL_MONO_PATTERN_BLT	(2<<29|0x57<<22)
61#define XY_FULL_MONO_PATTERN_MONO_SRC_BLT (2<<29|0x58<<22)
62
63/* FLUSH commands */
64#define BRW_3D(Pipeline,Opcode,Subopcode) \
65	((3 << 29) | \
66	 ((Pipeline) << 27) | \
67	 ((Opcode) << 24) | \
68	 ((Subopcode) << 16))
69#define PIPE_CONTROL		BRW_3D(3, 2, 0)
70#define PIPE_CONTROL_NOWRITE       (0 << 14)
71#define PIPE_CONTROL_WRITE_QWORD   (1 << 14)
72#define PIPE_CONTROL_WRITE_DEPTH   (2 << 14)
73#define PIPE_CONTROL_WRITE_TIME    (3 << 14)
74#define PIPE_CONTROL_DEPTH_STALL   (1 << 13)
75#define PIPE_CONTROL_WC_FLUSH      (1 << 12)
76#define PIPE_CONTROL_IS_FLUSH      (1 << 11)
77#define PIPE_CONTROL_TC_FLUSH      (1 << 10)
78#define PIPE_CONTROL_NOTIFY_ENABLE (1 << 8)
79#define PIPE_CONTROL_GLOBAL_GTT    (1 << 2)
80#define PIPE_CONTROL_LOCAL_PGTT    (0 << 2)
81#define PIPE_CONTROL_DEPTH_CACHE_FLUSH	(1 << 0)
82
83#endif
84