1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Host1x context devices 4 * 5 * Copyright (c) 2020, NVIDIA Corporation. 6 */ 7 8 #ifndef __HOST1X_CONTEXT_H 9 #define __HOST1X_CONTEXT_H 10 11 #include <linux/mutex.h> 12 #include <linux/refcount.h> 13 14 struct host1x; 15 struct host1x_memory_context; 16 17 struct host1x_memory_context_list { 18 struct mutex lock; 19 struct host1x_memory_context *devs; 20 unsigned int len; 21 }; 22 23 #ifdef CONFIG_IOMMU_API 24 int host1x_memory_context_list_init(struct host1x *host1x); 25 void host1x_memory_context_list_free(struct host1x_memory_context_list *cdl); 26 #else 27 static inline int host1x_memory_context_list_init(struct host1x *host1x) 28 { 29 return 0; 30 } 31 32 static inline void host1x_memory_context_list_free(struct host1x_memory_context_list *cdl) 33 { 34 } 35 #endif 36 37 #endif 38