diff options
author | Rob Clark <robdclark@gmail.com> | 2015-03-03 15:04:24 -0500 |
---|---|---|
committer | Rob Clark <robdclark@gmail.com> | 2015-04-01 19:29:33 -0400 |
commit | 5bf9c0b614542d69fb9a8681a0411715cc3e8ba8 (patch) | |
tree | 9bc84160a5290e15e3f87b63d02142d301be3f14 /drivers/gpu/drm/msm | |
parent | 564b687b031ccc647943f946b93037cf0780612a (diff) |
drm/msm: split out vram initialization
We'll want to extend this a bit to handle also a reserved-memory
("stolen") region, so that drm/msm can take-over bootloader splash
screen. First split it out into it's own fxn to reduce noise in
the following patch.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm')
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.c | 58 |
1 files changed, 34 insertions, 24 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c index a4269119f9ea..b250610e6393 100644 --- a/drivers/gpu/drm/msm/msm_drv.c +++ b/drivers/gpu/drm/msm/msm_drv.c | |||
@@ -182,29 +182,9 @@ static int get_mdp_ver(struct platform_device *pdev) | |||
182 | return 4; | 182 | return 4; |
183 | } | 183 | } |
184 | 184 | ||
185 | static int msm_load(struct drm_device *dev, unsigned long flags) | 185 | static int msm_init_vram(struct drm_device *dev) |
186 | { | 186 | { |
187 | struct platform_device *pdev = dev->platformdev; | 187 | struct msm_drm_private *priv = dev->dev_private; |
188 | struct msm_drm_private *priv; | ||
189 | struct msm_kms *kms; | ||
190 | int ret; | ||
191 | |||
192 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | ||
193 | if (!priv) { | ||
194 | dev_err(dev->dev, "failed to allocate private data\n"); | ||
195 | return -ENOMEM; | ||
196 | } | ||
197 | |||
198 | dev->dev_private = priv; | ||
199 | |||
200 | priv->wq = alloc_ordered_workqueue("msm", 0); | ||
201 | init_waitqueue_head(&priv->fence_event); | ||
202 | init_waitqueue_head(&priv->pending_crtcs_event); | ||
203 | |||
204 | INIT_LIST_HEAD(&priv->inactive_list); | ||
205 | INIT_LIST_HEAD(&priv->fence_cbs); | ||
206 | |||
207 | drm_mode_config_init(dev); | ||
208 | 188 | ||
209 | /* if we have no IOMMU, then we need to use carveout allocator. | 189 | /* if we have no IOMMU, then we need to use carveout allocator. |
210 | * Grab the entire CMA chunk carved out in early startup in | 190 | * Grab the entire CMA chunk carved out in early startup in |
@@ -232,8 +212,7 @@ static int msm_load(struct drm_device *dev, unsigned long flags) | |||
232 | if (!p) { | 212 | if (!p) { |
233 | dev_err(dev->dev, "failed to allocate VRAM\n"); | 213 | dev_err(dev->dev, "failed to allocate VRAM\n"); |
234 | priv->vram.paddr = 0; | 214 | priv->vram.paddr = 0; |
235 | ret = -ENOMEM; | 215 | return -ENOMEM; |
236 | goto fail; | ||
237 | } | 216 | } |
238 | 217 | ||
239 | dev_info(dev->dev, "VRAM: %08x->%08x\n", | 218 | dev_info(dev->dev, "VRAM: %08x->%08x\n", |
@@ -241,6 +220,37 @@ static int msm_load(struct drm_device *dev, unsigned long flags) | |||
241 | (uint32_t)(priv->vram.paddr + size)); | 220 | (uint32_t)(priv->vram.paddr + size)); |
242 | } | 221 | } |
243 | 222 | ||
223 | return 0; | ||
224 | } | ||
225 | |||
226 | static int msm_load(struct drm_device *dev, unsigned long flags) | ||
227 | { | ||
228 | struct platform_device *pdev = dev->platformdev; | ||
229 | struct msm_drm_private *priv; | ||
230 | struct msm_kms *kms; | ||
231 | int ret; | ||
232 | |||
233 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | ||
234 | if (!priv) { | ||
235 | dev_err(dev->dev, "failed to allocate private data\n"); | ||
236 | return -ENOMEM; | ||
237 | } | ||
238 | |||
239 | dev->dev_private = priv; | ||
240 | |||
241 | priv->wq = alloc_ordered_workqueue("msm", 0); | ||
242 | init_waitqueue_head(&priv->fence_event); | ||
243 | init_waitqueue_head(&priv->pending_crtcs_event); | ||
244 | |||
245 | INIT_LIST_HEAD(&priv->inactive_list); | ||
246 | INIT_LIST_HEAD(&priv->fence_cbs); | ||
247 | |||
248 | drm_mode_config_init(dev); | ||
249 | |||
250 | ret = msm_init_vram(dev); | ||
251 | if (ret) | ||
252 | goto fail; | ||
253 | |||
244 | platform_set_drvdata(pdev, dev); | 254 | platform_set_drvdata(pdev, dev); |
245 | 255 | ||
246 | /* Bind all our sub-components: */ | 256 | /* Bind all our sub-components: */ |