dev: Using Configurable image writer in HDLcd

The fixed image writer (which was dumping .bmp images only) has been
replaced by the configurable one in HDLcd device.  Default format is
Auto, which gives gem5 the freedom to choose the format it prefers.

Change-Id: I0643266556bb10b43cdebd628f6daa2cd5e105dd
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/5183
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
This commit is contained in:
Giacomo Travaglini
2017-09-28 11:50:07 +01:00
parent c4d1ae831f
commit fd16487b71
3 changed files with 17 additions and 6 deletions

View File

@@ -47,6 +47,7 @@
#include "debug/HDLcd.hh"
#include "dev/arm/amba_device.hh"
#include "dev/arm/base_gic.hh"
#include "enums/ImageFormat.hh"
#include "mem/packet.hh"
#include "mem/packet_access.hh"
#include "params/HDLcd.hh"
@@ -85,11 +86,13 @@ HDLcd::HDLcd(const HDLcdParams *p)
virtRefreshEvent([this]{ virtRefresh(); }, name()),
// Other
bmp(&pixelPump.fb), pic(NULL), conv(PixelConverter::rgba8888_le),
imgFormat(p->frame_format), pic(NULL), conv(PixelConverter::rgba8888_le),
pixelPump(*this, *p->pxl_clk, p->pixel_chunk)
{
if (vnc)
vnc->setFrameBuffer(&pixelPump.fb);
imgWriter = createImgWriter(imgFormat, &pixelPump.fb);
}
HDLcd::~HDLcd()
@@ -572,13 +575,14 @@ HDLcd::pxlFrameDone()
if (enableCapture) {
if (!pic) {
pic = simout.create(
csprintf("%s.framebuffer.bmp", sys->name()),
csprintf("%s.framebuffer.%s",
sys->name(), imgWriter->getImgExtension()),
true);
}
assert(pic);
pic->stream()->seekp(0);
bmp.write(*pic->stream());
imgWriter->write(*pic->stream());
}
}