sde_rotator_smmu.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015-2021, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef SDE_ROTATOR_SMMU_H
  6. #define SDE_ROTATOR_SMMU_H
  7. #include <linux/types.h>
  8. #include <linux/device.h>
  9. #include <linux/dma-buf.h>
  10. #include "sde_rotator_io_util.h"
  11. enum sde_iommu_domain_type {
  12. SDE_IOMMU_DOMAIN_ROT_UNSECURE,
  13. SDE_IOMMU_DOMAIN_ROT_SECURE,
  14. SDE_IOMMU_MAX_DOMAIN
  15. };
  16. int sde_smmu_init(struct device *dev);
  17. static inline int sde_smmu_dma_data_direction(int dir)
  18. {
  19. return dir;
  20. }
  21. #ifdef CONFIG_MSM_SDE_ROTATOR
  22. int sde_smmu_ctrl(int enable);
  23. #else
  24. static inline int sde_smmu_ctrl(int enable)
  25. {
  26. return 0;
  27. }
  28. #endif
  29. struct dma_buf_attachment *sde_smmu_dma_buf_attach(
  30. struct dma_buf *dma_buf, struct device *dev, int domain);
  31. int sde_smmu_map_dma_buf(struct dma_buf *dma_buf,
  32. struct sg_table *table, int domain, dma_addr_t *iova,
  33. unsigned long *size, int dir);
  34. void sde_smmu_unmap_dma_buf(struct sg_table *table, int domain,
  35. int dir, struct dma_buf *dma_buf);
  36. int sde_smmu_secure_ctrl(int enable);
  37. #endif /* SDE_ROTATOR_SMMU_H */