blob: 6a603b378adbd2f3b661c1ca1a88a0ac560931f5 [file] [log] [blame]
Dave Airlie551ebd82009-09-01 15:25:57 +10001
2#define R100_TRACK_MAX_TEXTURE 3
3#define R200_TRACK_MAX_TEXTURE 6
4#define R300_TRACK_MAX_TEXTURE 16
5
6#define R100_MAX_CB 1
7#define R300_MAX_CB 4
8
9/*
10 * CS functions
11 */
12struct r100_cs_track_cb {
Jerome Glisse4c788672009-11-20 14:29:23 +010013 struct radeon_bo *robj;
Dave Airlie551ebd82009-09-01 15:25:57 +100014 unsigned pitch;
15 unsigned cpp;
16 unsigned offset;
17};
18
19struct r100_cs_track_array {
Jerome Glisse4c788672009-11-20 14:29:23 +010020 struct radeon_bo *robj;
Dave Airlie551ebd82009-09-01 15:25:57 +100021 unsigned esize;
22};
23
24struct r100_cs_cube_info {
Jerome Glisse4c788672009-11-20 14:29:23 +010025 struct radeon_bo *robj;
26 unsigned offset;
Dave Airlie551ebd82009-09-01 15:25:57 +100027 unsigned width;
28 unsigned height;
29};
30
Dave Airlied785d782009-12-07 13:16:06 +100031#define R100_TRACK_COMP_NONE 0
32#define R100_TRACK_COMP_DXT1 1
33#define R100_TRACK_COMP_DXT35 2
34
Dave Airlie551ebd82009-09-01 15:25:57 +100035struct r100_cs_track_texture {
Jerome Glisse4c788672009-11-20 14:29:23 +010036 struct radeon_bo *robj;
Dave Airlie551ebd82009-09-01 15:25:57 +100037 struct r100_cs_cube_info cube_info[5]; /* info for 5 non-primary faces */
38 unsigned pitch;
39 unsigned width;
40 unsigned height;
41 unsigned num_levels;
42 unsigned cpp;
43 unsigned tex_coord_type;
44 unsigned txdepth;
45 unsigned width_11;
46 unsigned height_11;
47 bool use_pitch;
48 bool enabled;
Alex Deucher43b93fb2010-10-27 01:02:35 -040049 bool lookup_disable;
Dave Airlie551ebd82009-09-01 15:25:57 +100050 bool roundup_w;
51 bool roundup_h;
Dave Airlied785d782009-12-07 13:16:06 +100052 unsigned compress_format;
Dave Airlie551ebd82009-09-01 15:25:57 +100053};
54
Dave Airlie551ebd82009-09-01 15:25:57 +100055struct r100_cs_track {
Dave Airlie551ebd82009-09-01 15:25:57 +100056 unsigned num_cb;
57 unsigned num_texture;
58 unsigned maxy;
59 unsigned vtx_size;
60 unsigned vap_vf_cntl;
Marek Olšákcae94b02010-02-21 21:24:15 +010061 unsigned vap_alt_nverts;
Dave Airlie551ebd82009-09-01 15:25:57 +100062 unsigned immd_dwords;
63 unsigned num_arrays;
64 unsigned max_indx;
Marek Olšák46c64d42009-12-17 06:02:28 +010065 unsigned color_channel_mask;
Marek Olšáka27bb4b2011-06-10 14:41:26 +000066 struct r100_cs_track_array arrays[16];
Dave Airlie551ebd82009-09-01 15:25:57 +100067 struct r100_cs_track_cb cb[R300_MAX_CB];
68 struct r100_cs_track_cb zb;
Marek Olšákfff1ce42011-02-14 01:01:10 +010069 struct r100_cs_track_cb aa;
Dave Airlie551ebd82009-09-01 15:25:57 +100070 struct r100_cs_track_texture textures[R300_TRACK_MAX_TEXTURE];
71 bool z_enabled;
72 bool separate_cube;
Marek Olšák797fd5b2010-04-13 02:33:36 +020073 bool zb_cb_clear;
Marek Olšák46c64d42009-12-17 06:02:28 +010074 bool blend_read_enable;
Marek Olšák40b4a752011-02-12 19:21:35 +010075 bool cb_dirty;
76 bool zb_dirty;
77 bool tex_dirty;
Marek Olšákfff1ce42011-02-14 01:01:10 +010078 bool aa_dirty;
79 bool aaresolve;
Dave Airlie551ebd82009-09-01 15:25:57 +100080};
81
82int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track);
83void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track);
84int r100_cs_packet_next_reloc(struct radeon_cs_parser *p,
85 struct radeon_cs_reloc **cs_reloc);
86void r100_cs_dump_packet(struct radeon_cs_parser *p,
87 struct radeon_cs_packet *pkt);
88
89int r100_cs_packet_parse_vline(struct radeon_cs_parser *p);
90
91int r200_packet0_check(struct radeon_cs_parser *p,
92 struct radeon_cs_packet *pkt,
93 unsigned idx, unsigned reg);
94
Andi Kleencbdd4502011-10-13 16:08:46 -070095int r100_reloc_pitch_offset(struct radeon_cs_parser *p,
96 struct radeon_cs_packet *pkt,
97 unsigned idx,
98 unsigned reg);
99int r100_packet3_load_vbpntr(struct radeon_cs_parser *p,
100 struct radeon_cs_packet *pkt,
101 int idx);