forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/video/rockchip/mpp/mpp_iommu.h
....@@ -65,6 +65,8 @@
6565 u32 is_paged;
6666 };
6767
68
+struct mpp_dev;
69
+
6870 struct mpp_iommu_info {
6971 struct rw_semaphore rw_sem;
7072
....@@ -74,6 +76,11 @@
7476 struct iommu_group *group;
7577 struct mpp_rk_iommu *iommu;
7678 iommu_fault_handler_t hdl;
79
+
80
+ spinlock_t dev_lock;
81
+ struct mpp_dev *dev_active;
82
+
83
+ u32 av1d_iommu;
7784 int irq;
7885 int got_irq;
7986 };
....@@ -97,6 +104,9 @@
97104 struct mpp_dma_buffer *buffer);
98105 int mpp_dma_map_kernel(struct mpp_dma_session *dma,
99106 struct mpp_dma_buffer *buffer);
107
+struct mpp_dma_buffer *mpp_dma_find_buffer_fd(struct mpp_dma_session *dma, int fd);
108
+void mpp_dma_buf_sync(struct mpp_dma_buffer *buffer, u32 offset, u32 length,
109
+ enum dma_data_direction dir, bool for_cpu);
100110
101111 struct mpp_iommu_info *
102112 mpp_iommu_probe(struct device *dev);
....@@ -107,6 +117,11 @@
107117
108118 int mpp_iommu_refresh(struct mpp_iommu_info *info, struct device *dev);
109119 int mpp_iommu_flush_tlb(struct mpp_iommu_info *info);
120
+int mpp_av1_iommu_disable(struct device *dev);
121
+int mpp_av1_iommu_enable(struct device *dev);
122
+
123
+int mpp_iommu_dev_activate(struct mpp_iommu_info *info, struct mpp_dev *dev);
124
+int mpp_iommu_dev_deactivate(struct mpp_iommu_info *info, struct mpp_dev *dev);
110125
111126 static inline int mpp_iommu_down_read(struct mpp_iommu_info *info)
112127 {