r100_track.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #define R100_TRACK_MAX_TEXTURE 3
  3. #define R200_TRACK_MAX_TEXTURE 6
  4. #define R300_TRACK_MAX_TEXTURE 16
  5. #define R100_MAX_CB 1
  6. #define R300_MAX_CB 4
  7. /*
  8. * CS functions
  9. */
  10. struct r100_cs_track_cb {
  11. struct radeon_bo *robj;
  12. unsigned pitch;
  13. unsigned cpp;
  14. unsigned offset;
  15. };
  16. struct r100_cs_track_array {
  17. struct radeon_bo *robj;
  18. unsigned esize;
  19. };
  20. struct r100_cs_cube_info {
  21. struct radeon_bo *robj;
  22. unsigned offset;
  23. unsigned width;
  24. unsigned height;
  25. };
  26. #define R100_TRACK_COMP_NONE 0
  27. #define R100_TRACK_COMP_DXT1 1
  28. #define R100_TRACK_COMP_DXT35 2
  29. struct r100_cs_track_texture {
  30. struct radeon_bo *robj;
  31. struct r100_cs_cube_info cube_info[5]; /* info for 5 non-primary faces */
  32. unsigned pitch;
  33. unsigned width;
  34. unsigned height;
  35. unsigned num_levels;
  36. unsigned cpp;
  37. unsigned tex_coord_type;
  38. unsigned txdepth;
  39. unsigned width_11;
  40. unsigned height_11;
  41. bool use_pitch;
  42. bool enabled;
  43. bool lookup_disable;
  44. bool roundup_w;
  45. bool roundup_h;
  46. unsigned compress_format;
  47. };
  48. struct r100_cs_track {
  49. unsigned num_cb;
  50. unsigned num_texture;
  51. unsigned maxy;
  52. unsigned vtx_size;
  53. unsigned vap_vf_cntl;
  54. unsigned vap_alt_nverts;
  55. unsigned immd_dwords;
  56. unsigned num_arrays;
  57. unsigned max_indx;
  58. unsigned color_channel_mask;
  59. struct r100_cs_track_array arrays[16];
  60. struct r100_cs_track_cb cb[R300_MAX_CB];
  61. struct r100_cs_track_cb zb;
  62. struct r100_cs_track_cb aa;
  63. struct r100_cs_track_texture textures[R300_TRACK_MAX_TEXTURE];
  64. bool z_enabled;
  65. bool separate_cube;
  66. bool zb_cb_clear;
  67. bool blend_read_enable;
  68. bool cb_dirty;
  69. bool zb_dirty;
  70. bool tex_dirty;
  71. bool aa_dirty;
  72. bool aaresolve;
  73. };
  74. int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track);
  75. void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track);
  76. int r100_cs_packet_parse_vline(struct radeon_cs_parser *p);
  77. int r200_packet0_check(struct radeon_cs_parser *p,
  78. struct radeon_cs_packet *pkt,
  79. unsigned idx, unsigned reg);
  80. int r100_reloc_pitch_offset(struct radeon_cs_parser *p,
  81. struct radeon_cs_packet *pkt,
  82. unsigned idx,
  83. unsigned reg);
  84. int r100_packet3_load_vbpntr(struct radeon_cs_parser *p,
  85. struct radeon_cs_packet *pkt,
  86. int idx);