aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/exynos/exynos_drm_fbdev.c')
-rw-r--r--drivers/gpu/drm/exynos/exynos_drm_fbdev.c90
1 files changed, 3 insertions, 87 deletions
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
index 54f8f074822f..d5586cc75163 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fbdev.c
@@ -125,7 +125,9 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
125 } 125 }
126 126
127 size = mode_cmd.pitches[0] * mode_cmd.height; 127 size = mode_cmd.pitches[0] * mode_cmd.height;
128 exynos_gem_obj = exynos_drm_gem_create(dev, size); 128
129 /* 0 means to allocate physically continuous memory */
130 exynos_gem_obj = exynos_drm_gem_create(dev, 0, size);
129 if (IS_ERR(exynos_gem_obj)) { 131 if (IS_ERR(exynos_gem_obj)) {
130 ret = PTR_ERR(exynos_gem_obj); 132 ret = PTR_ERR(exynos_gem_obj);
131 goto out; 133 goto out;
@@ -314,89 +316,3 @@ void exynos_drm_fbdev_restore_mode(struct drm_device *dev)
314 316
315 drm_fb_helper_restore_fbdev_mode(private->fb_helper); 317 drm_fb_helper_restore_fbdev_mode(private->fb_helper);
316} 318}
317
318int exynos_drm_fbdev_reinit(struct drm_device *dev)
319{
320 struct exynos_drm_private *private = dev->dev_private;
321 struct drm_fb_helper *fb_helper;
322 int ret;
323
324 if (!private)
325 return -EINVAL;
326
327 /*
328 * if all sub drivers were unloaded then num_connector is 0
329 * so at this time, the framebuffers also should be destroyed.
330 */
331 if (!dev->mode_config.num_connector) {
332 exynos_drm_fbdev_fini(dev);
333 return 0;
334 }
335
336 fb_helper = private->fb_helper;
337
338 if (fb_helper) {
339 struct list_head temp_list;
340
341 INIT_LIST_HEAD(&temp_list);
342
343 /*
344 * fb_helper is reintialized but kernel fb is reused
345 * so kernel_fb_list need to be backuped and restored
346 */
347 if (!list_empty(&fb_helper->kernel_fb_list))
348 list_replace_init(&fb_helper->kernel_fb_list,
349 &temp_list);
350
351 drm_fb_helper_fini(fb_helper);
352
353 ret = drm_fb_helper_init(dev, fb_helper,
354 dev->mode_config.num_crtc, MAX_CONNECTOR);
355 if (ret < 0) {
356 DRM_ERROR("failed to initialize drm fb helper\n");
357 return ret;
358 }
359
360 if (!list_empty(&temp_list))
361 list_replace(&temp_list, &fb_helper->kernel_fb_list);
362
363 ret = drm_fb_helper_single_add_all_connectors(fb_helper);
364 if (ret < 0) {
365 DRM_ERROR("failed to add fb helper to connectors\n");
366 goto err;
367 }
368
369 ret = drm_fb_helper_initial_config(fb_helper, PREFERRED_BPP);
370 if (ret < 0) {
371 DRM_ERROR("failed to set up hw configuration.\n");
372 goto err;
373 }
374 } else {
375 /*
376 * if drm_load() failed whem drm load() was called prior
377 * to specific drivers, fb_helper must be NULL and so
378 * this fuction should be called again to re-initialize and
379 * re-configure the fb helper. it means that this function
380 * has been called by the specific drivers.
381 */
382 ret = exynos_drm_fbdev_init(dev);
383 }
384
385 return ret;
386
387err:
388 /*
389 * if drm_load() failed when drm load() was called prior
390 * to specific drivers, the fb_helper must be NULL and so check it.
391 */
392 if (fb_helper)
393 drm_fb_helper_fini(fb_helper);
394
395 return ret;
396}
397
398MODULE_AUTHOR("Inki Dae <inki.dae@samsung.com>");
399MODULE_AUTHOR("Joonyoung Shim <jy0922.shim@samsung.com>");
400MODULE_AUTHOR("Seung-Woo Kim <sw0312.kim@samsung.com>");
401MODULE_DESCRIPTION("Samsung SoC DRM FBDEV Driver");
402MODULE_LICENSE("GPL");