summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/msm_mmu.h
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2016-12-07 19:13:53 +0300
committerRob Clark <robdclark@gmail.com>2017-02-06 19:28:42 +0300
commit7f8036b7f6c6aa635b056fb3fe49ba7062982a5b (patch)
tree977b9e22d619b8cd2438e9b784e0738e9b2211fd /drivers/gpu/drm/msm/msm_mmu.h
parent720c3bb80235ffb10129ee930bb394871afbd235 (diff)
downloadlinux-7f8036b7f6c6aa635b056fb3fe49ba7062982a5b.tar.xz
drm/msm: let gpu wire up it's own fault handler
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_mmu.h')
-rw-r--r--drivers/gpu/drm/msm/msm_mmu.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_mmu.h b/drivers/gpu/drm/msm/msm_mmu.h
index f85c879e68d2..aa2c5d4580c8 100644
--- a/drivers/gpu/drm/msm/msm_mmu.h
+++ b/drivers/gpu/drm/msm/msm_mmu.h
@@ -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__ */