summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-10-19 17:55:26 +0300
committerAlex Deucher <alexander.deucher@amd.com>2018-11-05 22:21:21 +0300
commita64f784bb14a56bfdfad2dc397dd67e4564e3a29 (patch)
treef2e55af233d82fc8365c4a39d59a897998c3081a /drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
parent62b53b37e4b1500d4eb4624a44ad861cf8d3cd18 (diff)
downloadlinux-a64f784bb14a56bfdfad2dc397dd67e4564e3a29.tar.xz
drm/ttm: initialize globals during device init (v2)
Make sure that the global BO state is always correctly initialized. This allows removing all the device code to initialize it. v2: fix up vbox (Alex) Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
index 0ac473cd5136..154eb09aa91e 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
@@ -42,30 +42,3 @@ int vmw_mmap(struct file *filp, struct vm_area_struct *vma)
dev_priv = vmw_priv(file_priv->minor->dev);
return ttm_bo_mmap(filp, vma, &dev_priv->bdev);
}
-
-int vmw_ttm_global_init(struct vmw_private *dev_priv)
-{
- struct drm_global_reference *global_ref;
- int ret;
-
- global_ref = &dev_priv->bo_global_ref.ref;
- global_ref->global_type = DRM_GLOBAL_TTM_BO;
- global_ref->size = sizeof(struct ttm_bo_global);
- global_ref->init = &ttm_bo_global_ref_init;
- global_ref->release = &ttm_bo_global_ref_release;
- ret = drm_global_item_ref(global_ref);
-
- if (unlikely(ret != 0)) {
- DRM_ERROR("Failed setting up TTM buffer objects.\n");
- goto out_no_bo;
- }
-
- return 0;
-out_no_bo:
- return ret;
-}
-
-void vmw_ttm_global_release(struct vmw_private *dev_priv)
-{
- drm_global_item_unref(&dev_priv->bo_global_ref.ref);
-}