gem5 v24.0.0.0
Loading...
Searching...
No Matches
gem5::VncInput Class Reference

#include <vncinput.hh>

Inheritance diagram for gem5::VncInput:
gem5::SimObject gem5::EventManager gem5::Serializable gem5::Drainable gem5::statistics::Group gem5::Named gem5::VncServer

Classes

struct  ClientCutTextMessage
 
struct  FrameBufferUpdateReq
 
struct  KeyEventMessage
 
struct  PixelEncodingsMessage
 
struct  PixelFormat
 
struct  PixelFormatMessage
 
struct  PointerEventMessage
 

Public Types

enum  ClientMessages {
  ClientSetPixelFormat = 0 , ClientSetEncodings = 2 , ClientFrameBufferUpdate = 3 , ClientKeyEvent = 4 ,
  ClientPointerEvent = 5 , ClientCutText = 6
}
 Client -> Server message IDs. More...
 
typedef VncInputParams Params
 
- Public Types inherited from gem5::SimObject
typedef SimObjectParams Params
 

Public Member Functions

 VncInput (const Params &p)
 
virtual void setFrameBuffer (const FrameBuffer *rfb)
 Set the address of the frame buffer we are going to show.
 
void setKeyboard (VncKeyboard *_keyboard)
 Set up the device that would like to receive notifications when keys are pressed in the vnc client keyboard.
 
void setMouse (VncMouse *_mouse)
 Setup the device that would like to receive notifications when mouse movements or button presses are received from the vnc client.
 
uint16_t videoWidth () const
 What is the width of the screen we're displaying.
 
uint16_t videoHeight () const
 What is the height of the screen we're displaying.
 
virtual void setDirty ()
 The frame buffer uses this call to notify the vnc server that the frame buffer has been updated and a new image needs to be sent to the client.
 
- Public Member Functions inherited from gem5::SimObject
const Paramsparams () const
 
 SimObject (const Params &p)
 
virtual ~SimObject ()
 
virtual void init ()
 init() is called after all C++ SimObjects have been created and all ports are connected.
 
virtual void loadState (CheckpointIn &cp)
 loadState() is called on each SimObject when restoring from a checkpoint.
 
virtual void initState ()
 initState() is called on each SimObject when not restoring from a checkpoint.
 
virtual void regProbePoints ()
 Register probe points for this object.
 
virtual void regProbeListeners ()
 Register probe listeners for this object.
 
ProbeManagergetProbeManager ()
 Get the probe manager for this object.
 
virtual PortgetPort (const std::string &if_name, PortID idx=InvalidPortID)
 Get a port with a given name and index.
 
virtual void startup ()
 startup() is the final initialization call before simulation.
 
DrainState drain () override
 Provide a default implementation of the drain interface for objects that don't need draining.
 
virtual void memWriteback ()
 Write back dirty buffers to memory using functional writes.
 
virtual void memInvalidate ()
 Invalidate the contents of memory buffers.
 
void serialize (CheckpointOut &cp) const override
 Serialize an object.
 
void unserialize (CheckpointIn &cp) override
 Unserialize an object.
 
- Public Member Functions inherited from gem5::EventManager
EventQueueeventQueue () const
 
void schedule (Event &event, Tick when)
 
void deschedule (Event &event)
 
void reschedule (Event &event, Tick when, bool always=false)
 
void schedule (Event *event, Tick when)
 
void deschedule (Event *event)
 
void reschedule (Event *event, Tick when, bool always=false)
 
void wakeupEventQueue (Tick when=(Tick) -1)
 This function is not needed by the usual gem5 event loop but may be necessary in derived EventQueues which host gem5 on other schedulers.
 
void setCurTick (Tick newVal)
 
 EventManager (EventManager &em)
 Event manger manages events in the event queue.
 
 EventManager (EventManager *em)
 
 EventManager (EventQueue *eq)
 
- Public Member Functions inherited from gem5::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
void serializeSection (CheckpointOut &cp, const char *name) const
 Serialize an object into a new section.
 
void serializeSection (CheckpointOut &cp, const std::string &name) const
 
void unserializeSection (CheckpointIn &cp, const char *name)
 Unserialize an a child object.
 
void unserializeSection (CheckpointIn &cp, const std::string &name)
 
- Public Member Functions inherited from gem5::Drainable
DrainState drainState () const
 Return the current drain state of an object.
 
virtual void notifyFork ()
 Notify a child process of a fork.
 
- Public Member Functions inherited from gem5::statistics::Group
 Group (Group *parent, const char *name=nullptr)
 Construct a new statistics group.
 
virtual ~Group ()
 
virtual void regStats ()
 Callback to set stat parameters.
 
virtual void resetStats ()
 Callback to reset stats.
 
virtual void preDumpStats ()
 Callback before stats are dumped.
 
void addStat (statistics::Info *info)
 Register a stat with this group.
 
const std::map< std::string, Group * > & getStatGroups () const
 Get all child groups associated with this object.
 
