osDpGetCounters.3p 1.47 KB
.TH osDpGetCounters 3P local "Silicon Graphics, Inc."
.SH NAME
.upperok
osDpGetCounters \-
Get internal performance counters from the display processor (DP)
.SH SYNOPSIS
.nf
\f3
.Op c
#include <ultra64.h>
.sp .8v
void osDpGetCounters(u32 *array);
.Op
\f1
.fi
.SH DESCRIPTION
This routine returns the values of four internal DP counters.
The
.I array
parameter must point to a buffer that is large enough to hold
four 32 bit values.
The first element of the array is the 
.I CLOCK
counter.
This counter is incremented by the free running RCP clock.
For NTSC systems,
this counter increments at 60.85 Mhz and each counter
tick represents approximately 16.43 nanoseconds.
For PAL systems,
this counter increments at 62.07 Mhz and each counter
tick represents approximately 16.11 nanoseconds.
The second element is the
.I CMD
counter.
This counter is incremented once every clock cycle when the RDP has work
to do.
The RSP places RDP commands in a fifo for execution.
If this fifo is not empty, the counter is incremented.
The third element is the
.I PIPE
counter.
This counter is incremented when the internal RDP pipeline is not stalled while 
waiting for memory accesses to occur.
The last element is the
.I TMEM
counter.
This counter is incremented when the texture memory is being loaded.
.PP
The counters can be individually cleared using the
.I osDpSetStatus
command, with 
.I DPC_CLR_TMEM_CTR, DPC_CLR_PIPE_CTR, DPC_CLR_CMD_CTR
, and
.I DPC_CLR_CLOCK_CTR
status bits.
.SH SEE ALSO
.IR osDpSetStatus (3P)