diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2015-01-28 08:07:00 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 21:07:03 -0400 |
commit | bc1b5fdd56fff2a64a78b4a190897e34f9f08845 (patch) | |
tree | f37841e278840df2c71126a4e0eddd68d69c3aa0 /drivers/gpu/nvgpu/gm20b/gr_gm20b.c | |
parent | aa96b6bd1efa1e26a757080137486884972d248c (diff) |
gpu: nvgpu: APIs to dump GR status
Add below APIs to dump various GR status registers
1. debugfs : /d/gpu.0/gr_status
Read this debugfs at runtime to get status registers
2. API gk20a_gr_debug_dump()
Add this API in code to dump registers at any point
Bug 200062436
Change-Id: Ic1115b5a2fc16362954b5ed8a9e70afb872a8d91
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/486465
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/gr_gm20b.c')
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/gr_gm20b.c | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c index 84391377..79e46421 100644 --- a/drivers/gpu/nvgpu/gm20b/gr_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/gr_gm20b.c | |||
@@ -23,6 +23,7 @@ | |||
23 | 23 | ||
24 | #include "gr_gm20b.h" | 24 | #include "gr_gm20b.h" |
25 | #include "hw_gr_gm20b.h" | 25 | #include "hw_gr_gm20b.h" |
26 | #include "hw_fifo_gm20b.h" | ||
26 | #include "hw_fb_gm20b.h" | 27 | #include "hw_fb_gm20b.h" |
27 | #include "hw_proj_gm20b.h" | 28 | #include "hw_proj_gm20b.h" |
28 | #include "hw_ctxsw_prog_gm20b.h" | 29 | #include "hw_ctxsw_prog_gm20b.h" |
@@ -814,6 +815,128 @@ static void gr_gm20b_update_ctxsw_preemption_mode(struct gk20a *g, | |||
814 | gk20a_dbg_fn("done"); | 815 | gk20a_dbg_fn("done"); |
815 | } | 816 | } |
816 | 817 | ||
818 | static int gr_gm20b_dump_gr_status_regs(struct gk20a *g, | ||
819 | struct gk20a_debug_output *o) | ||
820 | { | ||
821 | struct gr_gk20a *gr = &g->gr; | ||
822 | |||
823 | gk20a_debug_output(o, "NV_PGRAPH_STATUS: 0x%x\n", | ||
824 | gk20a_readl(g, gr_status_r())); | ||
825 | gk20a_debug_output(o, "NV_PGRAPH_STATUS1: 0x%x\n", | ||
826 | gk20a_readl(g, gr_status_1_r())); | ||
827 | gk20a_debug_output(o, "NV_PGRAPH_STATUS2: 0x%x\n", | ||
828 | gk20a_readl(g, gr_status_2_r())); | ||
829 | gk20a_debug_output(o, "NV_PGRAPH_ENGINE_STATUS: 0x%x\n", | ||
830 | gk20a_readl(g, gr_engine_status_r())); | ||
831 | gk20a_debug_output(o, "NV_PGRAPH_GRFIFO_STATUS : 0x%x\n", | ||
832 | gk20a_readl(g, gr_gpfifo_status_r())); | ||
833 | gk20a_debug_output(o, "NV_PGRAPH_GRFIFO_CONTROL : 0x%x\n", | ||
834 | gk20a_readl(g, gr_gpfifo_ctl_r())); | ||
835 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FECS_HOST_INT_STATUS : 0x%x\n", | ||
836 | gk20a_readl(g, gr_fecs_host_int_status_r())); | ||
837 | gk20a_debug_output(o, "NV_PGRAPH_EXCEPTION : 0x%x\n", | ||
838 | gk20a_readl(g, gr_exception_r())); | ||
839 | gk20a_debug_output(o, "NV_PGRAPH_FECS_INTR : 0x%x\n", | ||
840 | gk20a_readl(g, gr_fecs_intr_r())); | ||
841 | gk20a_debug_output(o, "NV_PFIFO_ENGINE_STATUS(GR) : 0x%x\n", | ||
842 | gk20a_readl(g, fifo_engine_status_r(ENGINE_GR_GK20A))); | ||
843 | gk20a_debug_output(o, "NV_PGRAPH_ACTIVITY0: 0x%x\n", | ||
844 | gk20a_readl(g, gr_activity_0_r())); | ||
845 | gk20a_debug_output(o, "NV_PGRAPH_ACTIVITY1: 0x%x\n", | ||
846 | gk20a_readl(g, gr_activity_1_r())); | ||
847 | gk20a_debug_output(o, "NV_PGRAPH_ACTIVITY2: 0x%x\n", | ||
848 | gk20a_readl(g, gr_activity_2_r())); | ||
849 | gk20a_debug_output(o, "NV_PGRAPH_ACTIVITY4: 0x%x\n", | ||
850 | gk20a_readl(g, gr_activity_4_r())); | ||
851 | gk20a_debug_output(o, "NV_PGRAPH_PRI_SKED_ACTIVITY: 0x%x\n", | ||
852 | gk20a_readl(g, gr_pri_sked_activity_r())); | ||
853 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_GPCCS_GPC_ACTIVITY0: 0x%x\n", | ||
854 | gk20a_readl(g, gr_pri_gpc0_gpccs_gpc_activity0_r())); | ||
855 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_GPCCS_GPC_ACTIVITY1: 0x%x\n", | ||
856 | gk20a_readl(g, gr_pri_gpc0_gpccs_gpc_activity1_r())); | ||
857 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_GPCCS_GPC_ACTIVITY2: 0x%x\n", | ||
858 | gk20a_readl(g, gr_pri_gpc0_gpccs_gpc_activity2_r())); | ||
859 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_GPCCS_GPC_ACTIVITY3: 0x%x\n", | ||
860 | gk20a_readl(g, gr_pri_gpc0_gpccs_gpc_activity3_r())); | ||
861 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_TPC0_TPCCS_TPC_ACTIVITY0: 0x%x\n", | ||
862 | gk20a_readl(g, gr_pri_gpc0_tpc0_tpccs_tpc_activity_0_r())); | ||
863 | if (gr->gpc_tpc_count[0] == 2) | ||
864 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_TPC1_TPCCS_TPC_ACTIVITY0: 0x%x\n", | ||
865 | gk20a_readl(g, gr_pri_gpc0_tpc1_tpccs_tpc_activity_0_r())); | ||
866 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_TPCS_TPCCS_TPC_ACTIVITY0: 0x%x\n", | ||
867 | gk20a_readl(g, gr_pri_gpc0_tpcs_tpccs_tpc_activity_0_r())); | ||
868 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPCS_GPCCS_GPC_ACTIVITY0: 0x%x\n", | ||
869 | gk20a_readl(g, gr_pri_gpcs_gpccs_gpc_activity_0_r())); | ||
870 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPCS_GPCCS_GPC_ACTIVITY1: 0x%x\n", | ||
871 | gk20a_readl(g, gr_pri_gpcs_gpccs_gpc_activity_1_r())); | ||
872 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPCS_GPCCS_GPC_ACTIVITY2: 0x%x\n", | ||
873 | gk20a_readl(g, gr_pri_gpcs_gpccs_gpc_activity_2_r())); | ||
874 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPCS_GPCCS_GPC_ACTIVITY3: 0x%x\n", | ||
875 | gk20a_readl(g, gr_pri_gpcs_gpccs_gpc_activity_3_r())); | ||
876 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPCS_TPC0_TPCCS_TPC_ACTIVITY0: 0x%x\n", | ||
877 | gk20a_readl(g, gr_pri_gpcs_tpc0_tpccs_tpc_activity_0_r())); | ||
878 | if (gr->gpc_tpc_count[0] == 2) | ||
879 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPCS_TPC1_TPCCS_TPC_ACTIVITY0: 0x%x\n", | ||
880 | gk20a_readl(g, gr_pri_gpcs_tpc1_tpccs_tpc_activity_0_r())); | ||
881 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPCS_TPCS_TPCCS_TPC_ACTIVITY0: 0x%x\n", | ||
882 | gk20a_readl(g, gr_pri_gpcs_tpcs_tpccs_tpc_activity_0_r())); | ||
883 | gk20a_debug_output(o, "NV_PGRAPH_PRI_BE0_BECS_BE_ACTIVITY0: 0x%x\n", | ||
884 | gk20a_readl(g, gr_pri_be0_becs_be_activity0_r())); | ||
885 | gk20a_debug_output(o, "NV_PGRAPH_PRI_BE1_BECS_BE_ACTIVITY0: 0x%x\n", | ||
886 | gk20a_readl(g, gr_pri_be1_becs_be_activity0_r())); | ||
887 | gk20a_debug_output(o, "NV_PGRAPH_PRI_BES_BECS_BE_ACTIVITY0: 0x%x\n", | ||
888 | gk20a_readl(g, gr_pri_bes_becs_be_activity0_r())); | ||
889 | gk20a_debug_output(o, "NV_PGRAPH_PRI_DS_MPIPE_STATUS: 0x%x\n", | ||
890 | gk20a_readl(g, gr_pri_ds_mpipe_status_r())); | ||
891 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FE_GO_IDLE_ON_STATUS: 0x%x\n", | ||
892 | gk20a_readl(g, gr_pri_fe_go_idle_on_status_r())); | ||
893 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FE_GO_IDLE_TIMEOUT : 0x%x\n", | ||
894 | gk20a_readl(g, gr_fe_go_idle_timeout_r())); | ||
895 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FE_GO_IDLE_CHECK : 0x%x\n", | ||
896 | gk20a_readl(g, gr_pri_fe_go_idle_check_r())); | ||
897 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FE_GO_IDLE_INFO : 0x%x\n", | ||
898 | gk20a_readl(g, gr_pri_fe_go_idle_info_r())); | ||
899 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_TPC0_TEX_M_TEX_SUBUNITS_STATUS: 0x%x\n", | ||
900 | gk20a_readl(g, gr_pri_gpc0_tpc0_tex_m_tex_subunits_status_r())); | ||
901 | gk20a_debug_output(o, "NV_PGRAPH_PRI_CWD_FS: 0x%x\n", | ||
902 | gk20a_readl(g, gr_cwd_fs_r())); | ||
903 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FE_TPC_FS: 0x%x\n", | ||
904 | gk20a_readl(g, gr_fe_tpc_fs_r())); | ||
905 | gk20a_debug_output(o, "NV_PGRAPH_PRI_CWD_GPC_TPC_ID(0): 0x%x\n", | ||
906 | gk20a_readl(g, gr_cwd_gpc_tpc_id_r(0))); | ||
907 | gk20a_debug_output(o, "NV_PGRAPH_PRI_CWD_SM_ID(0): 0x%x\n", | ||
908 | gk20a_readl(g, gr_cwd_sm_id_r(0))); | ||
909 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FECS_CTXSW_STATUS_FE_0: 0x%x\n", | ||
910 | gk20a_readl(g, gr_fecs_ctxsw_status_fe_0_r())); | ||
911 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FECS_CTXSW_STATUS_1: 0x%x\n", | ||
912 | gk20a_readl(g, gr_fecs_ctxsw_status_1_r())); | ||
913 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_GPCCS_CTXSW_STATUS_GPC_0: 0x%x\n", | ||
914 | gk20a_readl(g, gr_gpc0_gpccs_ctxsw_status_gpc_0_r())); | ||
915 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_GPCCS_CTXSW_STATUS_1: 0x%x\n", | ||
916 | gk20a_readl(g, gr_gpc0_gpccs_ctxsw_status_1_r())); | ||
917 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FECS_CTXSW_IDLESTATE : 0x%x\n", | ||
918 | gk20a_readl(g, gr_fecs_ctxsw_idlestate_r())); | ||
919 | gk20a_debug_output(o, "NV_PGRAPH_PRI_GPC0_GPCCS_CTXSW_IDLESTATE : 0x%x\n", | ||
920 | gk20a_readl(g, gr_gpc0_gpccs_ctxsw_idlestate_r())); | ||
921 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FECS_CURRENT_CTX : 0x%x\n", | ||
922 | gk20a_readl(g, gr_fecs_current_ctx_r())); | ||
923 | gk20a_debug_output(o, "NV_PGRAPH_PRI_FECS_NEW_CTX : 0x%x\n", | ||
924 | gk20a_readl(g, gr_fecs_new_ctx_r())); | ||
925 | gk20a_debug_output(o, "NV_PGRAPH_PRI_BE0_CROP_STATUS1 : 0x%x\n", | ||
926 | gk20a_readl(g, gr_pri_be0_crop_status1_r())); | ||
927 | gk20a_debug_output(o, "NV_PGRAPH_PRI_BES_CROP_STATUS1 : 0x%x\n", | ||
928 | gk20a_readl(g, gr_pri_bes_crop_status1_r())); | ||
929 | gk20a_debug_output(o, "NV_PGRAPH_PRI_BE0_ZROP_STATUS : 0x%x\n", | ||
930 | gk20a_readl(g, gr_pri_be0_zrop_status_r())); | ||
931 | gk20a_debug_output(o, "NV_PGRAPH_PRI_BE0_ZROP_STATUS2 : 0x%x\n", | ||
932 | gk20a_readl(g, gr_pri_be0_zrop_status2_r())); | ||
933 | gk20a_debug_output(o, "NV_PGRAPH_PRI_BES_ZROP_STATUS : 0x%x\n", | ||
934 | gk20a_readl(g, gr_pri_bes_zrop_status_r())); | ||
935 | gk20a_debug_output(o, "NV_PGRAPH_PRI_BES_ZROP_STATUS2 : 0x%x\n", | ||
936 | gk20a_readl(g, gr_pri_bes_zrop_status2_r())); | ||
937 | return 0; | ||
938 | } | ||
939 | |||
817 | void gm20b_init_gr(struct gpu_ops *gops) | 940 | void gm20b_init_gr(struct gpu_ops *gops) |
818 | { | 941 | { |
819 | gops->gr.init_gpc_mmu = gr_gm20b_init_gpc_mmu; | 942 | gops->gr.init_gpc_mmu = gr_gm20b_init_gpc_mmu; |
@@ -857,4 +980,5 @@ void gm20b_init_gr(struct gpu_ops *gops) | |||
857 | gops->gr.free_gr_ctx = gr_gk20a_free_gr_ctx; | 980 | gops->gr.free_gr_ctx = gr_gk20a_free_gr_ctx; |
858 | gops->gr.update_ctxsw_preemption_mode = | 981 | gops->gr.update_ctxsw_preemption_mode = |
859 | gr_gm20b_update_ctxsw_preemption_mode; | 982 | gr_gm20b_update_ctxsw_preemption_mode; |
983 | gops->gr.dump_gr_regs = gr_gm20b_dump_gr_status_regs; | ||
860 | } | 984 | } |