diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2016-11-04 10:20:35 +0300 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2016-11-07 07:04:44 +0300 |
commit | 1608a0fbb6923bf6989c90f0466ca2b87c722871 (patch) | |
tree | e847690920c55197fb7e34c4d449f802a13c1e8c /drivers/gpu/drm/nouveau/nouveau_fbcon.c | |
parent | 595b61cc1316c755c77f832fa27788a6fc1a8608 (diff) | |
download | linux-1608a0fbb6923bf6989c90f0466ca2b87c722871.tar.xz |
drm/nouveau/fbcon: refcount the drm_framebuffer
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_fbcon.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fbcon.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 392ed4761b7f..4192b7926769 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c @@ -359,8 +359,9 @@ nouveau_fbcon_create(struct drm_fb_helper *helper, goto out; } - nouveau_framebuffer_init(dev, &fbcon->fb, &mode_cmd, nvbo); - fb = &fbcon->fb; + ret = nouveau_framebuffer_new(dev, &mode_cmd, nvbo, &fb); + if (ret) + goto out_unref; ret = nouveau_bo_pin(nvbo, TTM_PL_FLAG_VRAM, false); if (ret) { @@ -454,17 +455,15 @@ nouveau_fbcon_destroy(struct drm_device *dev, struct nouveau_fbdev *fbcon) drm_fb_helper_unregister_fbi(&fbcon->helper); drm_fb_helper_release_fbi(&fbcon->helper); + drm_fb_helper_fini(&fbcon->helper); if (nouveau_fb->nvbo) { nouveau_bo_vma_del(nouveau_fb->nvbo, &nouveau_fb->vma); nouveau_bo_unmap(nouveau_fb->nvbo); nouveau_bo_unpin(nouveau_fb->nvbo); - drm_gem_object_unreference_unlocked(&nouveau_fb->nvbo->gem); - nouveau_fb->nvbo = NULL; + drm_framebuffer_unreference(&nouveau_fb->base); } - drm_fb_helper_fini(&fbcon->helper); - drm_framebuffer_unregister_private(&nouveau_fb->base); - drm_framebuffer_cleanup(&nouveau_fb->base); + return 0; } |