dev: Add option to disable framebuffer .bmp dump in run folder
authorDam Sunwoo <dam.sunwoo@arm.com>
Thu, 17 Oct 2013 15:20:45 +0000 (10:20 -0500)
committerDam Sunwoo <dam.sunwoo@arm.com>
Thu, 17 Oct 2013 15:20:45 +0000 (10:20 -0500)
There is an option to enable/disable all framebuffer dumps, but the
last frame always gets dumped in the run folder with no other way to
disable it. These files can add up very quickly running many experiments.

This patch adds an option to disable them. The default behavior
remains unchanged.

src/dev/arm/RealView.py
src/dev/arm/hdlcd.cc
src/dev/arm/hdlcd.hh
src/dev/arm/pl111.cc
src/dev/arm/pl111.hh

index 167108850ec6aacfa8419f314b2293c6df62d0e3..b3c14580eacb2f4f840ee53a24f1cc313748ddcb 100644 (file)
@@ -139,6 +139,8 @@ class Pl111(AmbaDmaDevice):
     pixel_clock = Param.Clock('24MHz', "Pixel clock")
     vnc   = Param.VncInput(Parent.any, "Vnc server for remote frame buffer display")
     amba_id = 0x00141111
+    enable_capture = Param.Bool(True, "capture frame to system.framebuffer.bmp")
+
 
 class HDLcd(AmbaDmaDevice):
     type = 'HDLcd'
@@ -149,6 +151,7 @@ class HDLcd(AmbaDmaDevice):
     vnc = Param.VncInput(Parent.any, "Vnc server for remote frame buffer "
                                      "display")
     amba_id = 0x00141000
+    enable_capture = Param.Bool(True, "capture frame to system.framebuffer.bmp")
 
 class RealView(Platform):
     type = 'RealView'
index c5daebc9be6bcc952c999548602fca8424b9533d..349b246c263fae202e1cfb7a50e6e5594eff8c13 100644 (file)
@@ -72,7 +72,8 @@ HDLcd::HDLcd(const Params *p)
       startFrameEvent(this), endFrameEvent(this), renderPixelEvent(this),
       fillPixelBufferEvent(this), intEvent(this),
       dmaDoneEventAll(MAX_OUTSTANDING_DMA_REQ_CAPACITY, this),
-      dmaDoneEventFree(MAX_OUTSTANDING_DMA_REQ_CAPACITY)
+      dmaDoneEventFree(MAX_OUTSTANDING_DMA_REQ_CAPACITY),
+      enableCapture(p->enable_capture)
 {
     pioSize = 0xFFFF;
 
@@ -560,13 +561,15 @@ HDLcd::endFrame() {
     if (vnc)
         vnc->setDirty();
 
-    if (!pic)
-        pic = simout.create(csprintf("%s.framebuffer.bmp", sys->name()), true);
+    if (enableCapture) {
+        if (!pic)
+            pic = simout.create(csprintf("%s.framebuffer.bmp", sys->name()), true);
 
-    assert(bmp);
-    assert(pic);
-    pic->seekp(0);
-    bmp->write(pic);
+        assert(bmp);
+        assert(pic);
+        pic->seekp(0);
+        bmp->write(pic);
+    }
 
     // start the next frame
     frameUnderway = false;
index ab4df5ed66d327a974c651257f94c4207f4153f6..ba22cc1639c6110b9a25ad7e979ed247a30320eb 100644 (file)
@@ -474,6 +474,8 @@ class HDLcd: public AmbaDmaDevice
     std::vector<DmaDoneEvent *> dmaDoneEventFree;
     /**@}*/
 
+    bool enableCapture;
+
   public:
     typedef HDLcdParams Params;
 
index c3d684f29ea880675e0fd6bf2a1d4db0beb4c038..6abc9b4acf53c4e0517161bfd58891dd2e1715f4 100644 (file)
@@ -69,7 +69,7 @@ Pl111::Pl111(const Params *p)
       waterMark(0), dmaPendingNum(0), readEvent(this), fillFifoEvent(this),
       dmaDoneEventAll(maxOutstandingDma, this),
       dmaDoneEventFree(maxOutstandingDma),
-      intEvent(this)
+      intEvent(this), enableCapture(p->enable_capture)
 {
     pioSize = 0xFFFF;
 
@@ -497,15 +497,17 @@ Pl111::dmaDone()
         if (vnc)
             vnc->setDirty();
 
-        DPRINTF(PL111, "-- write out frame buffer into bmp\n");
+        if (enableCapture) {
+            DPRINTF(PL111, "-- write out frame buffer into bmp\n");
 
-        if (!pic)
-            pic = simout.create(csprintf("%s.framebuffer.bmp", sys->name()), true);
+            if (!pic)
+                pic = simout.create(csprintf("%s.framebuffer.bmp", sys->name()), true);
 
-        assert(bmp);
-        assert(pic);
-        pic->seekp(0);
-        bmp->write(pic);
+            assert(bmp);
+            assert(pic);
+            pic->seekp(0);
+            bmp->write(pic);
+        }
 
         // schedule the next read based on when the last frame started
         // and the desired fps (i.e. maxFrameTime), we turn the
index a994067154984526591f65f836f89bbe975e1751..603cf943fd0ee04f857d90ebda82596213c430b3 100644 (file)
@@ -348,6 +348,8 @@ class Pl111: public AmbaDmaDevice
     /** Wrapper to create an event out of the interrupt */
     EventWrapper<Pl111, &Pl111::generateInterrupt> intEvent;
 
+    bool enableCapture;
+
   public:
     typedef Pl111Params Params;