diff options
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.h')
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.h | 64 |
1 files changed, 27 insertions, 37 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index d39f0862b19e..3d63269c5b29 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h | |||
@@ -31,6 +31,15 @@ | |||
31 | #include <linux/types.h> | 31 | #include <linux/types.h> |
32 | #include <asm/sizes.h> | 32 | #include <asm/sizes.h> |
33 | 33 | ||
34 | |||
35 | #if defined(CONFIG_COMPILE_TEST) && !defined(CONFIG_ARCH_MSM) | ||
36 | /* stubs we need for compile-test: */ | ||
37 | static inline struct device *msm_iommu_get_ctx(const char *ctx_name) | ||
38 | { | ||
39 | return NULL; | ||
40 | } | ||
41 | #endif | ||
42 | |||
34 | #ifndef CONFIG_OF | 43 | #ifndef CONFIG_OF |
35 | #include <mach/board.h> | 44 | #include <mach/board.h> |
36 | #include <mach/socinfo.h> | 45 | #include <mach/socinfo.h> |
@@ -44,6 +53,7 @@ | |||
44 | 53 | ||
45 | struct msm_kms; | 54 | struct msm_kms; |
46 | struct msm_gpu; | 55 | struct msm_gpu; |
56 | struct msm_mmu; | ||
47 | 57 | ||
48 | #define NUM_DOMAINS 2 /* one for KMS, then one per gpu core (?) */ | 58 | #define NUM_DOMAINS 2 /* one for KMS, then one per gpu core (?) */ |
49 | 59 | ||
@@ -76,9 +86,9 @@ struct msm_drm_private { | |||
76 | /* callbacks deferred until bo is inactive: */ | 86 | /* callbacks deferred until bo is inactive: */ |
77 | struct list_head fence_cbs; | 87 | struct list_head fence_cbs; |
78 | 88 | ||
79 | /* registered IOMMU domains: */ | 89 | /* registered MMUs: */ |
80 | unsigned int num_iommus; | 90 | unsigned int num_mmus; |
81 | struct iommu_domain *iommus[NUM_DOMAINS]; | 91 | struct msm_mmu *mmus[NUM_DOMAINS]; |
82 | 92 | ||
83 | unsigned int num_planes; | 93 | unsigned int num_planes; |
84 | struct drm_plane *planes[8]; | 94 | struct drm_plane *planes[8]; |
@@ -94,6 +104,16 @@ struct msm_drm_private { | |||
94 | 104 | ||
95 | unsigned int num_connectors; | 105 | unsigned int num_connectors; |
96 | struct drm_connector *connectors[8]; | 106 | struct drm_connector *connectors[8]; |
107 | |||
108 | /* VRAM carveout, used when no IOMMU: */ | ||
109 | struct { | ||
110 | unsigned long size; | ||
111 | dma_addr_t paddr; | ||
112 | /* NOTE: mm managed at the page level, size is in # of pages | ||
113 | * and position mm_node->start is in # of pages: | ||
114 | */ | ||
115 | struct drm_mm mm; | ||
116 | } vram; | ||
97 | }; | 117 | }; |
98 | 118 | ||
99 | struct msm_format { | 119 | struct msm_format { |
@@ -114,39 +134,7 @@ void __msm_fence_worker(struct work_struct *work); | |||
114 | (_cb)->func = _func; \ | 134 | (_cb)->func = _func; \ |
115 | } while (0) | 135 | } while (0) |
116 | 136 | ||
117 | /* As there are different display controller blocks depending on the | 137 | int msm_register_mmu(struct drm_device *dev, struct msm_mmu *mmu); |
118 | * snapdragon version, the kms support is split out and the appropriate | ||
119 | * implementation is loaded at runtime. The kms module is responsible | ||
120 | * for constructing the appropriate planes/crtcs/encoders/connectors. | ||
121 | */ | ||
122 | struct msm_kms_funcs { | ||
123 | /* hw initialization: */ | ||
124 | int (*hw_init)(struct msm_kms *kms); | ||
125 | /* irq handling: */ | ||
126 | void (*irq_preinstall)(struct msm_kms *kms); | ||
127 | int (*irq_postinstall)(struct msm_kms *kms); | ||
128 | void (*irq_uninstall)(struct msm_kms *kms); | ||
129 | irqreturn_t (*irq)(struct msm_kms *kms); | ||
130 | int (*enable_vblank)(struct msm_kms *kms, struct drm_crtc *crtc); | ||
131 | void (*disable_vblank)(struct msm_kms *kms, struct drm_crtc *crtc); | ||
132 | /* misc: */ | ||
133 | const struct msm_format *(*get_format)(struct msm_kms *kms, uint32_t format); | ||
134 | long (*round_pixclk)(struct msm_kms *kms, unsigned long rate, | ||
135 | struct drm_encoder *encoder); | ||
136 | /* cleanup: */ | ||
137 | void (*preclose)(struct msm_kms *kms, struct drm_file *file); | ||
138 | void (*destroy)(struct msm_kms *kms); | ||
139 | }; | ||
140 | |||
141 | struct msm_kms { | ||
142 | const struct msm_kms_funcs *funcs; | ||
143 | }; | ||
144 | |||
145 | struct msm_kms *mdp4_kms_init(struct drm_device *dev); | ||
146 | |||
147 | int msm_register_iommu(struct drm_device *dev, struct iommu_domain *iommu); | ||
148 | int msm_iommu_attach(struct drm_device *dev, struct iommu_domain *iommu, | ||
149 | const char **names, int cnt); | ||
150 | 138 | ||
151 | int msm_wait_fence_interruptable(struct drm_device *dev, uint32_t fence, | 139 | int msm_wait_fence_interruptable(struct drm_device *dev, uint32_t fence, |
152 | struct timespec *timeout); | 140 | struct timespec *timeout); |
@@ -202,7 +190,9 @@ struct drm_framebuffer *msm_framebuffer_create(struct drm_device *dev, | |||
202 | 190 | ||
203 | struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev); | 191 | struct drm_fb_helper *msm_fbdev_init(struct drm_device *dev); |
204 | 192 | ||
205 | int hdmi_init(struct drm_device *dev, struct drm_encoder *encoder); | 193 | struct hdmi; |
194 | struct hdmi *hdmi_init(struct drm_device *dev, struct drm_encoder *encoder); | ||
195 | irqreturn_t hdmi_irq(int irq, void *dev_id); | ||
206 | void __init hdmi_register(void); | 196 | void __init hdmi_register(void); |
207 | void __exit hdmi_unregister(void); | 197 | void __exit hdmi_unregister(void); |
208 | 198 | ||