radeon_cs_int.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #ifndef _RADEON_CS_INT_H_
  2. #define _RADEON_CS_INT_H_
  3. struct radeon_cs_space_check {
  4. struct radeon_bo_int *bo;
  5. uint32_t read_domains;
  6. uint32_t write_domain;
  7. uint32_t new_accounted;
  8. };
  9. struct radeon_cs_int {
  10. /* keep first two in same place */
  11. uint32_t *packets;
  12. unsigned cdw;
  13. unsigned ndw;
  14. unsigned section_ndw;
  15. unsigned section_cdw;
  16. /* private members */
  17. struct radeon_cs_manager *csm;
  18. void *relocs;
  19. unsigned crelocs;
  20. unsigned relocs_total_size;
  21. const char *section_file;
  22. const char *section_func;
  23. int section_line;
  24. struct radeon_cs_space_check bos[MAX_SPACE_BOS];
  25. int bo_count;
  26. void (*space_flush_fn)(void *);
  27. void *space_flush_data;
  28. uint32_t id;
  29. };
  30. /* cs functions */
  31. struct radeon_cs_funcs {
  32. struct radeon_cs_int *(*cs_create)(struct radeon_cs_manager *csm,
  33. uint32_t ndw);
  34. int (*cs_write_reloc)(struct radeon_cs_int *cs,
  35. struct radeon_bo *bo,
  36. uint32_t read_domain,
  37. uint32_t write_domain,
  38. uint32_t flags);
  39. int (*cs_begin)(struct radeon_cs_int *cs,
  40. uint32_t ndw,
  41. const char *file,
  42. const char *func,
  43. int line);
  44. int (*cs_end)(struct radeon_cs_int *cs,
  45. const char *file, const char *func,
  46. int line);
  47. int (*cs_emit)(struct radeon_cs_int *cs);
  48. int (*cs_destroy)(struct radeon_cs_int *cs);
  49. int (*cs_erase)(struct radeon_cs_int *cs);
  50. int (*cs_need_flush)(struct radeon_cs_int *cs);
  51. void (*cs_print)(struct radeon_cs_int *cs, FILE *file);
  52. };
  53. struct radeon_cs_manager {
  54. const struct radeon_cs_funcs *funcs;
  55. int fd;
  56. int32_t vram_limit, gart_limit;
  57. int32_t vram_write_used, gart_write_used;
  58. int32_t read_used;
  59. };
  60. #endif