sde_rotator_smmu.h 1.2 KB

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