sde_rotator_smmu.h 979 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2015-2019, 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. int sde_smmu_ctrl(int enable);
  22. struct dma_buf_attachment *sde_smmu_dma_buf_attach(
  23. struct dma_buf *dma_buf, struct device *dev, int domain);
  24. int sde_smmu_map_dma_buf(struct dma_buf *dma_buf,
  25. struct sg_table *table, int domain, dma_addr_t *iova,
  26. unsigned long *size, int dir);
  27. void sde_smmu_unmap_dma_buf(struct sg_table *table, int domain,
  28. int dir, struct dma_buf *dma_buf);
  29. int sde_smmu_secure_ctrl(int enable);
  30. #endif /* SDE_ROTATOR_SMMU_H */