52 unsigned hbp,
unsigned h_sync,
unsigned hfp,
53 unsigned vbp,
unsigned v_sync,
unsigned vfp)
122 event->serializeSection(
cp,
event->name());
139 event->unserializeSection(
cp,
event->name());
145 panic_if(
active(),
"Trying to update timings in active PixelPump\n");
200 const Cycles h_sync_begin(0);
224 const unsigned pxl_count(x_end -
_posX);
225 const unsigned pos_y(
posY());
227 Pixel pixel(0, 0, 0);
228 const Pixel underrun_pixel(0, 0, 0);
231 warn(
"Input buffer underrun in BasePixelPump (%u, %u)\n",
235 pixel = underrun_pixel;
237 fb.pixel(
_posX, pos_y) = pixel;
243 fb.pixel(
_posX, pos_y) = underrun_pixel;
289 const unsigned pos_y =
posY();
290 const size_t _width =
fb.width();
292 auto pixel_it =
fb.pixels.begin() + _width * pos_y;
294 "Unexpected underrun in BasePixelPump (%u, %u)", _width, pos_y);
305 parent.pixelEvents.push_back(
this);
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
void stop()
Immediately stop pushing pixels.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
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
void start()
Starting pushing pixels in timing mode.
virtual void onHSyncBegin()
Start of the HSync region.
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.
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
Clocked(ClockDomain &clk_domain)
Create a clocked object and set the clock domain based on the parameters.
Cycles is a wrapper class for representing cycle counts, i.e.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Event(Priority p=Default_Pri, Flags f=0)
void serialize(CheckpointOut &cp) const override
Serialize an object.
DrainState
Object drain/handover states.
@ Drained
Buffers drained, ready for serialization/handover.
void deschedule(Event &event)
bool scheduled() const
Determine if the current event is scheduled.
void schedule(Event &event, Tick when)
EventManager(EventManager &em)
Event manger manages events in the event queue.
Tick when() const
Get the time that the event is scheduled.
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
#define UNSERIALIZE_OBJ(obj)
#define SERIALIZE_OBJ(obj)
This macro serializes an object into its own section.
Copyright (c) 2024 Arm Limited All rights reserved.
Tick curTick()
The universal simulation clock.
std::ostream CheckpointOut
#define UNSERIALIZE_SCALAR(scalar)
#define SERIALIZE_SCALAR(scalar)
unsigned vSync
Vertical sync signal in lines.
void unserialize(CheckpointIn &cp) override
Unserialize an object.
unsigned height
Display height in pixels.
unsigned width
Display width in pixels.
unsigned hFrontPorch
Horizontal front porch in pixels.
unsigned hSync
Horizontal sync signal length in pixels.
void serialize(CheckpointOut &cp) const override
Serialize an object.
static const DisplayTimings vga
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.
Internal gem5 representation of a Pixel.