Added wait/client wait methods to sync abstraction 84/305884/3
authorDavid Steele <david.steele@samsung.com>
Mon, 12 Feb 2024 18:42:56 +0000 (18:42 +0000)
committerDavid Steele <david.steele@samsung.com>
Wed, 14 Feb 2024 16:39:32 +0000 (16:39 +0000)
Note, sync abstraction isn't used by dali-core, but still
has a test implementation, so not going to move it to
dali-adaptor in this patchset.

Change-Id: Iea2b9cb74bcbaffbdf1a181de796010aa371ad03
Signed-off-by: David Steele <david.steele@samsung.com>
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sync-impl.cpp
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sync-impl.h
automated-tests/src/dali/dali-test-suite-utils/test-graphics-sync-object.h
dali/integration-api/graphics-sync-abstraction.h

index 17f53a7..bb4a500 100644 (file)
@@ -38,6 +38,16 @@ bool TestSyncObject::IsSynced()
   return synced;
 }
 
+void TestSyncObject::Wait()
+{
+  mTrace.PushCall("SyncObject::Wait", ""); // Trace the method
+}
+
+void TestSyncObject::ClientWait()
+{
+  mTrace.PushCall("SyncObject::ClientWait", ""); // Trace the method
+}
+
 TestGraphicsSyncImplementation::TestGraphicsSyncImplementation()
 {
   Initialize();
index cbc5331..21fd358 100644 (file)
@@ -2,7 +2,7 @@
 #define TEST_SYNC_IMPLEMENTATION_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -40,7 +40,10 @@ class TestSyncObject : public Integration::GraphicsSyncAbstraction::SyncObject
 public:
   TestSyncObject(TraceCallStack& trace);
   ~TestSyncObject() override;
-  bool            IsSynced() override;
+  bool IsSynced() override;
+  void Wait() override;
+  void ClientWait() override;
+
   bool            synced;
   TraceCallStack& mTrace;
 };
index c33de6c..6886687 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TEST_GRAPHICS_SYNC_OBJECT_H_
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -19,8 +19,7 @@
 
 #include <dali/graphics-api/graphics-sync-object-create-info.h>
 #include <dali/graphics-api/graphics-sync-object.h>
-
-#include <test-graphics-sync-impl.h>
+#include "test-graphics-sync-impl.h"
 
 namespace Dali
 {
index 38bee54..44b24fb 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTEGRATION_GRAPHICS_SYNC_ABSTRACTION_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -55,6 +55,17 @@ public:
      * can now be destroyed)
      */
     virtual bool IsSynced() = 0;
+
+    /**
+     * Wait in the GPU for the synchronisation object to be signalled (but can timeout)
+     */
+    virtual void Wait() = 0;
+
+    /**
+     * Wait in the CPU for the synchronisation object to be signalled.
+     * This will block the render thread - use with caution.
+     */
+    virtual void ClientWait() = 0;
   };
 
   /**