r100_track.h 2.4 KB

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