.. | .. |
---|
65 | 65 | u32 is_paged; |
---|
66 | 66 | }; |
---|
67 | 67 | |
---|
| 68 | +struct mpp_dev; |
---|
| 69 | + |
---|
68 | 70 | struct mpp_iommu_info { |
---|
69 | 71 | struct rw_semaphore rw_sem; |
---|
70 | 72 | |
---|
.. | .. |
---|
74 | 76 | struct iommu_group *group; |
---|
75 | 77 | struct mpp_rk_iommu *iommu; |
---|
76 | 78 | iommu_fault_handler_t hdl; |
---|
| 79 | + |
---|
| 80 | + spinlock_t dev_lock; |
---|
| 81 | + struct mpp_dev *dev_active; |
---|
| 82 | + |
---|
| 83 | + u32 av1d_iommu; |
---|
77 | 84 | int irq; |
---|
78 | 85 | int got_irq; |
---|
79 | 86 | }; |
---|
.. | .. |
---|
97 | 104 | struct mpp_dma_buffer *buffer); |
---|
98 | 105 | int mpp_dma_map_kernel(struct mpp_dma_session *dma, |
---|
99 | 106 | 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); |
---|
100 | 110 | |
---|
101 | 111 | struct mpp_iommu_info * |
---|
102 | 112 | mpp_iommu_probe(struct device *dev); |
---|
.. | .. |
---|
107 | 117 | |
---|
108 | 118 | int mpp_iommu_refresh(struct mpp_iommu_info *info, struct device *dev); |
---|
109 | 119 | 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); |
---|
110 | 125 | |
---|
111 | 126 | static inline int mpp_iommu_down_read(struct mpp_iommu_info *info) |
---|
112 | 127 | { |
---|