dev: Add an underrun statistic to the HDLCD controller
Add a stat that counts buffer underruns in the HDLCD controller. The stat counts at most one underrun per frame since the controller aborts the current frame if it underruns.
This commit is contained in:
@@ -94,6 +94,18 @@ HDLcd::~HDLcd()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
HDLcd::regStats()
|
||||
{
|
||||
using namespace Stats;
|
||||
|
||||
stats.underruns
|
||||
.name(name() + ".underruns")
|
||||
.desc("number of buffer underruns")
|
||||
.flags(nozero)
|
||||
;
|
||||
}
|
||||
|
||||
void
|
||||
HDLcd::serialize(CheckpointOut &cp) const
|
||||
{
|
||||
@@ -503,6 +515,7 @@ void
|
||||
HDLcd::pxlUnderrun()
|
||||
{
|
||||
DPRINTF(HDLcd, "Buffer underrun, stopping DMA fill.\n");
|
||||
++stats.underruns;
|
||||
intRaise(INT_UNDERRUN);
|
||||
dmaEngine->abortFrame();
|
||||
}
|
||||
|
||||
@@ -95,6 +95,8 @@ class HDLcd: public AmbaDmaDevice
|
||||
HDLcd(const HDLcdParams *p);
|
||||
~HDLcd();
|
||||
|
||||
void regStats() M5_ATTR_OVERRIDE;
|
||||
|
||||
void serialize(CheckpointOut &cp) const M5_ATTR_OVERRIDE;
|
||||
void unserialize(CheckpointIn &cp) M5_ATTR_OVERRIDE;
|
||||
|
||||
@@ -381,6 +383,11 @@ class HDLcd: public AmbaDmaDevice
|
||||
};
|
||||
|
||||
std::unique_ptr<DmaEngine> dmaEngine;
|
||||
|
||||
protected: // Statistics
|
||||
struct {
|
||||
Stats::Scalar underruns;
|
||||
} stats;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user