drm/msm: let gpu wire up it's own fault handler
[linux-2.6-microblaze.git] / drivers / gpu / drm / msm / msm_mmu.h
index f85c879..aa2c5d4 100644 (file)
@@ -33,6 +33,8 @@ struct msm_mmu_funcs {
 struct msm_mmu {
        const struct msm_mmu_funcs *funcs;
        struct device *dev;
+       int (*handler)(void *arg, unsigned long iova, int flags);
+       void *arg;
 };
 
 static inline void msm_mmu_init(struct msm_mmu *mmu, struct device *dev,
@@ -45,4 +47,11 @@ static inline void msm_mmu_init(struct msm_mmu *mmu, struct device *dev,
 struct msm_mmu *msm_iommu_new(struct device *dev, struct iommu_domain *domain);
 struct msm_mmu *msm_gpummu_new(struct device *dev, struct msm_gpu *gpu);
 
+static inline void msm_mmu_set_fault_handler(struct msm_mmu *mmu, void *arg,
+               int (*handler)(void *arg, unsigned long iova, int flags))
+{
+       mmu->arg = arg;
+       mmu->handler = handler;
+}
+
 #endif /* __MSM_MMU_H__ */