const std::vector< Info * > & getStats () const
 Get all stats associated with this object.
 
void addStatGroup (const char *name, Group *block)
 Add a stat block as a child of this block.
 
const InforesolveStat (std::string name) const
 Resolve a stat by its name within this group.
 
void mergeStatGroup (Group *block)
 Merge the contents (stats & children) of a block to this block.
 
 Group ()=delete
 
 Group (const Group &)=delete
 
Groupoperator= (const Group &)=delete
 
- Public Member Functions inherited from gem5::Named
 Named (const std::string &name_)
 
virtual ~Named ()=default
 
virtual std::string name () const
 

Protected Member Functions

virtual void frameBufferResized ()
 
void captureFrameBuffer ()
 Captures the current frame buffer to a file.
 
- Protected Member Functions inherited from gem5::Drainable
 Drainable ()
 
virtual ~Drainable ()
 
virtual void drainResume ()
 Resume execution after a successful drain.
 
void signalDrainDone () const
 Signal that an object is drained.
 

Protected Attributes

VncKeyboardkeyboard
 The device to notify when we get key events.
 
VncMousemouse
 The device to notify when we get mouse events.
 
const FrameBufferfb
 pointer to the actual data that is stored in the frame buffer device
 
uint16_t _videoWidth
 the width of the frame buffer we are sending to the client
 
uint16_t _videoHeight
 the height of the frame buffer we are sending to the client
 
bool captureEnabled
 Flag indicating whether to capture snapshots of frame buffer or not.
 
int captureCurrentFrame
 Current frame number being captured to a file.
 
OutputDirectorycaptureOutputDirectory
 Directory to store captured frames to.
 
uint64_t captureLastHash
 Computed hash of the last captured frame.
 
std::unique_ptr< ImgWritercaptureImage
 Cached ImgWriter object for writing out frame buffers to file.
 
enums::ImageFormat imgFormat
 image format
 
- Protected Attributes inherited from gem5::SimObject
const SimObjectParams & _params
 Cached copy of the object parameters.
 
- Protected Attributes inherited from gem5::EventManager
EventQueueeventq
 A pointer to this object's event queue.
 

Additional Inherited Members

- Static Public Member Functions inherited from gem5::SimObject
static void serializeAll (const std::string &cpt_dir)
 Create a checkpoint by serializing all SimObjects in the system.
 
static SimObjectfind (const char *name)
 Find the SimObject with the given name and return a pointer to it.
 
static void setSimObjectResolver (SimObjectResolver *resolver)
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints.
 
static SimObjectResolvergetSimObjectResolver ()
 There is a single object name resolver, and it is only set when simulation is restoring from checkpoints.
 
- Static Public Member Functions inherited from gem5::Serializable
static const std::string & currentSection ()
 Gets the fully-qualified name of the active section.
 
static void generateCheckpointOut (const std::string &cpt_dir, std::ofstream &outstream)
 Generate a checkpoint file so that the serialization can be routed to it.
 

Detailed Description

Definition at line 89 of file vncinput.hh.

Member Typedef Documentation

◆ Params

typedef VncInputParams gem5::VncInput::Params

Definition at line 166 of file vncinput.hh.

Member Enumeration Documentation

◆ ClientMessages

Client -> Server message IDs.

Enumerator
ClientSetPixelFormat 
ClientSetEncodings 
ClientFrameBufferUpdate 
ClientKeyEvent 
ClientPointerEvent 
ClientCutText 

Definition at line 94 of file vncinput.hh.

Constructor & Destructor Documentation

◆ VncInput()

Member Function Documentation

◆ captureFrameBuffer()

void gem5::VncInput::captureFrameBuffer ( )
protected

◆ frameBufferResized()

virtual void gem5::VncInput::frameBufferResized ( )
inlineprotectedvirtual

Reimplemented in gem5::VncServer.

Definition at line 209 of file vncinput.hh.

Referenced by setDirty().

◆ setDirty()

void gem5::VncInput::setDirty ( )
virtual

The frame buffer uses this call to notify the vnc server that the frame buffer has been updated and a new image needs to be sent to the client.

Reimplemented in gem5::VncServer.

Definition at line 93 of file vncinput.cc.

References _videoHeight, _videoWidth, captureEnabled, captureFrameBuffer(), DPRINTF, fb, frameBufferResized(), gem5::FrameBuffer::height(), gem5::ArmISA::width, and gem5::FrameBuffer::width().

Referenced by gem5::Pl111::dmaDone(), gem5::HDLcd::drainResume(), gem5::HDLcd::pxlFrameDone(), gem5::VncServer::setDirty(), setFrameBuffer(), and gem5::Pl111::unserialize().

◆ setFrameBuffer()

void gem5::VncInput::setFrameBuffer ( const FrameBuffer * rfb)
virtual

Set the address of the frame buffer we are going to show.

To avoid copying, just have the display controller tell us where the data is instead of constanly copying it around

