libsync: open new location of sw_sync file

sw_sync file for debug was moved to debugfs. Try to open it and if it
fails try to open /dev/sw_sync.

Test: Sync unit tests still passes.
Change-Id: Ie078fbc2eb5294f28b916a9e65b7fcd3a18a8580
hange-Id: I216874964368d939bed2779d98cd89e527a57d45
This commit is contained in:
Gustavo Padovan 2016-06-10 16:51:29 -03:00 committed by Dmitry Shmidt
parent 6786575d42
commit ffc687baad
1 changed files with 7 additions and 1 deletions

View File

@ -101,7 +101,13 @@ void sync_fence_info_free(struct sync_fence_info_data *info)
int sw_sync_timeline_create(void)
{
return open("/dev/sw_sync", O_RDWR);
int ret;
ret = open("/sys/kernel/debug/sync/sw_sync", O_RDWR);
if (ret < 0)
ret = open("/dev/sw_sync", O_RDWR);
return ret;
}
int sw_sync_timeline_inc(int fd, unsigned count)