1 /*---------------------------------------------------------------------------*
2   Project:  Dolphin GX library
3   File:     GXPerf.h
4 
5   Copyright 1998- 2002 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Log: GXPerf.h,v $
14   Revision 1.2  2006/02/04 11:56:46  hashida
15   (none)
16 
17   Revision 1.1.1.1  2005/12/29 06:53:28  hiratsu
18   Initial import.
19 
20   Revision 1.1.1.1  2005/05/12 02:41:07  yasuh-to
21   Ported from dolphin source tree.
22 
23 
24     9     2004/03/31 15:32 Hirose
25     Added __GXSetBWDials().
26 
27     8     2002/07/24 9:07 Hirose
28     Resolved version conflicts.
29 
30     7     2001/03/02 1:49p Carl
31     Added GXReadClksPerVtx
32 
33     6     2000/08/23 2:53p Alligator
34     allow perf counter api to work with draw sync callback
35 
36     5     2000/07/05 2:05p Tian
37     Added GXResetCPMetrics and GXInitXfRasMetric.  Changed
38     GXReadXfRasMetric to not write to pipe.
39 
40     4     2000/06/30 8:40p Alligator
41     added GXReadXfRasMetric
42 
43     3     2000/06/06 6:57p Alligator
44     added vcache mem and stall counters
45 
46     2     2000/06/06 12:02p Alligator
47     made changes to perf counter api
48 
49     1     2000/04/17 12:49p Alligator
50   $NoKeywords: $
51  *---------------------------------------------------------------------------*/
52 
53 #ifndef __GXPERF_H__
54 #define __GXPERF_H__
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /*---------------------------------------------------------------------------*/
61 #include <revolution/types.h>
62 #include <revolution/gx/GXEnum.h>
63 
64 /*---------------------------------------------------------------------------*/
65 void GXSetGPMetric     (  GXPerf0       perf0,
66                           GXPerf1       perf1 );
67 
68 void GXClearGPMetric   (  void );
69 
70 void GXReadGPMetric    (  u32*          cnt0,
71                           u32*          cnt1 );
72 
73 
74 #define GXSetGP0Metric(perf0)    GXSetGPMetric((perf0), GX_PERF1_NONE)
75 
76 #define GXClearGP0Metric()       GXClearGPMetric()
77 
78 u32  GXReadGP0Metric   ( void );
79 
80 
81 #define GXSetGP1Metric(perf1)    GXSetGPMetric(GX_PERF0_NONE, (perf1))
82 
83 #define GXClearGP1Metric()       GXClearGPMetric()
84 
85 u32  GXReadGP1Metric   ( void );
86 
87 
88 void GXReadMemMetric   ( u32*           cp_req,
89                          u32*           tc_req,
90                          u32*           cpu_rd_req,
91                          u32*           cpu_wr_req,
92                          u32*           dsp_req,
93                          u32*           io_req,
94                          u32*           vi_req,
95                          u32*           pe_req,
96                          u32*           rf_req,
97                          u32*           fi_req );
98 
99 void GXClearMemMetric  ( void );
100 
101 
102 void GXReadPixMetric   (  u32*          top_pixels_in,
103                           u32*          top_pixels_out,
104                           u32*          bot_pixels_in,
105                           u32*          bot_pixels_out,
106                           u32*          clr_pixels_in,
107                           u32*          copy_clks );
108 
109 void GXClearPixMetric  (  void  );
110 
111 
112 void GXSetVCacheMetric  ( GXVCachePerf  attr );
113 
114 void GXReadVCacheMetric ( u32*          check,
115                           u32*          miss,
116                           u32*          stall );
117 
118 void GXClearVCacheMetric ( void );
119 
120 
121 // DO NOT use with GXReadGP*Metric
122 void GXReadXfRasMetric  ( u32*          xf_wait_in,
123                           u32*          xf_wait_out,
124                           u32*          ras_busy,
125                           u32*          clocks );
126 
127 // DO NOT use with GXReadGP*Metric
128 void GXInitXfRasMetric();
129 
130 
131 u32 GXReadClksPerVtx( void );
132 
133 /*---------------------------------------------------------------------------*/
134 
135 void __GXSetBWDials     ( u16           cpDial,
136                           u16           tcDial,
137                           u16           peDial,
138                           u16           cpuRdDial,
139                           u16           cpuWrDial );
140 
141 /*---------------------------------------------------------------------------*/
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif // __GXPERF_H__
147