blob: 06b3ad0d89188316ddb2d61ed99381f63b5cf171 [file] [log] [blame]
Jeff Boodyfe6c39c2012-08-09 13:54:50 -06001/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#ifndef __KGSL_SYNC_H
14#define __KGSL_SYNC_H
15
16#include <linux/sync.h>
17#include "kgsl_device.h"
18
19struct kgsl_sync_timeline {
20 struct sync_timeline timeline;
21 unsigned int last_timestamp;
22};
23
24struct kgsl_sync_pt {
25 struct sync_pt pt;
26 unsigned int timestamp;
27};
28
29#if defined(CONFIG_SYNC)
30struct sync_pt *kgsl_sync_pt_create(struct sync_timeline *timeline,
31 unsigned int timestamp);
32void kgsl_sync_pt_destroy(struct sync_pt *pt);
Jeff Boodyfe6c39c2012-08-09 13:54:50 -060033int kgsl_add_fence_event(struct kgsl_device *device,
34 u32 context_id, u32 timestamp, void __user *data, int len,
35 struct kgsl_device_private *owner);
36int kgsl_sync_timeline_create(struct kgsl_context *context);
37void kgsl_sync_timeline_signal(struct sync_timeline *timeline,
38 unsigned int timestamp);
39void kgsl_sync_timeline_destroy(struct kgsl_context *context);
40#else
41static inline struct sync_pt
42*kgsl_sync_pt_create(struct sync_timeline *timeline, unsigned int timestamp)
43{
44 return NULL;
45}
46
47static inline void kgsl_sync_pt_destroy(struct sync_pt *pt)
48{
49}
50
Jeff Boodyfe6c39c2012-08-09 13:54:50 -060051static inline int kgsl_add_fence_event(struct kgsl_device *device,
52 u32 context_id, u32 timestamp, void __user *data, int len,
53 struct kgsl_device_private *owner)
54{
55 return -EINVAL;
56}
57
58static int kgsl_sync_timeline_create(struct kgsl_context *context)
59{
60 context->timeline = NULL;
61 return 0;
62}
63
64static inline void
65kgsl_sync_timeline_signal(struct sync_timeline *timeline,
66 unsigned int timestamp)
67{
68}
69
70static inline void kgsl_sync_timeline_destroy(struct kgsl_context *context)
71{
72}
73#endif
74
75#endif /* __KGSL_SYNC_H */