Linux 4.2.1
[linux/fpc-iii.git] / drivers / gpu / drm / exynos / exynos_drm_iommu.h
blob8341c7a475b4e4eaa60e464eb4e2a9306995b83b
1 /* exynos_drm_iommu.h
3 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 * Authoer: Inki Dae <inki.dae@samsung.com>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
12 #ifndef _EXYNOS_DRM_IOMMU_H_
13 #define _EXYNOS_DRM_IOMMU_H_
15 #define EXYNOS_DEV_ADDR_START 0x20000000
16 #define EXYNOS_DEV_ADDR_SIZE 0x40000000
18 #ifdef CONFIG_DRM_EXYNOS_IOMMU
20 int drm_create_iommu_mapping(struct drm_device *drm_dev);
22 void drm_release_iommu_mapping(struct drm_device *drm_dev);
24 int drm_iommu_attach_device(struct drm_device *drm_dev,
25 struct device *subdrv_dev);
27 void drm_iommu_detach_device(struct drm_device *dev_dev,
28 struct device *subdrv_dev);
30 static inline bool is_drm_iommu_supported(struct drm_device *drm_dev)
32 #ifdef CONFIG_ARM_DMA_USE_IOMMU
33 struct device *dev = drm_dev->dev;
35 return dev->archdata.mapping ? true : false;
36 #else
37 return false;
38 #endif
41 int drm_iommu_attach_device_if_possible(
42 struct exynos_drm_crtc *exynos_crtc, struct drm_device *drm_dev,
43 struct device *subdrv_dev);
45 #else
47 static inline int drm_create_iommu_mapping(struct drm_device *drm_dev)
49 return 0;
52 static inline void drm_release_iommu_mapping(struct drm_device *drm_dev)
56 static inline int drm_iommu_attach_device(struct drm_device *drm_dev,
57 struct device *subdrv_dev)
59 return 0;
62 static inline void drm_iommu_detach_device(struct drm_device *drm_dev,
63 struct device *subdrv_dev)
67 static inline bool is_drm_iommu_supported(struct drm_device *drm_dev)
69 return false;
72 static inline int drm_iommu_attach_device_if_possible(
73 struct exynos_drm_crtc *exynos_crtc, struct drm_device *drm_dev,
74 struct device *subdrv_dev)
76 return 0;
79 #endif
80 #endif