All the debug printing

Change-Id: I5aedb4067351fa1102283a19d830c08f8bd1afc8
diff --git a/src/camera/drivers/isp/mali-009/arm-isp-test.cc b/src/camera/drivers/isp/mali-009/arm-isp-test.cc
index 660b68f..b1dc275 100644
--- a/src/camera/drivers/isp/mali-009/arm-isp-test.cc
+++ b/src/camera/drivers/isp/mali-009/arm-isp-test.cc
@@ -114,6 +114,15 @@
     zxlogf(ERROR, "[FAILURE] %s\n", msg); \
   }
 
+#define EXPECT_GT(expr1, expr2, msg)      \
+  report.test_count++;                    \
+  if ((expr1) > (expr2)) {                \
+    report.success_count++;               \
+  } else {                                \
+    report.failure_count++;               \
+    zxlogf(ERROR, "[FAILURE] %s\n", msg); \
+  }
+
 #define ASSERT_EQ(expr1, expr2, msg)      \
   report.test_count++;                    \
   if ((expr1) == (expr2)) {               \
@@ -130,10 +139,12 @@
   fbl::AutoLock guard(&isp_lock_);
   uint32_t offset =
       IspGlobalDbg::Get().addr() / 4;  // divide by 4 to get the word address.
+  printf("%s: Writing to IspGlobalDbg\n", __func__);
   IspGlobalDbg::Get()
       .ReadFrom(&(isp_->isp_mmio_))
       .set_mode_en(1)
       .WriteTo(&(isp_->isp_mmio_));
+  printf("%s: dumping regs:\n", __func__);
   ArmIspRegisterDump after_enable = isp_->DumpRegisters();
   EXPECT_EQ(after_enable.global_config[offset], 1,
             "Global debug was not enabled!");
@@ -189,6 +200,7 @@
 void ArmIspDeviceTester::TestCallbacks(fuchsia_camera_test_TestReport& report) {
   constexpr uint32_t kWidth = 1920;
   constexpr uint32_t kHeight = 1080;
+  constexpr uint32_t kFramesToSleep = 5;
   constexpr uint32_t kNumberOfBuffers = 8;
   fuchsia_camera_common_FrameRate rate = {.frames_per_sec_numerator = 30,
                                           .frames_per_sec_denominator = 1};
@@ -256,12 +268,14 @@
 
 // DDKMessage Helper Functions.
 zx_status_t ArmIspDeviceTester::RunTests(fidl_txn_t* txn) {
+  printf("ArmIspDeviceTester::RunTests\n");
   fuchsia_camera_test_TestReport report = {1, 0, 0};
   {
     fbl::AutoLock guard(&isp_lock_);
     if (!isp_) {
       return ZX_ERR_BAD_STATE;
     }
+    printf("Running isp->RunTests()\n");
     if (isp_->RunTests() == ZX_OK) {
       report.success_count++;
     } else {
@@ -269,8 +283,11 @@
     }
   }
   TestWriteRegister(report);
+  printf("done.\nRunning TestConnectStream\n");
   TestConnectStream(report);
+  printf("done.\nRunning TestCallbacks\n");
   TestCallbacks(report);
+  printf("done.\n Replying\n");
   return fuchsia_camera_test_IspTesterRunTests_reply(txn, ZX_OK, &report);
 }
 
diff --git a/src/camera/drivers/isp/mali-009/arm-isp.cc b/src/camera/drivers/isp/mali-009/arm-isp.cc
index b5aa9f7..bf44e00 100644
--- a/src/camera/drivers/isp/mali-009/arm-isp.cc
+++ b/src/camera/drivers/isp/mali-009/arm-isp.cc
@@ -189,6 +189,7 @@
 
   while (running_.load()) {
     status = isp_irq_.wait(NULL);
+    printf("%s: came out of wait, status = %d\n", __func__, (int)status);
     if (status != ZX_OK) {
       return status;
     }
@@ -233,6 +234,8 @@
 
     // Currently only handling Frame Start Interrupt.
     if (irq_status.isp_start()) {
+
+    printf("%s: irq_status.isp_start()\n", __func__);
       // Frame Start Interrupt
       auto current_config = IspGlobal_Config4::Get().ReadFrom(&isp_mmio_);
       if (current_config.is_pong()) {
@@ -274,6 +277,9 @@
           sync_completion_signal(&frame_processing_signal_);
         }
       }
+    } else {
+    printf("%s: irq_status was an unsupported status!\n", __func__);
+    irq_status.Print();
     }
   }
   return status;
@@ -656,6 +662,7 @@
 
 // A call to either stream type to start will get the isp to start running.
 zx_status_t ArmIspDevice::StartStream(stream_type_t type) {
+  printf("%s\n", __func__);
   auto stream = GetStream(type);
   if (!stream) {
     return ZX_ERR_INVALID_ARGS;
@@ -665,6 +672,7 @@
 
   if (!streaming_) {
     auto status = StartStreaming();
+    printf("StartStreaming called, status = %d\n", (int)status);
     if (status == ZX_OK) {
         streaming_ = true;
     }
diff --git a/src/camera/drivers/isp/modules/dma-mgr.cc b/src/camera/drivers/isp/modules/dma-mgr.cc
index 4a0fc8d..dc1491e 100644
--- a/src/camera/drivers/isp/modules/dma-mgr.cc
+++ b/src/camera/drivers/isp/modules/dma-mgr.cc
@@ -192,6 +192,7 @@
 }
 
 void DmaManager::OnFrameWritten() {
+  printf("DmaManager::OnFrameWritten\n");
   // If we have not started streaming, just skip.
   if (!enabled_) {
     return;
@@ -209,8 +210,10 @@
 
 // Called as one of the later steps when a new frame arrives.
 void DmaManager::OnNewFrame() {
+    printf("DmaManager::OnNewFrame\n");
   // If we have not initialized yet with a format, just skip.
   if (!enabled_) {
+    printf("DmaManager::OnNewFrame: Not Enabled, so no newframe\n");
     return;
   }
   // 1) Get another buffer