summaryrefslogtreecommitdiff
path: root/drivers/gpu/ion/sprd/sprd_fence.h
blob: 6916ccf45f3518248f48cb90dd350c840984edcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * Copyright (C) 2012 Spreadtrum Communications Inc.
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef _SPRD_FENCE_H_
#define _SPRD_FENCE_H_

#include <linux/mutex.h>
#include <linux/types.h>
#include <linux/sync.h>
#include <video/ion_sprd.h>

struct sprd_sync_timeline {
    struct sync_timeline obj;
    u32 value;
};

struct sprd_sync_pt {
    struct sync_pt pt;
    u32 value;
};

struct sprd_sync_create_fence_data {
    __u32 value;
    char name[32];
    __s32 fence; /* fd of new fence */
};

struct sync_timeline_data {
    int timeline_value;
    struct mutex sync_mutex;
    struct sprd_sync_timeline *timeline;
};

extern int open_sprd_sync_timeline(void);
extern int close_sprd_sync_timeline(void);
extern int sprd_fence_build(struct ion_fence_data *data);
extern int sprd_fence_destroy(struct ion_fence_data *data);
extern int sprd_fence_signal(struct ion_fence_data *data);
extern int sprd_fence_wait(int fence_fd);
extern struct sync_pt *sprd_fence_dup(struct sync_pt *sync_pt);

#endif