38 #ifndef __DEV_PIXELPUMP_HH__ 39 #define __DEV_PIXELPUMP_HH__ 44 struct BasePixelPumpParams;
61 unsigned hbp,
unsigned h_sync,
unsigned hfp,
62 unsigned vbp,
unsigned v_sync,
unsigned vfp);
150 unsigned pixel_chunk);
173 bool active()
const {
return evBeginLine.active(); }
180 return line >= _timings.lineFirstVisible() &&
181 line < _timings.lineFrontPorchStart();
185 unsigned posX()
const {
return _posX; }
189 return visibleLine() ? line - _timings.lineFirstVisible() : 0;
202 virtual bool nextPixel(
Pixel &
p) = 0;
242 virtual void onFrameDone() {};
266 void drainResume()
override;
271 const std::string
name()
const override {
return _name; }
276 bool active()
const {
return scheduled() || suspended; }
320 #endif // __DEV_PIXELPUMP_HH__ unsigned lineFrontPorchStart() const
Calculate the first line of the back porch.
unsigned vSync
Vertical sync signal in lines.
std::vector< PixelEvent * > pixelEvents
Convenience vector when doing operations on all events.
Timing generator for a pixel-based display.
Cycles is a wrapper class for representing cycle counts, i.e.
Internal gem5 representation of a frame buffer.
unsigned lineVSyncStart() const
Calculate the first line of the vsync signal.
const std::string & name()
bool _underrun
Did a buffer underrun occur within this refresh interval?
virtual void onHSyncBegin()
Start of the HSync region.
unsigned posX() const
Current pixel position within the visible area.
unsigned line
Current line (including back porch, front porch, and vsync) within a frame.
Cycles cyclesPerFrame() const
How many pixel clocks are required for one frame?
bool underrun() const
Did a buffer underrun occur within this refresh interval?
unsigned hBackPorch
Horizontal back porch in pixels.
unsigned vFrontPorch
Vertical front porch in lines.
const DisplayTimings & timings() const
Get a constant reference of the current display timings.
Cycles cyclesPerLine() const
How many pixel clocks are required for one line?
DrainState
Object drain/handover states.
const std::string name() const override
Callback helper class with suspend support.
unsigned lineVBackPorchStart() const
Calculate the first line of the vertical back porch.
Interface for objects that might require draining before checkpointing.
virtual void onUnderrun(unsigned x, unsigned y)
Buffer underrun occurred on a frame.
bool active() const
Is the pixel pump active and refreshing the display?
unsigned linesPerFrame() const
Calculate the total number of lines in a frame.
virtual void onVSyncEnd()
Callback on the first pixel of the line after the end VSync region (typically the first pixel of the ...
virtual void onHSyncEnd()
Start of the first pixel after the HSync region.
uint64_t Tick
Tick count type.
unsigned posY() const
Current pixel position within the visible area.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
ClockedObject declaration and implementation.
unsigned _posX
X-coordinate within the visible region of a frame.
FrameBuffer fb
Output frame buffer.
unsigned lineFirstVisible() const
Calculate the first line of the visible region.
virtual void onVSyncBegin()
First pixel clock of the first VSync line.
Helper class for objects that need to be clocked.
unsigned height
Display height in pixels.
Basic support for object serialization.
PixelEvent evRenderPixels
const unsigned pixelChunk
Maximum number of pixels to handle per render callback.
unsigned hFrontPorch
Horizontal front porch in pixels.
unsigned hSync
Horizontal sync signal length in pixels.
void serialize(CheckpointOut &cp) const override
Serialize an object.
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain...
std::ostream CheckpointOut
unsigned vBackPorch
Vertical back porch in lines.
static const DisplayTimings vga
Internal gem5 representation of a Pixel.
unsigned width
Display width in pixels.
DisplayTimings(unsigned width, unsigned height, unsigned hbp, unsigned h_sync, unsigned hfp, unsigned vbp, unsigned v_sync, unsigned vfp)
Create a display timing configuration struct.
bool visibleLine() const
Is the current line within the visible range?