aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/msm_drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.c')
-rw-r--r--drivers/gpu/drm/msm/msm_drv.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c
index 47f4dd407671..c80a6bee2b18 100644
--- a/drivers/gpu/drm/msm/msm_drv.c
+++ b/drivers/gpu/drm/msm/msm_drv.c
@@ -21,9 +21,11 @@
21 21
22static void msm_fb_output_poll_changed(struct drm_device *dev) 22static void msm_fb_output_poll_changed(struct drm_device *dev)
23{ 23{
24#ifdef CONFIG_DRM_MSM_FBDEV
24 struct msm_drm_private *priv = dev->dev_private; 25 struct msm_drm_private *priv = dev->dev_private;
25 if (priv->fbdev) 26 if (priv->fbdev)
26 drm_fb_helper_hotplug_event(priv->fbdev); 27 drm_fb_helper_hotplug_event(priv->fbdev);
28#endif
27} 29}
28 30
29static const struct drm_mode_config_funcs mode_config_funcs = { 31static const struct drm_mode_config_funcs mode_config_funcs = {
@@ -94,7 +96,7 @@ void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
94 } 96 }
95 97
96 if (reglog) 98 if (reglog)
97 printk(KERN_DEBUG "IO:region %s %08x %08lx\n", dbgname, (u32)ptr, size); 99 printk(KERN_DEBUG "IO:region %s %p %08lx\n", dbgname, ptr, size);
98 100
99 return ptr; 101 return ptr;
100} 102}
@@ -102,7 +104,7 @@ void __iomem *msm_ioremap(struct platform_device *pdev, const char *name,
102void msm_writel(u32 data, void __iomem *addr) 104void msm_writel(u32 data, void __iomem *addr)
103{ 105{
104 if (reglog) 106 if (reglog)
105 printk(KERN_DEBUG "IO:W %08x %08x\n", (u32)addr, data); 107 printk(KERN_DEBUG "IO:W %p %08x\n", addr, data);
106 writel(data, addr); 108 writel(data, addr);
107} 109}
108 110
@@ -110,7 +112,7 @@ u32 msm_readl(const void __iomem *addr)
110{ 112{
111 u32 val = readl(addr); 113 u32 val = readl(addr);
112 if (reglog) 114 if (reglog)
113 printk(KERN_ERR "IO:R %08x %08x\n", (u32)addr, val); 115 printk(KERN_ERR "IO:R %p %08x\n", addr, val);
114 return val; 116 return val;
115} 117}
116 118
@@ -143,8 +145,8 @@ static int msm_unload(struct drm_device *dev)
143 if (gpu) { 145 if (gpu) {
144 mutex_lock(&dev->struct_mutex); 146 mutex_lock(&dev->struct_mutex);
145 gpu->funcs->pm_suspend(gpu); 147 gpu->funcs->pm_suspend(gpu);
146 gpu->funcs->destroy(gpu);
147 mutex_unlock(&dev->struct_mutex); 148 mutex_unlock(&dev->struct_mutex);
149 gpu->funcs->destroy(gpu);
148 } 150 }
149 151
150 if (priv->vram.paddr) { 152 if (priv->vram.paddr) {
@@ -177,7 +179,7 @@ static int get_mdp_ver(struct platform_device *pdev)
177 const struct of_device_id *match; 179 const struct of_device_id *match;
178 match = of_match_node(match_types, dev->of_node); 180 match = of_match_node(match_types, dev->of_node);
179 if (match) 181 if (match)
180 return (int)match->data; 182 return (int)(unsigned long)match->data;
181#endif 183#endif
182 return 4; 184 return 4;
183} 185}
@@ -216,7 +218,7 @@ static int msm_init_vram(struct drm_device *dev)
216 if (ret) 218 if (ret)
217 return ret; 219 return ret;
218 size = r.end - r.start; 220 size = r.end - r.start;
219 DRM_INFO("using VRAM carveout: %lx@%08x\n", size, r.start); 221 DRM_INFO("using VRAM carveout: %lx@%pa\n", size, &r.start);
220 } else 222 } else
221#endif 223#endif
222 224
@@ -283,10 +285,6 @@ static int msm_load(struct drm_device *dev, unsigned long flags)
283 285
284 drm_mode_config_init(dev); 286 drm_mode_config_init(dev);
285 287
286 ret = msm_init_vram(dev);
287 if (ret)
288 goto fail;
289
290 platform_set_drvdata(pdev, dev); 288 platform_set_drvdata(pdev, dev);
291 289
292 /* Bind all our sub-components: */ 290 /* Bind all our sub-components: */
@@ -294,6 +292,10 @@ static int msm_load(struct drm_device *dev, unsigned long flags)
294 if (ret) 292 if (ret)
295 return ret; 293 return ret;
296 294
295 ret = msm_init_vram(dev);
296 if (ret)
297 goto fail;
298
297 switch (get_mdp_ver(pdev)) { 299 switch (get_mdp_ver(pdev)) {
298 case 4: 300 case 4:
299 kms = mdp4_kms_init(dev); 301 kms = mdp4_kms_init(dev);
@@ -419,9 +421,11 @@ static void msm_preclose(struct drm_device *dev, struct drm_file *file)
419 421
420static void msm_lastclose(struct drm_device *dev) 422static void msm_lastclose(struct drm_device *dev)
421{ 423{
424#ifdef CONFIG_DRM_MSM_FBDEV
422 struct msm_drm_private *priv = dev->dev_private; 425 struct msm_drm_private *priv = dev->dev_private;
423 if (priv->fbdev) 426 if (priv->fbdev)
424 drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev); 427 drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev);
428#endif
425} 429}
426 430
427static irqreturn_t msm_irq(int irq, void *arg) 431static irqreturn_t msm_irq(int irq, void *arg)