Manta Interactive Ray Tracer Development Mailing List

Text archives Help


[MANTA] r661 - in branches/itanium2: Core/Shm fox


Chronological Thread 
  • From: abe@sci.utah.edu
  • To: manta@sci.utah.edu
  • Subject: [MANTA] r661 - in branches/itanium2: Core/Shm fox
  • Date: Wed, 26 Oct 2005 13:39:23 -0600 (MDT)

Author: abe
Date: Wed Oct 26 13:39:16 2005
New Revision: 661

Modified:
   branches/itanium2/Core/Shm/MFStreamData.cc
   branches/itanium2/Core/Shm/MFStreamData.h
   branches/itanium2/fox/MediaFusionBridge.cc
Log:

Added index field to stream structure.

M    Core/Shm/MFStreamData.cc
M    Core/Shm/MFStreamData.h
M    fox/MediaFusionBridge.cc


Modified: branches/itanium2/Core/Shm/MFStreamData.cc
==============================================================================
--- branches/itanium2/Core/Shm/MFStreamData.cc  (original)
+++ branches/itanium2/Core/Shm/MFStreamData.cc  Wed Oct 26 13:39:16 2005
@@ -200,10 +200,14 @@
 
 void MFStreamData::read_commands( MFSPacket &packet ) {
 
+  semaphore.wait();
+  
   // Copy the current commands out of the shm segment.
   // Nigel: what locking is necessary.
   int i;
-  for (i=0; i<numSSCMD; ++i) {
+  int size = numSSCMD;
+  for (i=0; i<size; ++i) {
+    packet.index[i]   = ssINDEX[i];
     packet.command[i] = ssCMD[i];
     packet.data   [i] = ssDATA[i];
   }
@@ -211,6 +215,8 @@
 
   // Set the internal counter back to zero.
   numSSCMD = 0;
+
+  semaphore.post();
 }
 
 

Modified: branches/itanium2/Core/Shm/MFStreamData.h
==============================================================================
--- branches/itanium2/Core/Shm/MFStreamData.h   (original)
+++ branches/itanium2/Core/Shm/MFStreamData.h   Wed Oct 26 13:39:16 2005
@@ -94,8 +94,10 @@
     int numRects;
     int rectDef[MAX_NUM_UPDATES][5];
 
-    int ssCMD [MAX_NUM_SSCMD];
-    int ssDATA[MAX_NUM_SSCMD];
+    // Input commands from media fusion.
+    int ssINDEX[MAX_NUM_SSCMD];
+    int ssCMD  [MAX_NUM_SSCMD];
+    int ssDATA [MAX_NUM_SSCMD];
     int numSSCMD;
 
     
/////////////////////////////////////////////////////////////////////////////
@@ -117,7 +119,8 @@
         MODPRESS   = 106,
         MODRELEASE = 107
       };
-      
+
+      int index  [MAX_NUM_SSCMD];
       int command[MAX_NUM_SSCMD];
       int data   [MAX_NUM_SSCMD];
       int size;

Modified: branches/itanium2/fox/MediaFusionBridge.cc
==============================================================================
--- branches/itanium2/fox/MediaFusionBridge.cc  (original)
+++ branches/itanium2/fox/MediaFusionBridge.cc  Wed Oct 26 13:39:16 2005
@@ -92,6 +92,7 @@
   int mf_button;
   int prev;
   int event_type;
+  int last_index = 0;
   
   // Begin polling the shm segment.
   for (;;) {
@@ -102,6 +103,14 @@
     // Process the command.
     for (int i=0;i<packet.size;++i) {
 
+      // Check to see if we have missed any commands.
+      if (packet.index[i] != (last_index+1)) {
+        std::cerr << "Warning missed command: " << last_index
+                  << " -> " << packet.index[i] << std::endl;
+      }
+      last_index = packet.index[i];
+
+      // Dispatch the command.
       switch (packet.command[i]) {
 
       case MFSPacket::MODRELEASE:




  • [MANTA] r661 - in branches/itanium2: Core/Shm fox, abe, 10/26/2005

Archive powered by MHonArc 2.6.16.

Top of page