summaryrefslogtreecommitdiff
path: root/src/base/vnc/vncserver.hh
diff options
context:
space:
mode:
authorAndreas Sandberg <andreas.sandberg@arm.com>2015-05-23 13:37:03 +0100
committerAndreas Sandberg <andreas.sandberg@arm.com>2015-05-23 13:37:03 +0100
commitdb5c9a5f9028fd87a74e1750068511bd311435ae (patch)
treed2d2125ce8f717355187c767599945ad354470e9 /src/base/vnc/vncserver.hh
parent1985d28ef905753423b3ee407c8bf4ee9165302b (diff)
downloadgem5-db5c9a5f9028fd87a74e1750068511bd311435ae.tar.xz
base: Redesign internal frame buffer handling
Currently, frame buffer handling in gem5 is quite ad hoc. In practice, we pass around naked pointers to raw pixel data and expect consumers to convert frame buffers using the (broken) VideoConverter. This changeset completely redesigns the way we handle frame buffers internally. In summary, it fixes several color conversion bugs, adds support for more color formats (e.g., big endian), and makes the code base easier to follow. In the new world, gem5 always represents pixel data using the Pixel struct when pixels need to be passed between different classes (e.g., a display controller and the VNC server). Producers of entire frames (e.g., display controllers) should use the FrameBuffer class to represent a frame. Frame producers are expected to create one instance of the FrameBuffer class in their constructors and register it with its consumers once. Consumers are expected to check the dimensions of the frame buffer when they consume it. Conversion between the external representation and the internal representation is supported for all common "true color" RGB formats of up to 32-bit color depth. The external pixel representation is expected to be between 1 and 4 bytes in either big endian or little endian. Color channels are assumed to be contiguous ranges of bits within each pixel word. The external pixel value is scaled to an 8-bit internal representation using a floating multiplication to map it to the entire 8-bit range.
Diffstat (limited to 'src/base/vnc/vncserver.hh')
-rw-r--r--src/base/vnc/vncserver.hh24
1 files changed, 5 insertions, 19 deletions
diff --git a/src/base/vnc/vncserver.hh b/src/base/vnc/vncserver.hh
index cd1f186f5..0222a7726 100644
--- a/src/base/vnc/vncserver.hh
+++ b/src/base/vnc/vncserver.hh
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2010 ARM Limited
+ * Copyright (c) 2010, 2015 ARM Limited
* All rights reserved
*
* The license below extends only to copyright in the software and shall
@@ -47,7 +47,6 @@
#include <iostream>
-#include "base/vnc/convert.hh"
#include "base/vnc/vncinput.hh"
#include "base/bitmap.hh"
#include "base/circlebuf.hh"
@@ -305,24 +304,11 @@ class VncServer : public VncInput
*/
void sendFrameBufferResized();
- public:
- /** 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
- */
- void
- setDirty()
- {
- VncInput::setDirty();
- sendUpdate = true;
- sendFrameBufferUpdate();
- }
+ static const PixelConverter pixelConverter;
- /** Set the mode of the data the frame buffer will be sending us
- * @param mode the mode
- */
- void setFrameBufferParams(VideoConvert::Mode mode, uint16_t width,
- uint16_t height);
+ public:
+ void setDirty() M5_ATTR_OVERRIDE;
+ void frameBufferResized() M5_ATTR_OVERRIDE;
};
#endif