diff options
Diffstat (limited to 'drivers/gpu/pvr/services4/srvkm/env/linux/pvr_dma_fence.h')
-rw-r--r-- | drivers/gpu/pvr/services4/srvkm/env/linux/pvr_dma_fence.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/services4/srvkm/env/linux/pvr_dma_fence.h b/drivers/gpu/pvr/services4/srvkm/env/linux/pvr_dma_fence.h new file mode 100644 index 000000000000..f094133f7286 --- /dev/null +++ b/drivers/gpu/pvr/services4/srvkm/env/linux/pvr_dma_fence.h | |||
@@ -0,0 +1,59 @@ | |||
1 | #if !defined(__PVR_DMA_FENCE_H__) | ||
2 | #define __PVR_DMA_FENCE_H__ | ||
3 | |||
4 | #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) | ||
5 | |||
6 | #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)) | ||
7 | #include <linux/fence.h> | ||
8 | |||
9 | /* Structures */ | ||
10 | #define dma_fence fence | ||
11 | #define dma_fence_array fence_array | ||
12 | #define dma_fence_cb fence_cb | ||
13 | #define dma_fence_ops fence_ops | ||
14 | |||
15 | /* Defines and Enums */ | ||
16 | #define DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT FENCE_FLAG_ENABLE_SIGNAL_BIT | ||
17 | #define DMA_FENCE_FLAG_SIGNALED_BIT FENCE_FLAG_SIGNALED_BIT | ||
18 | #define DMA_FENCE_FLAG_USER_BITS FENCE_FLAG_USER_BITS | ||
19 | |||
20 | #define DMA_FENCE_ERR FENCE_ERR | ||
21 | #define DMA_FENCE_TRACE FENCE_TRACE | ||
22 | #define DMA_FENCE_WARN FENCE_WARN | ||
23 | |||
24 | /* Functions */ | ||
25 | #define dma_fence_add_callback fence_add_callback | ||
26 | #define dma_fence_context_alloc fence_context_alloc | ||
27 | #define dma_fence_default_wait fence_default_wait | ||
28 | #define dma_fence_remove_callback fence_remove_callback | ||
29 | #define dma_fence_is_signaled fence_is_signaled | ||
30 | #define dma_fence_enable_sw_signaling fence_enable_sw_signaling | ||
31 | #define dma_fence_free fence_free | ||
32 | #define dma_fence_get fence_get | ||
33 | #define dma_fence_get_rcu fence_get_rcu | ||
34 | #define dma_fence_init fence_init | ||
35 | #define dma_fence_is_array fence_is_array | ||
36 | #define dma_fence_put fence_put | ||
37 | #define dma_fence_signal fence_signal | ||
38 | #define dma_fence_wait fence_wait | ||
39 | #define to_dma_fence_array to_fence_array | ||
40 | |||
41 | static inline signed long | ||
42 | dma_fence_wait_timeout(struct dma_fence *fence, bool intr, signed long timeout) | ||
43 | { | ||
44 | signed long lret; | ||
45 | |||
46 | lret = fence_wait_timeout(fence, intr, timeout); | ||
47 | if (lret || timeout) | ||
48 | return lret; | ||
49 | |||
50 | return test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags) ? 1 : 0; | ||
51 | } | ||
52 | |||
53 | #else | ||
54 | #include <linux/dma-fence.h> | ||
55 | #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)) */ | ||
56 | |||
57 | #endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) */ | ||
58 | |||
59 | #endif /* !defined(__PVR_DMA_FENCE_H__) */ | ||