Commit | Line | Data |
---|---|---|
0519f9a1 ID |
1 | /* exynos_drm_iommu.h |
2 | * | |
3 | * Copyright (c) 2012 Samsung Electronics Co., Ltd. | |
4 | * Authoer: Inki Dae <inki.dae@samsung.com> | |
5 | * | |
d81aecb5 ID |
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. | |
0519f9a1 ID |
10 | */ |
11 | ||
12 | #ifndef _EXYNOS_DRM_IOMMU_H_ | |
13 | #define _EXYNOS_DRM_IOMMU_H_ | |
14 | ||
15 | #define EXYNOS_DEV_ADDR_START 0x20000000 | |
16 | #define EXYNOS_DEV_ADDR_SIZE 0x40000000 | |
0519f9a1 ID |
17 | |
18 | #ifdef CONFIG_DRM_EXYNOS_IOMMU | |
19 | ||
20 | int drm_create_iommu_mapping(struct drm_device *drm_dev); | |
21 | ||
22 | void drm_release_iommu_mapping(struct drm_device *drm_dev); | |
23 | ||
24 | int drm_iommu_attach_device(struct drm_device *drm_dev, | |
25 | struct device *subdrv_dev); | |
26 | ||
27 | void drm_iommu_detach_device(struct drm_device *dev_dev, | |
28 | struct device *subdrv_dev); | |
29 | ||
30 | static inline bool is_drm_iommu_supported(struct drm_device *drm_dev) | |
31 | { | |
f43c3596 | 32 | struct exynos_drm_private *priv = drm_dev->dev_private; |
0519f9a1 | 33 | |
f43c3596 | 34 | return priv->mapping ? true : false; |
0519f9a1 ID |
35 | } |
36 | ||
37 | #else | |
38 | ||
0519f9a1 ID |
39 | static inline int drm_create_iommu_mapping(struct drm_device *drm_dev) |
40 | { | |
41 | return 0; | |
42 | } | |
43 | ||
44 | static inline void drm_release_iommu_mapping(struct drm_device *drm_dev) | |
45 | { | |
46 | } | |
47 | ||
48 | static inline int drm_iommu_attach_device(struct drm_device *drm_dev, | |
49 | struct device *subdrv_dev) | |
50 | { | |
51 | return 0; | |
52 | } | |
53 | ||
54 | static inline void drm_iommu_detach_device(struct drm_device *drm_dev, | |
55 | struct device *subdrv_dev) | |
56 | { | |
57 | } | |
58 | ||
59 | static inline bool is_drm_iommu_supported(struct drm_device *drm_dev) | |
60 | { | |
61 | return false; | |
62 | } | |
63 | ||
64 | #endif | |
65 | #endif |