rk: ion: resolve build err
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / t6xx / kbase / src / linux / mali_kbase_sync.h
1 /*
2  *
3  * (C) COPYRIGHT ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15
16
17
18
19
20 /**
21  * @file mali_kbase_sync.h
22  *
23  */
24
25 #ifndef MALI_KBASE_SYNC_H
26 #define MALI_KBASE_SYNC_H
27
28 //#include <linux/sync.h>
29 #include "sync.h"
30 #include <malisw/mali_malisw.h>
31
32 /*
33  * Create a stream object.
34  * Built on top of timeline object.
35  * Exposed as a file descriptor.
36  * Life-time controlled via the file descriptor:
37  * - dup to add a ref
38  * - close to remove a ref
39  */
40 mali_error kbase_stream_create(const char *name, int *const out_fd);
41
42 /*
43  * Create a fence in a stream object
44  */
45 int kbase_stream_create_fence(int tl_fd);
46
47 /*
48  * Validate a fd to be a valid fence
49  * No reference is taken.
50  *
51  * This function is only usable to catch unintentional user errors early,
52  * it does not stop malicious code changing the fd after this function returns.
53  */
54 mali_error kbase_fence_validate(int fd);
55
56 /* Returns true if the specified timeline is allocated by Mali */
57 int kbase_sync_timeline_is_ours(struct sync_timeline *timeline);
58
59 /* Allocates a timeline for Mali
60  *
61  * One timeline should be allocated per API context.
62  */
63 struct sync_timeline *kbase_sync_timeline_alloc(const char *name);
64
65 /* Allocates a sync point within the timeline.
66  *
67  * The timeline must be the one allocated by kbase_sync_timeline_alloc
68  *
69  * Sync points must be triggered in *exactly* the same order as they are allocated.
70  */
71 struct sync_pt *kbase_sync_pt_alloc(struct sync_timeline *parent);
72
73 /* Signals a particular sync point
74  *
75  * Sync points must be triggered in *exactly* the same order as they are allocated.
76  *
77  * If they are signalled in the wrong order then a message will be printed in debug
78  * builds and otherwise attempts to signal order sync_pts will be ignored.
79  *
80  * result can be negative to indicate error, any other value is interpreted as success.
81  */
82 void kbase_sync_signal_pt(struct sync_pt *pt, int result);
83
84 #endif