summaryrefslogtreecommitdiff
path: root/drivers/staging/vboxvideo
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2018-10-19 13:49:05 +0200
committerAlex Deucher <alexander.deucher@amd.com>2018-11-05 14:21:18 -0500
commit27eb1fa9130a98edd2b321d4dbce5c8b244ee7af (patch)
treeb94c90b1cec5a325161051012797155964ce0331 /drivers/staging/vboxvideo
parent7e07834c12b96214e95a473f7b14fc03b20e2e7a (diff)
drm/ttm: use a static ttm_mem_global instance
As the name says we only need one global instance of ttm_mem_global. Drop all the driver initialization and just use a single exported instance which is initialized during BO global initialization. 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/staging/vboxvideo')
-rw-r--r--drivers/staging/vboxvideo/vbox_drv.h1
-rw-r--r--drivers/staging/vboxvideo/vbox_ttm.c24
2 files changed, 0 insertions, 25 deletions
diff --git a/drivers/staging/vboxvideo/vbox_drv.h b/drivers/staging/vboxvideo/vbox_drv.h
index 73395a7536c5..dc257a892ecb 100644
--- a/drivers/staging/vboxvideo/vbox_drv.h
+++ b/drivers/staging/vboxvideo/vbox_drv.h
@@ -99,7 +99,6 @@ struct vbox_private {
int fb_mtrr;
struct {
- struct drm_global_reference mem_global_ref;
struct ttm_bo_global_ref bo_global_ref;
struct ttm_bo_device bdev;
} ttm;
diff --git a/drivers/staging/vboxvideo/vbox_ttm.c b/drivers/staging/vboxvideo/vbox_ttm.c
index 344975579ea5..73b895328059 100644
--- a/drivers/staging/vboxvideo/vbox_ttm.c
+++ b/drivers/staging/vboxvideo/vbox_ttm.c
@@ -35,16 +35,6 @@ static inline struct vbox_private *vbox_bdev(struct ttm_bo_device *bd)
return container_of(bd, struct vbox_private, ttm.bdev);
}
-static int vbox_ttm_mem_global_init(struct drm_global_reference *ref)
-{
- return ttm_mem_global_init(ref->object);
-}
-
-static void vbox_ttm_mem_global_release(struct drm_global_reference *ref)
-{
- ttm_mem_global_release(ref->object);
-}
-
/**
* Adds the vbox memory manager object/structures to the global memory manager.
*/
@@ -53,18 +43,6 @@ static int vbox_ttm_global_init(struct vbox_private *vbox)
struct drm_global_reference *global_ref;
int ret;
- global_ref = &vbox->ttm.mem_global_ref;
- global_ref->global_type = DRM_GLOBAL_TTM_MEM;
- global_ref->size = sizeof(struct ttm_mem_global);
- global_ref->init = &vbox_ttm_mem_global_init;
- global_ref->release = &vbox_ttm_mem_global_release;
- ret = drm_global_item_ref(global_ref);
- if (ret) {
- DRM_ERROR("Failed setting up TTM memory subsystem.\n");
- return ret;
- }
-
- vbox->ttm.bo_global_ref.mem_glob = vbox->ttm.mem_global_ref.object;
global_ref = &vbox->ttm.bo_global_ref.ref;
global_ref->global_type = DRM_GLOBAL_TTM_BO;
global_ref->size = sizeof(struct ttm_bo_global);
@@ -74,7 +52,6 @@ static int vbox_ttm_global_init(struct vbox_private *vbox)
ret = drm_global_item_ref(global_ref);
if (ret) {
DRM_ERROR("Failed setting up TTM BO subsystem.\n");
- drm_global_item_unref(&vbox->ttm.mem_global_ref);
return ret;
}
@@ -87,7 +64,6 @@ static int vbox_ttm_global_init(struct vbox_private *vbox)
static void vbox_ttm_global_release(struct vbox_private *vbox)
{
drm_global_item_unref(&vbox->ttm.bo_global_ref.ref);
- drm_global_item_unref(&vbox->ttm.mem_global_ref);
}
static void vbox_bo_ttm_destroy(struct ttm_buffer_object *tbo)