summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/pmu_gk20a.h')
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.h61
1 files changed, 60 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
index e00991cb..0d7d7435 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.h
@@ -341,7 +341,7 @@ struct pmu_mem_desc_v0 {
341 /*! 341 /*!
342 * Start address of memory surface that is being communicated to the falcon. 342 * Start address of memory surface that is being communicated to the falcon.
343 */ 343 */
344 u64 dma_addr; 344 struct falc_u64 dma_addr;
345 /*! 345 /*!
346 * Max allowed DMA transfer size (size of the memory surface). Accesses past 346 * Max allowed DMA transfer size (size of the memory surface). Accesses past
347 * this point may result in page faults and/or memory corruptions. 347 * this point may result in page faults and/or memory corruptions.
@@ -679,6 +679,15 @@ enum {
679 PMU_PG_STAT_CMD_ALLOC_DMEM = 0, 679 PMU_PG_STAT_CMD_ALLOC_DMEM = 0,
680}; 680};
681 681
682#define PMU_PG_FEATURE_GR_SDIV_SLOWDOWN_ENABLED (1 << 0)
683#define PMU_PG_FEATURE_GR_POWER_GATING_ENABLED (1 << 2)
684
685struct pmu_pg_cmd_gr_init_param {
686 u8 cmd_type;
687 u16 sub_cmd_id;
688 u8 featuremask;
689};
690
682struct pmu_pg_cmd_stat { 691struct pmu_pg_cmd_stat {
683 u8 cmd_type; 692 u8 cmd_type;
684 u8 engine_id; 693 u8 engine_id;
@@ -693,6 +702,7 @@ struct pmu_pg_cmd {
693 struct pmu_pg_cmd_eng_buf_load_v0 eng_buf_load_v0; 702 struct pmu_pg_cmd_eng_buf_load_v0 eng_buf_load_v0;
694 struct pmu_pg_cmd_eng_buf_load_v1 eng_buf_load_v1; 703 struct pmu_pg_cmd_eng_buf_load_v1 eng_buf_load_v1;
695 struct pmu_pg_cmd_stat stat; 704 struct pmu_pg_cmd_stat stat;
705 struct pmu_pg_cmd_gr_init_param gr_init_param;
696 /* TBD: other pg commands */ 706 /* TBD: other pg commands */
697 union pmu_ap_cmd ap_cmd; 707 union pmu_ap_cmd ap_cmd;
698 }; 708 };
@@ -835,6 +845,14 @@ enum {
835 PMU_PERFMON_CMD_ID_INIT = 2 845 PMU_PERFMON_CMD_ID_INIT = 2
836}; 846};
837 847
848struct pmu_perfmon_cmd_start_v2 {
849 u8 cmd_type;
850 u8 group_id;
851 u8 state_id;
852 u8 flags;
853 struct pmu_allocation_v2 counter_alloc;
854};
855
838struct pmu_perfmon_cmd_start_v1 { 856struct pmu_perfmon_cmd_start_v1 {
839 u8 cmd_type; 857 u8 cmd_type;
840 u8 group_id; 858 u8 group_id;
@@ -855,6 +873,17 @@ struct pmu_perfmon_cmd_stop {
855 u8 cmd_type; 873 u8 cmd_type;
856}; 874};
857 875
876struct pmu_perfmon_cmd_init_v2 {
877 u8 cmd_type;
878 u8 to_decrease_count;
879 u8 base_counter_id;
880 u32 sample_period_us;
881 struct pmu_allocation_v2 counter_alloc;
882 u8 num_counters;
883 u8 samples_in_moving_avg;
884 u16 sample_buffer;
885};
886
858struct pmu_perfmon_cmd_init_v1 { 887struct pmu_perfmon_cmd_init_v1 {
859 u8 cmd_type; 888 u8 cmd_type;
860 u8 to_decrease_count; 889 u8 to_decrease_count;
@@ -882,9 +911,11 @@ struct pmu_perfmon_cmd {
882 u8 cmd_type; 911 u8 cmd_type;
883 struct pmu_perfmon_cmd_start_v0 start_v0; 912 struct pmu_perfmon_cmd_start_v0 start_v0;
884 struct pmu_perfmon_cmd_start_v1 start_v1; 913 struct pmu_perfmon_cmd_start_v1 start_v1;
914 struct pmu_perfmon_cmd_start_v2 start_v2;
885 struct pmu_perfmon_cmd_stop stop; 915 struct pmu_perfmon_cmd_stop stop;
886 struct pmu_perfmon_cmd_init_v0 init_v0; 916 struct pmu_perfmon_cmd_init_v0 init_v0;
887 struct pmu_perfmon_cmd_init_v1 init_v1; 917 struct pmu_perfmon_cmd_init_v1 init_v1;
918 struct pmu_perfmon_cmd_init_v2 init_v2;
888 }; 919 };
889}; 920};
890 921
@@ -1102,6 +1133,34 @@ struct pmu_sequence {
1102 void* cb_params; 1133 void* cb_params;
1103}; 1134};
1104 1135
1136struct pmu_pg_stats_v1 {
1137 /* Number of time PMU successfully engaged sleep state */
1138 u32 entryCount;
1139 /* Number of time PMU exit sleep state */
1140 u32 exitCount;
1141 /* Number of time PMU aborted in entry sequence */
1142 u32 abortCount;
1143 /*
1144 * Time for which GPU was neither in Sleep state not
1145 * executing sleep sequence.
1146 * */
1147 u32 poweredUpTimeUs;
1148 /* Entry and exit latency of current sleep cycle */
1149 u32 entryLatencyUs;
1150 u32 exitLatencyUs;
1151 /* Resident time for current sleep cycle. */
1152 u32 residentTimeUs;
1153 /* Rolling average entry and exit latencies */
1154 u32 entryLatencyAvgUs;
1155 u32 exitLatencyAvgUs;
1156 /* Max entry and exit latencies */
1157 u32 entryLatencyMaxUs;
1158 u32 exitLatencyMaxUs;
1159 /* Total time spent in sleep and non-sleep state */
1160 u32 totalSleepTimeUs;
1161 u32 totalNonSleepTimeUs;
1162};
1163
1105struct pmu_pg_stats { 1164struct pmu_pg_stats {
1106 u64 pg_entry_start_timestamp; 1165 u64 pg_entry_start_timestamp;
1107 u64 pg_ingating_start_timestamp; 1166 u64 pg_ingating_start_timestamp;