ARM: pl111/LCD framebuffer checkpointing fix
authorChander Sudanthi <Chander.Sudanthi@arm.com>
Mon, 7 Jan 2013 18:05:39 +0000 (13:05 -0500)
committerChander Sudanthi <Chander.Sudanthi@arm.com>
Mon, 7 Jan 2013 18:05:39 +0000 (13:05 -0500)
Fixed check pointing of the framebuffer.  Previously, the pixel size was not
considered in determining the size of the buffer to checkpoint.  This patch
checkpoints the entire framebuffer instead of the first quarter.

src/dev/arm/pl111.cc
src/dev/arm/pl111.hh

index cd1f0027278921ed95b4854a44814a8a2752161b..acb3b7dd8d625b0202e21ebf4adaf837a4deb156 100644 (file)
@@ -76,7 +76,6 @@ Pl111::Pl111(const Params *p)
 
     pic = simout.create(csprintf("%s.framebuffer.bmp", sys->name()), true);
 
-    const int buffer_size = LcdMaxWidth * LcdMaxHeight * sizeof(uint32_t);
     dmaBuffer = new uint8_t[buffer_size];
 
     memset(lcdPalette, 0, sizeof(lcdPalette));
@@ -581,7 +580,7 @@ Pl111::serialize(std::ostream &os)
     SERIALIZE_SCALAR(width);
     SERIALIZE_SCALAR(bytesPerPixel);
 
-    SERIALIZE_ARRAY(dmaBuffer, height * width);
+    SERIALIZE_ARRAY(dmaBuffer, buffer_size);
     SERIALIZE_SCALAR(startTime);
     SERIALIZE_SCALAR(startAddr);
     SERIALIZE_SCALAR(maxAddr);
@@ -683,7 +682,7 @@ Pl111::unserialize(Checkpoint *cp, const std::string &section)
     UNSERIALIZE_SCALAR(width);
     UNSERIALIZE_SCALAR(bytesPerPixel);
 
-    UNSERIALIZE_ARRAY(dmaBuffer, height * width);
+    UNSERIALIZE_ARRAY(dmaBuffer, buffer_size);
     UNSERIALIZE_SCALAR(startTime);
     UNSERIALIZE_SCALAR(startAddr);
     UNSERIALIZE_SCALAR(maxAddr);
index 2245d81246141be6343f7ca6263b6aa1c0c711cb..855fb8bef5fbe2e1f94ac4b0f8de6234e6c60b3b 100644 (file)
@@ -96,6 +96,8 @@ class Pl111: public AmbaDmaDevice
     static const int dmaSize            = 8;    // 64 bits
     static const int maxOutstandingDma  = 16;   // 16 deep FIFO of 64 bits
 
+    static const int buffer_size = LcdMaxWidth * LcdMaxHeight * sizeof(uint32_t);
+
     enum LcdMode {
         bpp1 = 0,
         bpp2,