diff options
Diffstat (limited to 'libsync')
-rw-r--r-- | libsync/include/android/sync.h | 20 | ||||
-rw-r--r-- | libsync/sync.c | 23 | ||||
-rw-r--r-- | libsync/tests/sync_test.cpp | 29 |
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 | ||
44 | struct sync_fence_info_data { | ||
45 | uint32_t len; | ||
46 | char name[32]; | ||
47 | int32_t status; | ||
48 | uint8_t pt_info[0]; | ||
49 | }; | ||
50 | |||
51 | struct 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 */ |
45 | int sync_wait(int fd, int timeout); | 61 | int sync_wait(int fd, int timeout); |
62 | struct sync_fence_info_data *sync_fence_info(int fd); | ||
63 | struct sync_pt_info *sync_pt_info(struct sync_fence_info_data *info, | ||
64 | struct sync_pt_info *itr); | ||
65 | void 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 | */ | ||
38 | struct sync_fence_info_data { | ||
39 | uint32_t len; | ||
40 | char name[32]; | ||
41 | int32_t status; | ||
42 | uint8_t pt_info[0]; | ||
43 | }; | ||
44 | struct 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 | }; | ||
52 | struct sync_fence_info_data* sync_fence_info(int fd); | ||
53 | struct sync_pt_info* sync_pt_info(struct sync_fence_info_data* info, struct sync_pt_info* itr); | ||
54 | void sync_fence_info_free(struct sync_fence_info_data* info); | ||
55 | |||
56 | /* Legacy Sync API */ | 33 | /* Legacy Sync API */ |
57 | 34 | ||
58 | struct sync_legacy_merge_data { | 35 | struct 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 | */ | ||
23 | extern "C" { | ||
24 | |||
25 | struct sync_fence_info_data { | ||
26 | uint32_t len; | ||
27 | char name[32]; | ||
28 | int32_t status; | ||
29 | uint8_t pt_info[0]; | ||
30 | }; | ||
31 | |||
32 | struct 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 | |||
41 | struct sync_fence_info_data* sync_fence_info(int fd); | ||
42 | struct sync_pt_info* sync_pt_info(struct sync_fence_info_data* info, struct sync_pt_info* itr); | ||
43 | void 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. |