Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 1 | |
| 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 | */ |
| 12 | struct r100_cs_track_cb { |
Jerome Glisse | 4c78867 | 2009-11-20 14:29:23 +0100 | [diff] [blame] | 13 | struct radeon_bo *robj; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 14 | unsigned pitch; |
| 15 | unsigned cpp; |
| 16 | unsigned offset; |
| 17 | }; |
| 18 | |
| 19 | struct r100_cs_track_array { |
Jerome Glisse | 4c78867 | 2009-11-20 14:29:23 +0100 | [diff] [blame] | 20 | struct radeon_bo *robj; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 21 | unsigned esize; |
| 22 | }; |
| 23 | |
| 24 | struct r100_cs_cube_info { |
Jerome Glisse | 4c78867 | 2009-11-20 14:29:23 +0100 | [diff] [blame] | 25 | struct radeon_bo *robj; |
| 26 | unsigned offset; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 27 | unsigned width; |
| 28 | unsigned height; |
| 29 | }; |
| 30 | |
Dave Airlie | d785d78 | 2009-12-07 13:16:06 +1000 | [diff] [blame] | 31 | #define R100_TRACK_COMP_NONE 0 |
| 32 | #define R100_TRACK_COMP_DXT1 1 |
| 33 | #define R100_TRACK_COMP_DXT35 2 |
| 34 | |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 35 | struct r100_cs_track_texture { |
Jerome Glisse | 4c78867 | 2009-11-20 14:29:23 +0100 | [diff] [blame] | 36 | struct radeon_bo *robj; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 37 | 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 Deucher | 43b93fb | 2010-10-27 01:02:35 -0400 | [diff] [blame] | 49 | bool lookup_disable; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 50 | bool roundup_w; |
| 51 | bool roundup_h; |
Dave Airlie | d785d78 | 2009-12-07 13:16:06 +1000 | [diff] [blame] | 52 | unsigned compress_format; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 53 | }; |
| 54 | |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 55 | struct r100_cs_track { |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 56 | unsigned num_cb; |
| 57 | unsigned num_texture; |
| 58 | unsigned maxy; |
| 59 | unsigned vtx_size; |
| 60 | unsigned vap_vf_cntl; |
Marek Olšák | cae94b0 | 2010-02-21 21:24:15 +0100 | [diff] [blame] | 61 | unsigned vap_alt_nverts; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 62 | unsigned immd_dwords; |
| 63 | unsigned num_arrays; |
| 64 | unsigned max_indx; |
Marek Olšák | 46c64d4 | 2009-12-17 06:02:28 +0100 | [diff] [blame] | 65 | unsigned color_channel_mask; |
Marek Olšák | a27bb4b | 2011-06-10 14:41:26 +0000 | [diff] [blame] | 66 | struct r100_cs_track_array arrays[16]; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 67 | struct r100_cs_track_cb cb[R300_MAX_CB]; |
| 68 | struct r100_cs_track_cb zb; |
Marek Olšák | fff1ce4 | 2011-02-14 01:01:10 +0100 | [diff] [blame] | 69 | struct r100_cs_track_cb aa; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 70 | struct r100_cs_track_texture textures[R300_TRACK_MAX_TEXTURE]; |
| 71 | bool z_enabled; |
| 72 | bool separate_cube; |
Marek Olšák | 797fd5b | 2010-04-13 02:33:36 +0200 | [diff] [blame] | 73 | bool zb_cb_clear; |
Marek Olšák | 46c64d4 | 2009-12-17 06:02:28 +0100 | [diff] [blame] | 74 | bool blend_read_enable; |
Marek Olšák | 40b4a75 | 2011-02-12 19:21:35 +0100 | [diff] [blame] | 75 | bool cb_dirty; |
| 76 | bool zb_dirty; |
| 77 | bool tex_dirty; |
Marek Olšák | fff1ce4 | 2011-02-14 01:01:10 +0100 | [diff] [blame] | 78 | bool aa_dirty; |
| 79 | bool aaresolve; |
Dave Airlie | 551ebd8 | 2009-09-01 15:25:57 +1000 | [diff] [blame] | 80 | }; |
| 81 | |
| 82 | int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track); |
| 83 | void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track); |
| 84 | int r100_cs_packet_next_reloc(struct radeon_cs_parser *p, |
| 85 | struct radeon_cs_reloc **cs_reloc); |
| 86 | void r100_cs_dump_packet(struct radeon_cs_parser *p, |
| 87 | struct radeon_cs_packet *pkt); |
| 88 | |
| 89 | int r100_cs_packet_parse_vline(struct radeon_cs_parser *p); |
| 90 | |
| 91 | int r200_packet0_check(struct radeon_cs_parser *p, |
| 92 | struct radeon_cs_packet *pkt, |
| 93 | unsigned idx, unsigned reg); |
| 94 | |
Andi Kleen | cbdd450 | 2011-10-13 16:08:46 -0700 | [diff] [blame] | 95 | int r100_reloc_pitch_offset(struct radeon_cs_parser *p, |
| 96 | struct radeon_cs_packet *pkt, |
| 97 | unsigned idx, |
| 98 | unsigned reg); |
| 99 | int r100_packet3_load_vbpntr(struct radeon_cs_parser *p, |
| 100 | struct radeon_cs_packet *pkt, |
| 101 | int idx); |