1 /* 2 * 3 * (C) COPYRIGHT 2010-2017 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 #ifndef _KBASE_FENCE_DEFS_H_ 19 #define _KBASE_FENCE_DEFS_H_ 20 21 /* 22 * There was a big rename in the 4.10 kernel (fence* -> dma_fence*) 23 * This file hides the compatibility issues with this for the rest the driver 24 */ 25 26 #if defined(CONFIG_MALI_DMA_FENCE) || defined(CONFIG_SYNC_FILE) 27 28 #include <linux/version.h> 29 30 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)) 31 32 #include <linux/fence.h> 33 34 #define dma_fence_context_alloc(a) fence_context_alloc(a) 35 #define dma_fence_init(a, b, c, d, e) fence_init(a, b, c, d, e) 36 #define dma_fence_get(a) fence_get(a) 37 #define dma_fence_put(a) fence_put(a) 38 #define dma_fence_signal(a) fence_signal(a) 39 #define dma_fence_is_signaled(a) fence_is_signaled(a) 40 #define dma_fence_add_callback(a, b, c) fence_add_callback(a, b, c) 41 #define dma_fence_remove_callback(a, b) fence_remove_callback(a, b) 42 43 #else 44 45 #include <linux/dma-fence.h> 46 47 #endif /* < 4.10.0 */ 48 49 #endif /* CONFIG_MALI_DMA_FENCE || CONFIG_SYNC_FILE */ 50 51 #endif /* _KBASE_FENCE_DEFS_H_ */ 52