tbm_sync: first try to open mainline sw_sync node 67/218667/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Tue, 26 Nov 2019 12:36:22 +0000 (21:36 +0900)
committerChangyeon Lee <cyeon.lee@samsung.com>
Tue, 26 Nov 2019 12:38:53 +0000 (21:38 +0900)
Change-Id: If1fc2c7da2d80dfe86cd8229ee8a8e03269809d7

src/tbm_sync.c

index e126a36..49d0266 100644 (file)
@@ -51,8 +51,11 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define FENCE_IOC_WAIT         _IOW(FENCE_IOC_MAGIC, 0, __s32)
 #define FENCE_IOC_MERGE                _IOWR(FENCE_IOC_MAGIC, 1, struct sync_merge_data)
 
+/* Path to the sync device legacy file. */
+#define SYNC_DEVICE_PATH_LEGACY        "/dev/sw_sync"
+
 /* Path to the sync device file. */
-#define SYNC_DEVICE_PATH       "/dev/sw_sync"
+#define SYNC_DEVICE_PATH       "/sys/kernel/debug/sync/sw_sync"
 
 /* Argument data structure for the timeline.create_fence ioctl. */
 struct create_fence_data {
@@ -111,6 +114,9 @@ tbm_sync_timeline_create(void)
 {
        tbm_fd timeline = open(SYNC_DEVICE_PATH, O_RDWR | O_CLOEXEC);
 
+       if (timeline < 0)
+               timeline = open(SYNC_DEVICE_PATH_LEGACY, O_RDWR | O_CLOEXEC);
+
        if (timeline == -1)
                _log_errno();