Parameters
rfbframe buffer that we're going to use

Definition at line 74 of file vncinput.cc.

References captureEnabled, captureImage, gem5::createImgWriter(), fb, imgFormat, panic, and setDirty().

Referenced by gem5::Pl111::updateVideoParams().

◆ setKeyboard()

void gem5::VncInput::setKeyboard ( VncKeyboard * _keyboard)
inline

Set up the device that would like to receive notifications when keys are pressed in the vnc client keyboard.

Parameters
_keyboardan object that derrives from VncKeyboard

Definition at line 180 of file vncinput.hh.

References keyboard.

◆ setMouse()

void gem5::VncInput::setMouse ( VncMouse * _mouse)
inline

Setup the device that would like to receive notifications when mouse movements or button presses are received from the vnc client.

Parameters
_mousean object that derrives from VncMouse

Definition at line 186 of file vncinput.hh.

References mouse.

Referenced by gem5::ps2::TouchKit::TouchKit().

◆ videoHeight()

uint16_t gem5::VncInput::videoHeight ( ) const
inline

What is the height of the screen we're displaying.

This is used for pointer/tablet devices that need to know to calculate the correct value to send to the device driver.

Returns
the height of the simulated screen

Definition at line 200 of file vncinput.hh.

References _videoHeight.

Referenced by gem5::ps2::TouchKit::mouseAt(), gem5::VncServer::sendFrameBufferResized(), gem5::VncServer::sendFrameBufferUpdate(), and gem5::VncServer::sendServerInit().

◆ videoWidth()

uint16_t gem5::VncInput::videoWidth ( ) const
inline

What is the width of the screen we're displaying.

This is used for pointer/tablet devices that need to know to calculate the correct value to send to the device driver.

Returns
the width of the simulated screen

Definition at line 193 of file vncinput.hh.

References _videoWidth.

Referenced by gem5::ps2::TouchKit::mouseAt(), gem5::VncServer::sendFrameBufferResized(), gem5::VncServer::sendFrameBufferUpdate(), and gem5::VncServer::sendServerInit().

Member Data Documentation

◆ _videoHeight

uint16_t gem5::VncInput::_videoHeight
protected

the height of the frame buffer we are sending to the client

Definition at line 224 of file vncinput.hh.

Referenced by setDirty(), and videoHeight().

◆ _videoWidth

uint16_t gem5::VncInput::_videoWidth
protected

the width of the frame buffer we are sending to the client

Definition at line 221 of file vncinput.hh.

Referenced by setDirty(), and videoWidth().

◆ captureCurrentFrame

int gem5::VncInput::captureCurrentFrame
protected

Current frame number being captured to a file.

Definition at line 230 of file vncinput.hh.

Referenced by captureFrameBuffer().

◆ captureEnabled

bool gem5::VncInput::captureEnabled
protected

Flag indicating whether to capture snapshots of frame buffer or not.

Definition at line 227 of file vncinput.hh.

Referenced by setDirty(), setFrameBuffer(), and VncInput().

◆ captureImage

std::unique_ptr<ImgWriter> gem5::VncInput::captureImage
protected

Cached ImgWriter object for writing out frame buffers to file.

Definition at line 239 of file vncinput.hh.

Referenced by captureFrameBuffer(), and setFrameBuffer().

◆ captureLastHash

uint64_t gem5::VncInput::captureLastHash
protected

Computed hash of the last captured frame.

Definition at line 236 of file vncinput.hh.

Referenced by captureFrameBuffer().

◆ captureOutputDirectory

OutputDirectory* gem5::VncInput::captureOutputDirectory
protected

Directory to store captured frames to.

Definition at line 233 of file vncinput.hh.

Referenced by captureFrameBuffer(), and VncInput().

◆ fb

const FrameBuffer* gem5::VncInput::fb
protected

pointer to the actual data that is stored in the frame buffer device

Definition at line 218 of file vncinput.hh.

Referenced by captureFrameBuffer(), gem5::VncServer::sendFrameBufferResized(), gem5::VncServer::sendFrameBufferUpdate(), setDirty(), and setFrameBuffer().

◆ imgFormat

enums::ImageFormat gem5::VncInput::imgFormat
protected

image format

Definition at line 242 of file vncinput.hh.

Referenced by setFrameBuffer().

◆ keyboard

VncKeyboard* gem5::VncInput::keyboard
protected

The device to notify when we get key events.

Definition at line 212 of file vncinput.hh.

Referenced by gem5::VncServer::recvKeyboardInput(), and setKeyboard().

◆ mouse

VncMouse* gem5::VncInput::mouse
protected

The device to notify when we get mouse events.

Definition at line 215 of file vncinput.hh.

Referenced by gem5::VncServer::recvPointerInput(), and setMouse().


The documentation for this class was generated from the following files:

Generated on Tue Jun 18 2024 16:24:15 for gem5 by doxygen 1.11.0