Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * Host1x context devices
0004  *
0005  * Copyright (c) 2020, NVIDIA Corporation.
0006  */
0007 
0008 #ifndef __HOST1X_CONTEXT_H
0009 #define __HOST1X_CONTEXT_H
0010 
0011 #include <linux/mutex.h>
0012 #include <linux/refcount.h>
0013 
0014 struct host1x;
0015 
0016 extern struct bus_type host1x_context_device_bus_type;
0017 
0018 struct host1x_memory_context_list {
0019     struct mutex lock;
0020     struct host1x_memory_context *devs;
0021     unsigned int len;
0022 };
0023 
0024 #ifdef CONFIG_IOMMU_API
0025 int host1x_memory_context_list_init(struct host1x *host1x);
0026 void host1x_memory_context_list_free(struct host1x_memory_context_list *cdl);
0027 #else
0028 static inline int host1x_memory_context_list_init(struct host1x *host1x)
0029 {
0030     return 0;
0031 }
0032 
0033 static inline void host1x_memory_context_list_free(struct host1x_memory_context_list *cdl)
0034 {
0035 }
0036 #endif
0037 
0038 #endif