channel.h 983 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Tegra host1x Channel
  4. *
  5. * Copyright (c) 2010-2013, NVIDIA Corporation.
  6. */
  7. #ifndef __HOST1X_CHANNEL_H
  8. #define __HOST1X_CHANNEL_H
  9. #include <linux/io.h>
  10. #include <linux/kref.h>
  11. #include <linux/mutex.h>
  12. #include "cdma.h"
  13. struct host1x;
  14. struct host1x_channel;
  15. struct host1x_channel_list {
  16. struct host1x_channel *channels;
  17. struct mutex lock;
  18. unsigned long *allocated_channels;
  19. };
  20. struct host1x_channel {
  21. struct kref refcount;
  22. unsigned int id;
  23. struct mutex submitlock;
  24. void __iomem *regs;
  25. struct host1x_client *client;
  26. struct device *dev;
  27. struct host1x_cdma cdma;
  28. };
  29. /* channel list operations */
  30. int host1x_channel_list_init(struct host1x_channel_list *chlist,
  31. unsigned int num_channels);
  32. void host1x_channel_list_free(struct host1x_channel_list *chlist);
  33. struct host1x_channel *host1x_channel_get_index(struct host1x *host,
  34. unsigned int index);
  35. void host1x_channel_stop_all(struct host1x *host);
  36. #endif