drm/ttm: Rename ttm_bo_global_{init,release}() to ttm_bo_global_ref_{,}()

The functions ttm_bo_global_init() and ttm_bo_global_release() do not
receive an argument of type struct ttm_bo_global. Both take a struct
drm_global_reference that contains points to a struct ttm_bo_global_ref.
Renaming them reflects this.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Thomas Zimmermann 2018-10-16 10:04:08 +02:00 committed by Alex Deucher
parent d76e393f4c
commit e55a5c9b5f
15 changed files with 32 additions and 32 deletions

View File

@ -72,8 +72,8 @@ object TTM to provide a pool for buffer object allocation by clients and
the kernel itself. The type of this object should be
TTM_GLOBAL_TTM_BO, and its size should be sizeof(struct
ttm_bo_global). Again, driver-specific init and release functions may
be provided, likely eventually calling ttm_bo_global_init() and
ttm_bo_global_release(), respectively. Also, like the previous
be provided, likely eventually calling ttm_bo_global_ref_init() and
ttm_bo_global_ref_release(), respectively. Also, like the previous
object, ttm_global_item_ref() is used to create an initial reference
count for the TTM, which will call your initialization function.

View File

@ -125,8 +125,8 @@ static int amdgpu_ttm_global_init(struct amdgpu_device *adev)
global_ref = &adev->mman.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_init;
global_ref->release = &ttm_bo_global_release;
global_ref->init = &ttm_bo_global_ref_init;
global_ref->release = &ttm_bo_global_ref_release;
r = drm_global_item_ref(global_ref);
if (r) {
DRM_ERROR("Failed setting up TTM BO subsystem.\n");

View File

@ -70,8 +70,8 @@ static int ast_ttm_global_init(struct ast_private *ast)
global_ref = &ast->ttm.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_init;
global_ref->release = &ttm_bo_global_release;
global_ref->init = &ttm_bo_global_ref_init;
global_ref->release = &ttm_bo_global_ref_release;
r = drm_global_item_ref(global_ref);
if (r != 0) {
DRM_ERROR("Failed setting up TTM BO subsystem.\n");

View File

@ -48,8 +48,8 @@ static int bochs_ttm_global_init(struct bochs_device *bochs)
global_ref = &bochs->ttm.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_init;
global_ref->release = &ttm_bo_global_release;
global_ref->init = &ttm_bo_global_ref_init;
global_ref->release = &ttm_bo_global_ref_release;
r = drm_global_item_ref(global_ref);
if (r != 0) {
DRM_ERROR("Failed setting up TTM BO subsystem.\n");

View File

@ -70,8 +70,8 @@ static int cirrus_ttm_global_init(struct cirrus_device *cirrus)
global_ref = &cirrus->ttm.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_init;
global_ref->release = &ttm_bo_global_release;
global_ref->init = &ttm_bo_global_ref_init;
global_ref->release = &ttm_bo_global_ref_release;
r = drm_global_item_ref(global_ref);
if (r != 0) {
DRM_ERROR("Failed setting up TTM BO subsystem.\n");

View File

@ -59,8 +59,8 @@ static int hibmc_ttm_global_init(struct hibmc_drm_private *hibmc)
hibmc->mem_global_ref.object;
hibmc->bo_global_ref.ref.global_type = DRM_GLOBAL_TTM_BO;
hibmc->bo_global_ref.ref.size = sizeof(struct ttm_bo_global);
hibmc->bo_global_ref.ref.init = &ttm_bo_global_init;
hibmc->bo_global_ref.ref.release = &ttm_bo_global_release;
hibmc->bo_global_ref.ref.init = &ttm_bo_global_ref_init;
hibmc->bo_global_ref.ref.release = &ttm_bo_global_ref_release;
ret = drm_global_item_ref(&hibmc->bo_global_ref.ref);
if (ret) {
DRM_ERROR("failed setting up TTM BO subsystem: %d\n", ret);

View File

@ -70,8 +70,8 @@ static int mgag200_ttm_global_init(struct mga_device *ast)
global_ref = &ast->ttm.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_init;
global_ref->release = &ttm_bo_global_release;
global_ref->init = &ttm_bo_global_ref_init;
global_ref->release = &ttm_bo_global_ref_release;
r = drm_global_item_ref(global_ref);
if (r != 0) {
DRM_ERROR("Failed setting up TTM BO subsystem.\n");

View File

@ -209,8 +209,8 @@ nouveau_ttm_global_init(struct nouveau_drm *drm)
global_ref = &drm->ttm.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_init;
global_ref->release = &ttm_bo_global_release;
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)) {

View File

@ -80,8 +80,8 @@ static int qxl_ttm_global_init(struct qxl_device *qdev)
global_ref = &qdev->mman.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_init;
global_ref->release = &ttm_bo_global_release;
global_ref->init = &ttm_bo_global_ref_init;
global_ref->release = &ttm_bo_global_ref_release;
r = drm_global_item_ref(global_ref);
if (r != 0) {
DRM_ERROR("Failed setting up TTM BO subsystem.\n");

View File

@ -97,8 +97,8 @@ static int radeon_ttm_global_init(struct radeon_device *rdev)
global_ref = &rdev->mman.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_init;
global_ref->release = &ttm_bo_global_release;
global_ref->init = &ttm_bo_global_ref_init;
global_ref->release = &ttm_bo_global_ref_release;
r = drm_global_item_ref(global_ref);
if (r != 0) {
DRM_ERROR("Failed setting up TTM BO subsystem.\n");

View File

@ -1522,16 +1522,16 @@ static void ttm_bo_global_kobj_release(struct kobject *kobj)
kfree(glob);
}
void ttm_bo_global_release(struct drm_global_reference *ref)
void ttm_bo_global_ref_release(struct drm_global_reference *ref)
{
struct ttm_bo_global *glob = ref->object;
kobject_del(&glob->kobj);
kobject_put(&glob->kobj);
}
EXPORT_SYMBOL(ttm_bo_global_release);
EXPORT_SYMBOL(ttm_bo_global_ref_release);
int ttm_bo_global_init(struct drm_global_reference *ref)
int ttm_bo_global_ref_init(struct drm_global_reference *ref)
{
struct ttm_bo_global_ref *bo_ref =
container_of(ref, struct ttm_bo_global_ref, ref);
@ -1564,7 +1564,7 @@ out_no_drp:
kfree(glob);
return ret;
}
EXPORT_SYMBOL(ttm_bo_global_init);
EXPORT_SYMBOL(ttm_bo_global_ref_init);
int ttm_bo_device_release(struct ttm_bo_device *bdev)

View File

@ -84,8 +84,8 @@ static int virtio_gpu_ttm_global_init(struct virtio_gpu_device *vgdev)
global_ref = &vgdev->mman.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_init;
global_ref->release = &ttm_bo_global_release;
global_ref->init = &ttm_bo_global_ref_init;
global_ref->release = &ttm_bo_global_ref_release;
r = drm_global_item_ref(global_ref);
if (r != 0) {
DRM_ERROR("Failed setting up TTM BO subsystem.\n");

View File

@ -76,8 +76,8 @@ int vmw_ttm_global_init(struct vmw_private *dev_priv)
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_init;
global_ref->release = &ttm_bo_global_release;
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)) {

View File

@ -68,8 +68,8 @@ static int vbox_ttm_global_init(struct vbox_private *vbox)
global_ref = &vbox->ttm.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_init;
global_ref->release = &ttm_bo_global_release;
global_ref->init = &ttm_bo_global_ref_init;
global_ref->release = &ttm_bo_global_ref_release;
ret = drm_global_item_ref(global_ref);
if (ret) {

View File

@ -578,8 +578,8 @@ void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem);
void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo,
struct ttm_mem_reg *mem);
void ttm_bo_global_release(struct drm_global_reference *ref);
int ttm_bo_global_init(struct drm_global_reference *ref);
void ttm_bo_global_ref_release(struct drm_global_reference *ref);
int ttm_bo_global_ref_init(struct drm_global_reference *ref);
int ttm_bo_device_release(struct ttm_bo_device *bdev);