summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarissa Wall2018-06-05 12:22:32 -0500
committerMarissa Wall2018-06-05 12:22:32 -0500
commiteed25df46a22a143a0341113759894c23a9b6cbf (patch)
tree258eea596705e2709354471eace7f3b135c1cfac /libsync
parent798ba95bda14f9f28561a2a27ba406537f8bb8a8 (diff)
downloadplatform-system-core-eed25df46a22a143a0341113759894c23a9b6cbf.tar.gz
platform-system-core-eed25df46a22a143a0341113759894c23a9b6cbf.tar.xz
platform-system-core-eed25df46a22a143a0341113759894c23a9b6cbf.zip
Revert "sync: remove legacy sync info API"
This reverts commit 798ba95bda14f9f28561a2a27ba406537f8bb8a8. Brodcom uses the sync_fence_info_data directly. https://android-build.googleplex.com/builds/submitted/4821789/elfin-userdebug/latest/view/logs/build_error.log Change-Id: I72fed683397e9b10007b71253e20ded43726d377
Diffstat (limited to 'libsync')
-rw-r--r--libsync/include/android/sync.h20
-rw-r--r--libsync/sync.c23
-rw-r--r--libsync/tests/sync_test.cpp29
3 files changed, 20 insertions, 52 deletions
diff --git a/libsync/include/android/sync.h b/libsync/include/android/sync.h
index 32bb878ba..68f74a0b2 100644
--- a/libsync/include/android/sync.h
+++ b/libsync/include/android/sync.h
@@ -41,8 +41,28 @@
41 41
42__BEGIN_DECLS 42__BEGIN_DECLS
43 43
44struct sync_fence_info_data {
45 uint32_t len;
46 char name[32];
47 int32_t status;
48 uint8_t pt_info[0];
49};
50
51struct sync_pt_info {
52 uint32_t len;
53 char obj_name[32];
54 char driver_name[32];
55 int32_t status;
56 uint64_t timestamp_ns;
57 uint8_t driver_data[0];
58};
59
44/* timeout in msecs */ 60/* timeout in msecs */
45int sync_wait(int fd, int timeout); 61int sync_wait(int fd, int timeout);
62struct sync_fence_info_data *sync_fence_info(int fd);
63struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info,
64 struct sync_pt_info *itr);
65void sync_fence_info_free(struct sync_fence_info_data *info);
46 66
47__END_DECLS 67__END_DECLS
48 68
diff --git a/libsync/sync.c b/libsync/sync.c
index b8c48c7f7..6b187faed 100644
--- a/libsync/sync.c
+++ b/libsync/sync.c
@@ -30,29 +30,6 @@
30 30
31#include <android/sync.h> 31#include <android/sync.h>
32 32
33/* Prototypes for deprecated functions that used to be declared in the legacy
34 * android/sync.h. They've been moved here to make sure new code does not use
35 * them, but the functions are still defined to avoid breaking existing
36 * binaries. Eventually they can be removed altogether.
37 */
38struct sync_fence_info_data {
39 uint32_t len;
40 char name[32];
41 int32_t status;
42 uint8_t pt_info[0];
43};
44struct sync_pt_info {
45 uint32_t len;
46 char obj_name[32];
47 char driver_name[32];
48 int32_t status;
49 uint64_t timestamp_ns;
50 uint8_t driver_data[0];
51};
52struct sync_fence_info_data* sync_fence_info(int fd);
53struct sync_pt_info* sync_pt_info(struct sync_fence_info_data* info, struct sync_pt_info* itr);
54void sync_fence_info_free(struct sync_fence_info_data* info);
55
56/* Legacy Sync API */ 33/* Legacy Sync API */
57 34
58struct sync_legacy_merge_data { 35struct sync_legacy_merge_data {
diff --git a/libsync/tests/sync_test.cpp b/libsync/tests/sync_test.cpp
index 011b09d00..0fb86d6fc 100644
--- a/libsync/tests/sync_test.cpp
+++ b/libsync/tests/sync_test.cpp
@@ -15,35 +15,6 @@
15#include <random> 15#include <random>
16#include <unordered_map> 16#include <unordered_map>
17 17
18/* These deprecated declarations were in the legacy android/sync.h. They've been removed to
19 * encourage code to move to the modern equivalents. But they are still implemented in libsync.so
20 * to avoid breaking existing binaries; as long as that's true we should keep testing them here.
21 * That means making local copies of the declarations.
22 */
23extern "C" {
24
25struct sync_fence_info_data {
26 uint32_t len;
27 char name[32];
28 int32_t status;
29 uint8_t pt_info[0];
30};
31
32struct sync_pt_info {
33 uint32_t len;
34 char obj_name[32];
35 char driver_name[32];
36 int32_t status;
37 uint64_t timestamp_ns;
38 uint8_t driver_data[0];
39};
40
41struct sync_fence_info_data* sync_fence_info(int fd);
42struct sync_pt_info* sync_pt_info(struct sync_fence_info_data* info, struct sync_pt_info* itr);
43void sync_fence_info_free(struct sync_fence_info_data* info);
44
45} // extern "C"
46
47// TODO: better stress tests? 18// TODO: better stress tests?
48// Handle more than 64 fd's simultaneously, i.e. fix sync_fence_info's 4k limit. 19// Handle more than 64 fd's simultaneously, i.e. fix sync_fence_info's 4k limit.
49// Handle wraparound in timelines like nvidia. 20// Handle wraparound in timelines like nvidia.