2 * Copyright (C) 2011-2012 ARM Limited. All rights reserved.
4 * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5 * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
7 * A copy of the licence is included with the program, and can also be obtained from Free Software
8 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #include <linux/version.h>
22 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
24 #include <linux/seq_file.h>
25 #include <linux/sync.h>
28 * Create a stream object.
29 * Built on top of timeline object.
30 * Exposed as a file descriptor.
31 * Life-time controlled via the file descriptor:
33 * - close to remove a ref
35 _mali_osk_errcode_t mali_stream_create(const char * name, int * out_fd);
38 * Create a fence in a stream object
40 struct sync_pt *mali_stream_create_point(int tl_fd);
41 int mali_stream_create_fence(struct sync_pt *pt);
44 * Validate a fd to be a valid fence
45 * No reference is taken.
47 * This function is only usable to catch unintentional user errors early,
48 * it does not stop malicious code changing the fd after this function returns.
50 _mali_osk_errcode_t mali_fence_validate(int fd);
53 /* Returns true if the specified timeline is allocated by Mali */
54 int mali_sync_timeline_is_ours(struct sync_timeline *timeline);
56 /* Allocates a timeline for Mali
58 * One timeline should be allocated per API context.
60 struct sync_timeline *mali_sync_timeline_alloc(const char *name);
62 /* Allocates a sync point within the timeline.
64 * The timeline must be the one allocated by mali_sync_timeline_alloc
66 * Sync points must be triggered in *exactly* the same order as they are allocated.
68 struct sync_pt *mali_sync_pt_alloc(struct sync_timeline *parent);
70 /* Signals a particular sync point
72 * Sync points must be triggered in *exactly* the same order as they are allocated.
74 * If they are signalled in the wrong order then a message will be printed in debug
75 * builds and otherwise attempts to signal order sync_pts will be ignored.
77 void mali_sync_signal_pt(struct sync_pt *pt, int error);
80 #endif /* CONFIG_SYNC */
81 #endif /* _MALI_SYNC_H_ */