context.h 788 B

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