cmdq_platform.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef __CMDQ_PLATFORM_H__
  2. #define __CMDQ_PLATFORM_H__
  3. /* platform dependent utilities, format: cmdq_{util_type}_{name} */
  4. #include "cmdq_def.h"
  5. #include "cmdq_core.h"
  6. #include "cmdq_platform_idv.h"
  7. /*
  8. * GCE capability
  9. */
  10. const bool cmdq_core_support_sync_non_suspendable(void);
  11. const bool cmdq_core_support_wait_and_receive_event_in_same_tick(void);
  12. /* get LSB for subsys encoding in argA (range: 0 - 31)*/
  13. const uint32_t cmdq_core_get_subsys_LSB_in_argA(void);
  14. /* HW thread related */
  15. const bool cmdq_core_is_a_secure_thread(const int32_t thread);
  16. const bool cmdq_core_is_valid_notify_thread_for_secure_path(const int32_t thread);
  17. /**
  18. * Scenario related
  19. *
  20. */
  21. bool cmdq_core_is_request_from_user_space(const enum CMDQ_SCENARIO_ENUM scenario);
  22. bool cmdq_core_is_disp_scenario(const enum CMDQ_SCENARIO_ENUM scenario);
  23. bool cmdq_core_should_enable_prefetch(enum CMDQ_SCENARIO_ENUM scenario);
  24. bool cmdq_core_should_profile(enum CMDQ_SCENARIO_ENUM scenario);
  25. int cmdq_core_get_thread_index_from_scenario_and_secure_data(enum CMDQ_SCENARIO_ENUM scenario,
  26. const bool secure);
  27. int cmdq_core_disp_thread_index_from_scenario(enum CMDQ_SCENARIO_ENUM scenario);
  28. enum CMDQ_HW_THREAD_PRIORITY_ENUM cmdq_core_priority_from_scenario(enum CMDQ_SCENARIO_ENUM
  29. scenario);
  30. /**
  31. * Module dependent
  32. *
  33. */
  34. void cmdq_core_get_reg_id_from_hwflag(uint64_t hwflag, enum CMDQ_DATA_REGISTER_ENUM *valueRegId,
  35. enum CMDQ_DATA_REGISTER_ENUM *destRegId,
  36. enum CMDQ_EVENT_ENUM *regAccessToken);
  37. const char *cmdq_core_module_from_event_id(enum CMDQ_EVENT_ENUM event, uint32_t instA,
  38. uint32_t instB);
  39. const char *cmdq_core_parse_module_from_reg_addr(uint32_t reg_addr);
  40. const int32_t cmdq_core_can_module_entry_suspend(struct EngineStruct *engineList);
  41. ssize_t cmdq_core_print_status_clock(char *buf);
  42. void cmdq_core_print_status_seq_clock(struct seq_file *m);
  43. void cmdq_core_enable_common_clock_locked_impl(bool enable);
  44. void cmdq_core_enable_gce_clock_locked_impl(bool enable);
  45. void cmdq_core_enable_cmdq_clock_locked_impl(bool enable, char *deviceName);
  46. const char *cmdq_core_parse_error_module_by_hwflag_impl(struct TaskStruct *pTask);
  47. /**
  48. * Debug
  49. *
  50. */
  51. void cmdq_core_dump_clock_gating(void);
  52. int cmdq_core_dump_smi(const int showSmiDump);
  53. void cmdq_core_gpr_dump(void);
  54. void cmdq_core_dump_secure_metadata(cmdqSecDataStruct *pSecData);
  55. ssize_t cmdq_core_print_event(char *buf);
  56. void cmdq_core_print_event_seq(struct seq_file *m);
  57. /**
  58. * Record usage
  59. *
  60. */
  61. uint64_t cmdq_rec_flag_from_scenario(enum CMDQ_SCENARIO_ENUM scn);
  62. /**
  63. * Test
  64. *
  65. */
  66. void cmdq_test_setup(void);
  67. void cmdq_test_cleanup(void);
  68. #endif /* #ifndef __CMDQ_PLATFORM_H__ */