38#ifndef __DEV_PIXELPUMP_HH__
39#define __DEV_PIXELPUMP_HH__
49struct BasePixelPumpParams;
66 unsigned hbp,
unsigned h_sync,
unsigned hfp,
67 unsigned vbp,
unsigned v_sync,
unsigned vfp);
169 unsigned pixel_chunk);
316 const std::string
name()
const override {
return _name; }
Callback helper class with suspend support.
PixelEvent(const char *name, BasePixelPump *parent, CallbackType func)
DrainState drain() override
Draining is the process of clearing out the states of SimObjects.These are the SimObjects that are pa...
void unserialize(CheckpointIn &cp) override
Unserialize an object.
void drainResume() override
Resume execution after a successful drain.
void(BasePixelPump::* CallbackType)()
void serialize(CheckpointOut &cp) const override
Serialize an object.
const std::string name() const override
Timing generator for a pixel-based display.
void stop()
Immediately stop pushing pixels.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
unsigned posX() const
Current pixel position within the visible area.
bool active() const
Is the pixel pump active and refreshing the display?
std::vector< PixelEvent * > pixelEvents
Convenience vector when doing operations on all events.
void updateTimings(const DisplayTimings &timings)
Update frame size using display timing.
FrameBuffer fb
Output frame buffer.
virtual void onHSyncEnd()
Start of the first pixel after the HSync region.
virtual void onVSyncBegin()
First pixel clock of the first VSync line.
BasePixelPump(EventManager &em, ClockDomain &pxl_clk, unsigned pixel_chunk)
const unsigned pixelChunk
Maximum number of pixels to handle per render callback.
bool _underrun
Did a buffer underrun occur within this refresh interval?
virtual void onVSyncEnd()
Callback on the first pixel of the line after the end VSync region (typically the first pixel of the ...
void serialize(CheckpointOut &cp) const override
Serialize an object.
virtual size_t nextLine(std::vector< Pixel >::iterator ps, size_t line_length)
Get the next line of pixels directly from memory.
PixelEvent evRenderPixels
bool visibleLine() const
Is the current line within the visible range?
void start()
Starting pushing pixels in timing mode.
virtual void onHSyncBegin()
Start of the HSync region.
bool underrun() const
Did a buffer underrun occur within this refresh interval?
void renderLine()
Fast and event-free line rendering function.
virtual bool nextPixel(Pixel &p)=0
Get the next pixel from the scan line buffer.
void renderFrame()
Render an entire frame in non-caching mode.
unsigned posY() const
Current pixel position within the visible area.
const DisplayTimings & timings() const
Get a constant reference of the current display timings.
virtual void onUnderrun(unsigned x, unsigned y)
Buffer underrun occurred on a frame.
unsigned line
Current line (including back porch, front porch, and vsync) within a frame.
unsigned _posX
X-coordinate within the visible region of a frame.
virtual void onFrameDone()
Finished displaying the visible region of a frame.
The ClockDomain provides clock to group of clocked objects bundled under the same clock domain.
Helper class for objects that need to be clocked.
Cycles is a wrapper class for representing cycle counts, i.e.
Interface for objects that might require draining before checkpointing.
Internal gem5 representation of a frame buffer.
Basic support for object serialization.
ClockedObject declaration and implementation.
DrainState
Object drain/handover states.
bool scheduled() const
Determine if the current event is scheduled.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
std::ostream CheckpointOut
uint64_t Tick
Tick count type.
unsigned vSync
Vertical sync signal in lines.
Cycles cyclesPerFrame() const
How many pixel clocks are required for one frame?
void unserialize(CheckpointIn &cp) override
Unserialize an object.
unsigned linesPerFrame() const
Calculate the total number of lines in a frame.
unsigned height
Display height in pixels.
unsigned width
Display width in pixels.
unsigned lineVBackPorchStart() const
Calculate the first line of the vertical back porch.
unsigned hFrontPorch
Horizontal front porch in pixels.
unsigned lineFrontPorchStart() const
Calculate the first line of the back porch.
unsigned hSync
Horizontal sync signal length in pixels.
void serialize(CheckpointOut &cp) const override
Serialize an object.
static const DisplayTimings vga
Cycles cyclesPerLine() const
How many pixel clocks are required for one line?
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.
unsigned vFrontPorch
Vertical front porch in lines.
unsigned hBackPorch
Horizontal back porch in pixels.
unsigned vBackPorch
Vertical back porch in lines.
unsigned lineVSyncStart() const
Calculate the first line of the vsync signal.
unsigned lineFirstVisible() const
Calculate the first line of the visible region.
Internal gem5 representation of a Pixel.