drm/ttm: turn ttm_bo_device.vma_manager into a pointer
Subsystems (8)
A message that is not in the archive (sent off-list or not yet received): [email protected]
Gerd Hoffmann
maintainerPATCH 1/8 drm/ttm: turn ttm_bo_device.vma_manager into a pointer
Rename the embedded struct vma_offset_manager, new name is _vma_manager. ttm_bo_device.vma_manager changed to a pointer.
The ttm_bo_device_init() function gets an additional vma_manager argument which allows to initialize ttm with a different vma manager. When passing NULL the embedded _vma_manager is used.
All callers are updated to pass NULL, so the behavior doesn't change.
--- include/drm/ttm/ttm_bo_driver.h | 8 ++++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/drm_vram_mm_helper.c | 1 + drivers/gpu/drm/nouveau/nouveau_ttm.c | 1 + drivers/gpu/drm/qxl/qxl_ttm.c | 1 + drivers/gpu/drm/radeon/radeon_ttm.c | 1 + drivers/gpu/drm/ttm/ttm_bo.c | 13 +++++++++---- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 + 9 files changed, 24 insertions(+), 9 deletions(-)
include/drm/ttm/ttm_bo_driver.h +6 -2
@@ -441,7 +441,8 @@ extern struct ttm_bo_global {* * @driver: Pointer to a struct ttm_bo_driver struct setup by the driver. * @man: An array of mem_type_managers. -* @vma_manager: Address space manager +* @vma_manager: Address space manager (pointer) +* @_vma_manager: Address space manager (enbedded) * lru_lock: Spinlock that protects the buffer+device lru lists and * ddestroy lists. * @dev_mapping: A pointer to the struct address_space representing the
@@ -464,7 +465,8 @@ struct ttm_bo_device {/* * Protected by internal locks. */ -struct drm_vma_offset_manager vma_manager; +struct drm_vma_offset_manager *vma_manager; +struct drm_vma_offset_manager _vma_manager;/* * Protected by the global:lru lock.
@@ -585,6 +587,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);* @glob: A pointer to an initialized struct ttm_bo_global. * @driver: A pointer to a struct ttm_bo_driver set up by the caller. * @mapping: The address space to use for this bo. +* @vma_manager: A pointer to a vma manager or NULL. * @file_page_offset: Offset into the device address space that is available * for buffer data. This ensures compatibility with other users of the * address space.
@@ -596,6 +599,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);int ttm_bo_device_init (struct ttm_bo_device *bdev,struct ttm_bo_driver *driver,struct address_space *mapping, +struct drm_vma_offset_manager *vma_manager,bool need_dma32);/**
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -0
@@ -1728,6 +1728,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) r =ttm_bo_device_init (&adev->mman.bdev, &amdgpu_bo_driver, adev->ddev->anon_inode->i_mapping, +NULL , adev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
drivers/gpu/drm/drm_vram_mm_helper.c +1 -0
@@ -172,6 +172,7 @@ int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, ret =ttm_bo_device_init (&vmm->bdev, &bo_driver, dev->anon_inode->i_mapping, +NULL , true);if (ret)return ret;
drivers/gpu/drm/nouveau/nouveau_ttm.c +1 -0
@@ -236,6 +236,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ret =ttm_bo_device_init (&drm->ttm.bdev, &nouveau_bo_driver, dev->anon_inode->i_mapping, +NULL , drm->client.mmu.dmabits <=32 ? true : false);if (ret) {NV_ERROR (drm,"error initialising bo driver, %d\n" , ret);
drivers/gpu/drm/qxl/qxl_ttm.c +1 -0
@@ -325,6 +325,7 @@ int qxl_ttm_init(struct qxl_device *qdev) r =ttm_bo_device_init (&qdev->mman.bdev, &qxl_bo_driver, qdev->ddev.anon_inode->i_mapping, +NULL , false);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
drivers/gpu/drm/radeon/radeon_ttm.c +1 -0
@@ -794,6 +794,7 @@ int radeon_ttm_init(struct radeon_device *rdev) r =ttm_bo_device_init (&rdev->mman.bdev, &radeon_bo_driver, rdev->ddev->anon_inode->i_mapping, +NULL , rdev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
drivers/gpu/drm/ttm/ttm_bo.c +9 -4
@@ -672,7 +672,7 @@ static void ttm_bo_release(struct kref *kref)struct ttm_bo_device *bdev = bo->bdev;struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type]; -drm_vma_offset_remove (&bdev->vma_manager, &bo->base.vma_node); +drm_vma_offset_remove (bdev->vma_manager, &bo->base.vma_node);ttm_mem_io_lock (man, false);ttm_mem_io_free_vm (bo);ttm_mem_io_unlock (man);
@@ -1353,7 +1353,7 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,*/ if (bo->type == ttm_bo_type_device || bo->type == ttm_bo_type_sg) - ret =drm_vma_offset_add (&bdev->vma_manager, &bo->base.vma_node, + ret =drm_vma_offset_add (bdev->vma_manager, &bo->base.vma_node, bo->mem.num_pages);/* passed reservation objects should already be locked,
@@ -1704,7 +1704,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev)pr_debug ("Swap list %d was clean\n" , i);spin_unlock (&glob->lru_lock); -drm_vma_offset_manager_destroy (&bdev->vma_manager); +drm_vma_offset_manager_destroy (&bdev->_vma_manager);if (!ret)ttm_bo_global_release ();
@@ -1716,11 +1716,15 @@ EXPORT_SYMBOL(ttm_bo_device_release);int ttm_bo_device_init (struct ttm_bo_device *bdev,struct ttm_bo_driver *driver,struct address_space *mapping, +struct drm_vma_offset_manager *vma_manager,bool need_dma32) {struct ttm_bo_global *glob = &ttm_bo_glob;int ret; +if (!vma_manager) + vma_manager = &bdev->_vma_manager; + ret =ttm_bo_global_init ();if (ret)return ret;
@@ -1737,7 +1741,8 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,if (unlikely (ret !=0 )) goto out_no_sys; -drm_vma_offset_manager_init (&bdev->vma_manager, + bdev->vma_manager = vma_manager; +drm_vma_offset_manager_init (&bdev->_vma_manager,DRM_FILE_PAGE_OFFSET_START ,DRM_FILE_PAGE_OFFSET_SIZE );INIT_DELAYED_WORK (&bdev->wq, ttm_bo_delayed_workqueue);
drivers/gpu/drm/ttm/ttm_bo_vm.c +3 -3
@@ -409,16 +409,16 @@ static struct ttm_buffer_object *ttm_bo_vm_lookup(struct ttm_bo_device *bdev,struct drm_vma_offset_node *node;struct ttm_buffer_object *bo =NULL ; -drm_vma_offset_lock_lookup (&bdev->vma_manager); +drm_vma_offset_lock_lookup (bdev->vma_manager); - node =drm_vma_offset_lookup_locked (&bdev->vma_manager, offset, pages); + node =drm_vma_offset_lookup_locked (bdev->vma_manager, offset, pages);if (likely (node)) { bo = container_of(node, struct ttm_buffer_object, base.vma_node); bo =ttm_bo_get_unless_zero (bo); } -drm_vma_offset_unlock_lookup (&bdev->vma_manager); +drm_vma_offset_unlock_lookup (bdev->vma_manager);if (!bo)pr_err ("Could not find buffer object to map\n" );
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -0
@@ -830,6 +830,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) ret =ttm_bo_device_init (&dev_priv->bdev, &vmw_bo_driver, dev->anon_inode->i_mapping, +NULL , false);if (unlikely (ret !=0 )) {DRM_ERROR ("Failed initializing TTM buffer object driver.\n" );
Signature · 6 lines
2.18.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 05.09.19 um 09:05 schrieb Gerd Hoffmann:
Quoted 10 lines
Rename the embedded struct
vma_offset_manager, new name is_vma_manager. ttm_bo_device.vma_manager changed to a pointer.The
ttm_bo_device_init()function gets an additionalvma_managerargument which allows to initialize ttm with a different vma manager. When passing NULL the embedded_vma_manageris used.All callers are updated to pass NULL, so the behavior doesn't change.
Signed-off-by Gerd Hoffmann <[email protected]>
Quoted 198 lines
--- include/drm/ttm/ttm_bo_driver.h | 8 ++++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/drm_vram_mm_helper.c | 1 + drivers/gpu/drm/nouveau/nouveau_ttm.c | 1 + drivers/gpu/drm/qxl/qxl_ttm.c | 1 + drivers/gpu/drm/radeon/radeon_ttm.c | 1 + drivers/gpu/drm/ttm/ttm_bo.c | 13 +++++++++---- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 + 9 files changed, 24 insertions(+), 9 deletions(-)include/drm/ttm/ttm_bo_driver.h +6
-2@@ -441,7 +441,8 @@ extern struct ttm_bo_global {* * @driver: Pointer to a struct ttm_bo_driver struct setup by the driver. * @man: An array of mem_type_managers. -* @vma_manager: Address space manager +* @vma_manager: Address space manager (pointer) +* @_vma_manager: Address space manager (enbedded) * lru_lock: Spinlock that protects the buffer+device lru lists and * ddestroy lists. * @dev_mapping: A pointer to the struct address_space representing the @@ -464,7 +465,8 @@ struct ttm_bo_device {/* * Protected by internal locks. */ -struct drm_vma_offset_manager vma_manager; +struct drm_vma_offset_manager *vma_manager; +struct drm_vma_offset_manager _vma_manager;/* * Protected by the global:lru lock. @@ -585,6 +587,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);* @glob: A pointer to an initialized struct ttm_bo_global. * @driver: A pointer to a struct ttm_bo_driver set up by the caller. * @mapping: The address space to use for this bo. +* @vma_manager: A pointer to a vma manager or NULL. * @file_page_offset: Offset into the device address space that is available * for buffer data. This ensures compatibility with other users of the * address space. @@ -596,6 +599,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);int ttm_bo_device_init (struct ttm_bo_device *bdev,struct ttm_bo_driver *driver,struct address_space *mapping, +struct drm_vma_offset_manager *vma_manager,bool need_dma32);/** drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-0@@ -1728,6 +1728,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) r =ttm_bo_device_init (&adev->mman.bdev, &amdgpu_bo_driver, adev->ddev->anon_inode->i_mapping, +NULL , adev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);drivers/gpu/drm/drm_vram_mm_helper.c +1
-0@@ -172,6 +172,7 @@ int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, ret =ttm_bo_device_init (&vmm->bdev, &bo_driver, dev->anon_inode->i_mapping, +NULL , true);if (ret)return ret;drivers/gpu/drm/nouveau/nouveau_ttm.c +1
-0@@ -236,6 +236,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ret =ttm_bo_device_init (&drm->ttm.bdev, &nouveau_bo_driver, dev->anon_inode->i_mapping, +NULL , drm->client.mmu.dmabits <=32 ? true : false);if (ret) {NV_ERROR (drm,"error initialising bo driver, %d\n" , ret);drivers/gpu/drm/qxl/qxl_ttm.c +1
-0@@ -325,6 +325,7 @@ int qxl_ttm_init(struct qxl_device *qdev) r =ttm_bo_device_init (&qdev->mman.bdev, &qxl_bo_driver, qdev->ddev.anon_inode->i_mapping, +NULL , false);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);drivers/gpu/drm/radeon/radeon_ttm.c +1
-0@@ -794,6 +794,7 @@ int radeon_ttm_init(struct radeon_device *rdev) r =ttm_bo_device_init (&rdev->mman.bdev, &radeon_bo_driver, rdev->ddev->anon_inode->i_mapping, +NULL , rdev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);drivers/gpu/drm/ttm/ttm_bo.c +9
-4@@ -672,7 +672,7 @@ static void ttm_bo_release(struct kref *kref)struct ttm_bo_device *bdev = bo->bdev;struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type]; -drm_vma_offset_remove (&bdev->vma_manager, &bo->base.vma_node); +drm_vma_offset_remove (bdev->vma_manager, &bo->base.vma_node);ttm_mem_io_lock (man, false);ttm_mem_io_free_vm (bo);ttm_mem_io_unlock (man);@@ -1353,7 +1353,7 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,*/ if (bo->type == ttm_bo_type_device || bo->type == ttm_bo_type_sg) - ret =drm_vma_offset_add (&bdev->vma_manager, &bo->base.vma_node, + ret =drm_vma_offset_add (bdev->vma_manager, &bo->base.vma_node, bo->mem.num_pages);/* passed reservation objects should already be locked, @@ -1704,7 +1704,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev)pr_debug ("Swap list %d was clean\n" , i);spin_unlock (&glob->lru_lock); -drm_vma_offset_manager_destroy (&bdev->vma_manager); +drm_vma_offset_manager_destroy (&bdev->_vma_manager);if (!ret)ttm_bo_global_release ();@@ -1716,11 +1716,15 @@ EXPORT_SYMBOL(ttm_bo_device_release);int ttm_bo_device_init (struct ttm_bo_device *bdev,struct ttm_bo_driver *driver,struct address_space *mapping, +struct drm_vma_offset_manager *vma_manager,bool need_dma32) {struct ttm_bo_global *glob = &ttm_bo_glob;int ret; +if (!vma_manager) + vma_manager = &bdev->_vma_manager; + ret =ttm_bo_global_init ();if (ret)return ret;@@ -1737,7 +1741,8 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,if (unlikely (ret !=0 )) goto out_no_sys; -drm_vma_offset_manager_init (&bdev->vma_manager, + bdev->vma_manager = vma_manager; +drm_vma_offset_manager_init (&bdev->_vma_manager,DRM_FILE_PAGE_OFFSET_START ,DRM_FILE_PAGE_OFFSET_SIZE );INIT_DELAYED_WORK (&bdev->wq, ttm_bo_delayed_workqueue);drivers/gpu/drm/ttm/ttm_bo_vm.c +3
-3@@ -409,16 +409,16 @@ static struct ttm_buffer_object *ttm_bo_vm_lookup(struct ttm_bo_device *bdev,struct drm_vma_offset_node *node;struct ttm_buffer_object *bo =NULL ; -drm_vma_offset_lock_lookup (&bdev->vma_manager); +drm_vma_offset_lock_lookup (bdev->vma_manager); - node =drm_vma_offset_lookup_locked (&bdev->vma_manager, offset, pages); + node =drm_vma_offset_lookup_locked (bdev->vma_manager, offset, pages);if (likely (node)) { bo = container_of(node, struct ttm_buffer_object, base.vma_node); bo =ttm_bo_get_unless_zero (bo); } -drm_vma_offset_unlock_lookup (&bdev->vma_manager); +drm_vma_offset_unlock_lookup (bdev->vma_manager);if (!bo)pr_err ("Could not find buffer object to map\n" );drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +0
-0
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) · line 836
Quoted 7 lines
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1
-0@@ -830,6 +830,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) ret =ttm_bo_device_init (&dev_priv->bdev, &vmw_bo_driver, dev->anon_inode->i_mapping, +NULL , false);if (unlikely (ret !=0 )) {DRM_ERROR ("Failed initializing TTM buffer object driver.\n" );
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 05.09.19 um 09:05 schrieb Gerd Hoffmann:
Quoted 10 lines
Rename the embedded struct
vma_offset_manager, new name is_vma_manager. ttm_bo_device.vma_manager changed to a pointer.The
ttm_bo_device_init()function gets an additionalvma_managerargument which allows to initialize ttm with a different vma manager. When passing NULL the embedded_vma_manageris used.All callers are updated to pass NULL, so the behavior doesn't change.
Signed-off-by Gerd Hoffmann <[email protected]>
Quoted 198 lines
--- include/drm/ttm/ttm_bo_driver.h | 8 ++++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/drm_vram_mm_helper.c | 1 + drivers/gpu/drm/nouveau/nouveau_ttm.c | 1 + drivers/gpu/drm/qxl/qxl_ttm.c | 1 + drivers/gpu/drm/radeon/radeon_ttm.c | 1 + drivers/gpu/drm/ttm/ttm_bo.c | 13 +++++++++---- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 + 9 files changed, 24 insertions(+), 9 deletions(-)include/drm/ttm/ttm_bo_driver.h +6
-2@@ -441,7 +441,8 @@ extern struct ttm_bo_global {* * @driver: Pointer to a struct ttm_bo_driver struct setup by the driver. * @man: An array of mem_type_managers. -* @vma_manager: Address space manager +* @vma_manager: Address space manager (pointer) +* @_vma_manager: Address space manager (enbedded) * lru_lock: Spinlock that protects the buffer+device lru lists and * ddestroy lists. * @dev_mapping: A pointer to the struct address_space representing the @@ -464,7 +465,8 @@ struct ttm_bo_device {/* * Protected by internal locks. */ -struct drm_vma_offset_manager vma_manager; +struct drm_vma_offset_manager *vma_manager; +struct drm_vma_offset_manager _vma_manager;/* * Protected by the global:lru lock. @@ -585,6 +587,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);* @glob: A pointer to an initialized struct ttm_bo_global. * @driver: A pointer to a struct ttm_bo_driver set up by the caller. * @mapping: The address space to use for this bo. +* @vma_manager: A pointer to a vma manager or NULL. * @file_page_offset: Offset into the device address space that is available * for buffer data. This ensures compatibility with other users of the * address space. @@ -596,6 +599,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);int ttm_bo_device_init (struct ttm_bo_device *bdev,struct ttm_bo_driver *driver,struct address_space *mapping, +struct drm_vma_offset_manager *vma_manager,bool need_dma32);/** drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1
-0@@ -1728,6 +1728,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) r =ttm_bo_device_init (&adev->mman.bdev, &amdgpu_bo_driver, adev->ddev->anon_inode->i_mapping, +NULL , adev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);drivers/gpu/drm/drm_vram_mm_helper.c +1
-0@@ -172,6 +172,7 @@ int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, ret =ttm_bo_device_init (&vmm->bdev, &bo_driver, dev->anon_inode->i_mapping, +NULL , true);if (ret)return ret;drivers/gpu/drm/nouveau/nouveau_ttm.c +1
-0@@ -236,6 +236,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ret =ttm_bo_device_init (&drm->ttm.bdev, &nouveau_bo_driver, dev->anon_inode->i_mapping, +NULL , drm->client.mmu.dmabits <=32 ? true : false);if (ret) {NV_ERROR (drm,"error initialising bo driver, %d\n" , ret);drivers/gpu/drm/qxl/qxl_ttm.c +1
-0@@ -325,6 +325,7 @@ int qxl_ttm_init(struct qxl_device *qdev) r =ttm_bo_device_init (&qdev->mman.bdev, &qxl_bo_driver, qdev->ddev.anon_inode->i_mapping, +NULL , false);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);drivers/gpu/drm/radeon/radeon_ttm.c +1
-0@@ -794,6 +794,7 @@ int radeon_ttm_init(struct radeon_device *rdev) r =ttm_bo_device_init (&rdev->mman.bdev, &radeon_bo_driver, rdev->ddev->anon_inode->i_mapping, +NULL , rdev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);drivers/gpu/drm/ttm/ttm_bo.c +9
-4@@ -672,7 +672,7 @@ static void ttm_bo_release(struct kref *kref)struct ttm_bo_device *bdev = bo->bdev;struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type]; -drm_vma_offset_remove (&bdev->vma_manager, &bo->base.vma_node); +drm_vma_offset_remove (bdev->vma_manager, &bo->base.vma_node);ttm_mem_io_lock (man, false);ttm_mem_io_free_vm (bo);ttm_mem_io_unlock (man);@@ -1353,7 +1353,7 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,*/ if (bo->type == ttm_bo_type_device || bo->type == ttm_bo_type_sg) - ret =drm_vma_offset_add (&bdev->vma_manager, &bo->base.vma_node, + ret =drm_vma_offset_add (bdev->vma_manager, &bo->base.vma_node, bo->mem.num_pages);/* passed reservation objects should already be locked, @@ -1704,7 +1704,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev)pr_debug ("Swap list %d was clean\n" , i);spin_unlock (&glob->lru_lock); -drm_vma_offset_manager_destroy (&bdev->vma_manager); +drm_vma_offset_manager_destroy (&bdev->_vma_manager);if (!ret)ttm_bo_global_release ();@@ -1716,11 +1716,15 @@ EXPORT_SYMBOL(ttm_bo_device_release);int ttm_bo_device_init (struct ttm_bo_device *bdev,struct ttm_bo_driver *driver,struct address_space *mapping, +struct drm_vma_offset_manager *vma_manager,bool need_dma32) {struct ttm_bo_global *glob = &ttm_bo_glob;int ret; +if (!vma_manager) + vma_manager = &bdev->_vma_manager; + ret =ttm_bo_global_init ();if (ret)return ret;@@ -1737,7 +1741,8 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,if (unlikely (ret !=0 )) goto out_no_sys; -drm_vma_offset_manager_init (&bdev->vma_manager, + bdev->vma_manager = vma_manager; +drm_vma_offset_manager_init (&bdev->_vma_manager,DRM_FILE_PAGE_OFFSET_START ,DRM_FILE_PAGE_OFFSET_SIZE );INIT_DELAYED_WORK (&bdev->wq, ttm_bo_delayed_workqueue);drivers/gpu/drm/ttm/ttm_bo_vm.c +3
-3@@ -409,16 +409,16 @@ static struct ttm_buffer_object *ttm_bo_vm_lookup(struct ttm_bo_device *bdev,struct drm_vma_offset_node *node;struct ttm_buffer_object *bo =NULL ; -drm_vma_offset_lock_lookup (&bdev->vma_manager); +drm_vma_offset_lock_lookup (bdev->vma_manager); - node =drm_vma_offset_lookup_locked (&bdev->vma_manager, offset, pages); + node =drm_vma_offset_lookup_locked (bdev->vma_manager, offset, pages);if (likely (node)) { bo = container_of(node, struct ttm_buffer_object, base.vma_node); bo =ttm_bo_get_unless_zero (bo); } -drm_vma_offset_unlock_lookup (&bdev->vma_manager); +drm_vma_offset_unlock_lookup (bdev->vma_manager);if (!bo)pr_err ("Could not find buffer object to map\n" );drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +0
-0
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) · line 836
Quoted 7 lines
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1
-0@@ -830,6 +830,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) ret =ttm_bo_device_init (&dev_priv->bdev, &vmw_bo_driver, dev->anon_inode->i_mapping, +NULL , false);if (unlikely (ret !=0 )) {DRM_ERROR ("Failed initializing TTM buffer object driver.\n" );
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
Gerd Hoffmann
maintainerPATCH 1/8 drm/ttm: turn ttm_bo_device.vma_manager into a pointer
In reply to a message not in the archiveRename the embedded struct vma_offset_manager, new name is _vma_manager. ttm_bo_device.vma_manager changed to a pointer.
The ttm_bo_device_init() function gets an additional vma_manager argument which allows to initialize ttm with a different vma manager. When passing NULL the embedded _vma_manager is used.
All callers are updated to pass NULL, so the behavior doesn't change.
--- include/drm/ttm/ttm_bo_driver.h | 8 ++++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/drm_vram_mm_helper.c | 1 + drivers/gpu/drm/nouveau/nouveau_ttm.c | 1 + drivers/gpu/drm/qxl/qxl_ttm.c | 1 + drivers/gpu/drm/radeon/radeon_ttm.c | 1 + drivers/gpu/drm/ttm/ttm_bo.c | 13 +++++++++---- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 1 + 9 files changed, 24 insertions(+), 9 deletions(-)
include/drm/ttm/ttm_bo_driver.h +6 -2
@@ -441,7 +441,8 @@ extern struct ttm_bo_global {* * @driver: Pointer to a struct ttm_bo_driver struct setup by the driver. * @man: An array of mem_type_managers. -* @vma_manager: Address space manager +* @vma_manager: Address space manager (pointer) +* @_vma_manager: Address space manager (enbedded) * lru_lock: Spinlock that protects the buffer+device lru lists and * ddestroy lists. * @dev_mapping: A pointer to the struct address_space representing the
@@ -464,7 +465,8 @@ struct ttm_bo_device {/* * Protected by internal locks. */ -struct drm_vma_offset_manager vma_manager; +struct drm_vma_offset_manager *vma_manager; +struct drm_vma_offset_manager _vma_manager;/* * Protected by the global:lru lock.
@@ -585,6 +587,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);* @glob: A pointer to an initialized struct ttm_bo_global. * @driver: A pointer to a struct ttm_bo_driver set up by the caller. * @mapping: The address space to use for this bo. +* @vma_manager: A pointer to a vma manager or NULL. * @file_page_offset: Offset into the device address space that is available * for buffer data. This ensures compatibility with other users of the * address space.
@@ -596,6 +599,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);int ttm_bo_device_init (struct ttm_bo_device *bdev,struct ttm_bo_driver *driver,struct address_space *mapping, +struct drm_vma_offset_manager *vma_manager,bool need_dma32);/**
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -0
@@ -1728,6 +1728,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) r =ttm_bo_device_init (&adev->mman.bdev, &amdgpu_bo_driver, adev->ddev->anon_inode->i_mapping, +NULL , adev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
drivers/gpu/drm/drm_vram_mm_helper.c +1 -0
@@ -172,6 +172,7 @@ int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, ret =ttm_bo_device_init (&vmm->bdev, &bo_driver, dev->anon_inode->i_mapping, +NULL , true);if (ret)return ret;
drivers/gpu/drm/nouveau/nouveau_ttm.c +1 -0
@@ -236,6 +236,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ret =ttm_bo_device_init (&drm->ttm.bdev, &nouveau_bo_driver, dev->anon_inode->i_mapping, +NULL , drm->client.mmu.dmabits <=32 ? true : false);if (ret) {NV_ERROR (drm,"error initialising bo driver, %d\n" , ret);
drivers/gpu/drm/qxl/qxl_ttm.c +1 -0
@@ -325,6 +325,7 @@ int qxl_ttm_init(struct qxl_device *qdev) r =ttm_bo_device_init (&qdev->mman.bdev, &qxl_bo_driver, qdev->ddev.anon_inode->i_mapping, +NULL , false);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
drivers/gpu/drm/radeon/radeon_ttm.c +1 -0
@@ -794,6 +794,7 @@ int radeon_ttm_init(struct radeon_device *rdev) r =ttm_bo_device_init (&rdev->mman.bdev, &radeon_bo_driver, rdev->ddev->anon_inode->i_mapping, +NULL , rdev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
drivers/gpu/drm/ttm/ttm_bo.c +9 -4
@@ -672,7 +672,7 @@ static void ttm_bo_release(struct kref *kref)struct ttm_bo_device *bdev = bo->bdev;struct ttm_mem_type_manager *man = &bdev->man[bo->mem.mem_type]; -drm_vma_offset_remove (&bdev->vma_manager, &bo->base.vma_node); +drm_vma_offset_remove (bdev->vma_manager, &bo->base.vma_node);ttm_mem_io_lock (man, false);ttm_mem_io_free_vm (bo);ttm_mem_io_unlock (man);
@@ -1353,7 +1353,7 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev,*/ if (bo->type == ttm_bo_type_device || bo->type == ttm_bo_type_sg) - ret =drm_vma_offset_add (&bdev->vma_manager, &bo->base.vma_node, + ret =drm_vma_offset_add (bdev->vma_manager, &bo->base.vma_node, bo->mem.num_pages);/* passed reservation objects should already be locked,
@@ -1704,7 +1704,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev)pr_debug ("Swap list %d was clean\n" , i);spin_unlock (&glob->lru_lock); -drm_vma_offset_manager_destroy (&bdev->vma_manager); +drm_vma_offset_manager_destroy (&bdev->_vma_manager);if (!ret)ttm_bo_global_release ();
@@ -1716,11 +1716,15 @@ EXPORT_SYMBOL(ttm_bo_device_release);int ttm_bo_device_init (struct ttm_bo_device *bdev,struct ttm_bo_driver *driver,struct address_space *mapping, +struct drm_vma_offset_manager *vma_manager,bool need_dma32) {struct ttm_bo_global *glob = &ttm_bo_glob;int ret; +if (!vma_manager) + vma_manager = &bdev->_vma_manager; + ret =ttm_bo_global_init ();if (ret)return ret;
@@ -1737,7 +1741,8 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,if (unlikely (ret !=0 )) goto out_no_sys; -drm_vma_offset_manager_init (&bdev->vma_manager, + bdev->vma_manager = vma_manager; +drm_vma_offset_manager_init (&bdev->_vma_manager,DRM_FILE_PAGE_OFFSET_START ,DRM_FILE_PAGE_OFFSET_SIZE );INIT_DELAYED_WORK (&bdev->wq, ttm_bo_delayed_workqueue);
drivers/gpu/drm/ttm/ttm_bo_vm.c +3 -3
@@ -409,16 +409,16 @@ static struct ttm_buffer_object *ttm_bo_vm_lookup(struct ttm_bo_device *bdev,struct drm_vma_offset_node *node;struct ttm_buffer_object *bo =NULL ; -drm_vma_offset_lock_lookup (&bdev->vma_manager); +drm_vma_offset_lock_lookup (bdev->vma_manager); - node =drm_vma_offset_lookup_locked (&bdev->vma_manager, offset, pages); + node =drm_vma_offset_lookup_locked (bdev->vma_manager, offset, pages);if (likely (node)) { bo = container_of(node, struct ttm_buffer_object, base.vma_node); bo =ttm_bo_get_unless_zero (bo); } -drm_vma_offset_unlock_lookup (&bdev->vma_manager); +drm_vma_offset_unlock_lookup (bdev->vma_manager);if (!bo)pr_err ("Could not find buffer object to map\n" );
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -0
@@ -830,6 +830,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) ret =ttm_bo_device_init (&dev_priv->bdev, &vmw_bo_driver, dev->anon_inode->i_mapping, +NULL , false);if (unlikely (ret !=0 )) {DRM_ERROR ("Failed initializing TTM buffer object driver.\n" );
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 2/8 drm/nouveau: switch to gem vma offset manager
In reply to a message not in the archivePass gem vma_offset_manager to ttm_bo_device_init(), so ttm uses it instead of its own embedded struct. This makes some gem functions (specifically drm_gem_object_lookup) work on ttm objects.
--- drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/nouveau/nouveau_ttm.c +1 -1
@@ -236,7 +236,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) ret =ttm_bo_device_init (&drm->ttm.bdev, &nouveau_bo_driver, dev->anon_inode->i_mapping, -NULL , + dev->vma_offset_manager, drm->client.mmu.dmabits <=32 ? true : false);if (ret) {NV_ERROR (drm,"error initialising bo driver, %d\n" , ret);
Signature · 6 lines
2.18.1 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
Gerd Hoffmann
maintainerPATCH 3/8 drm/vram: switch to gem vma offset manager
In reply to a message not in the archivePass gem vma_offset_manager to ttm_bo_device_init(), so ttm uses it instead of its own embedded struct. This makes some gem functions (specifically drm_gem_object_lookup) work on ttm objects.
--- drivers/gpu/drm/drm_vram_mm_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_vram_mm_helper.c +1 -1
@@ -172,7 +172,7 @@ int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, ret =ttm_bo_device_init (&vmm->bdev, &bo_driver, dev->anon_inode->i_mapping, -NULL , + dev->vma_offset_manager, true);if (ret)return ret;
Signature · 6 lines
2.18.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/8] drm/vram: switch to gem vma offset manager
Am 05.09.19 um 09:05 schrieb Gerd Hoffmann:
Quoted 15 lines
Pass gem
vma_offset_managertottm_bo_device_init(), so ttm uses it instead of its own embedded struct. This makes some gem functions (specificallydrm_gem_object_lookup) work on ttm objects.Signed-off-by Gerd Hoffmann <[email protected]>--- drivers/gpu/drm/drm_vram_mm_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/drm_vram_mm_helper.c +0
-0
drivers/gpu/drm/drm_vram_mm_helper.c int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, · line 178
Quoted 8 lines
drivers/gpu/drm/drm_vram_mm_helper.c +1
-1@@ -172,7 +172,7 @@ int drm_vram_mm_init(struct drm_vram_mm *vmm, struct drm_device *dev, ret =ttm_bo_device_init (&vmm->bdev, &bo_driver, dev->anon_inode->i_mapping, -NULL , + dev->vma_offset_manager, true);if (ret)return ret;
Signature · 5 lines
Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Gerd Hoffmann
maintainerPATCH 4/8 drm/radeon: switch to gem vma offset manager
In reply to a message not in the archivePass gem vma_offset_manager to ttm_bo_device_init(), so ttm uses it instead of its own embedded struct. This makes some gem functions (specifically drm_gem_object_lookup) work on ttm objects.
--- drivers/gpu/drm/radeon/radeon_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
@@ -794,7 +794,7 @@ int radeon_ttm_init(struct radeon_device *rdev) r =ttm_bo_device_init (&rdev->mman.bdev, &radeon_bo_driver, rdev->ddev->anon_inode->i_mapping, -NULL , + rdev->ddev->vma_offset_manager, rdev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 5/8 drm/amdgpu: switch to gem vma offset manager
In reply to a message not in the archivePass gem vma_offset_manager to ttm_bo_device_init(), so ttm uses it instead of its own embedded struct. This makes some gem functions (specifically drm_gem_object_lookup) work on ttm objects.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
@@ -1728,7 +1728,7 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) r =ttm_bo_device_init (&adev->mman.bdev, &amdgpu_bo_driver, adev->ddev->anon_inode->i_mapping, -NULL , + adev->ddev->vma_offset_manager, adev->need_dma32);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
Signature · 6 lines
2.18.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Gerd Hoffmann
maintainerPATCH 6/8 drm/qxl: switch to gem vma offset manager
In reply to a message not in the archivePass gem vma_offset_manager to ttm_bo_device_init(), so ttm uses it instead of its own embedded struct. This makes some gem functions (specifically drm_gem_object_lookup) work on ttm objects.
--- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_ttm.c +1 -1
@@ -325,7 +325,7 @@ int qxl_ttm_init(struct qxl_device *qdev) r =ttm_bo_device_init (&qdev->mman.bdev, &qxl_bo_driver, qdev->ddev.anon_inode->i_mapping, -NULL , + qdev->ddev.vma_offset_manager, false);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 6/8 drm/qxl: switch to gem vma offset manager
In reply to a message not in the archivePass gem vma_offset_manager to ttm_bo_device_init(), so ttm uses it instead of its own embedded struct. This makes some gem functions (specifically drm_gem_object_lookup) work on ttm objects.
--- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/qxl/qxl_ttm.c +1 -1
@@ -325,7 +325,7 @@ int qxl_ttm_init(struct qxl_device *qdev) r =ttm_bo_device_init (&qdev->mman.bdev, &qxl_bo_driver, qdev->ddev.anon_inode->i_mapping, -NULL , + qdev->ddev.vma_offset_manager, false);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
Signature · 1 line
2.18.1
Gerd Hoffmann
maintainerPATCH 7/8 drm/vmwgfx: switch to own vma manager
In reply to a message not in the archiveAdd struct drm_vma_offset_manager to vma_private, initialize it and pass it to ttm_bo_device_init().
With this in place the last user of ttm's embedded vma offset manager is gone and we can remove it (in a separate patch).
--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +1 -0
@@ -420,6 +420,7 @@ struct vmw_private {struct vmw_fifo_state fifo;struct drm_device *dev; +struct drm_vma_offset_manager vma_manager;unsigned long vmw_chipset;unsigned int io_start;uint32_t vram_start;
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +5 -1
@@ -827,10 +827,13 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) goto out_no_fman; } +drm_vma_offset_manager_init (&dev_priv->vma_manager, +DRM_FILE_PAGE_OFFSET_START , +DRM_FILE_PAGE_OFFSET_SIZE ); ret =ttm_bo_device_init (&dev_priv->bdev, &vmw_bo_driver, dev->anon_inode->i_mapping, -NULL , + &dev_priv->vma_manager, false);if (unlikely (ret !=0 )) {DRM_ERROR ("Failed initializing TTM buffer object driver.\n" );
@@ -987,6 +990,7 @@ static void vmw_driver_unload(struct drm_device *dev)if (dev_priv->has_mob) (void )ttm_bo_clean_mm (&dev_priv->bdev,VMW_PL_MOB ); (void )ttm_bo_device_release (&dev_priv->bdev); +drm_vma_offset_manager_destroy (&dev_priv->vma_manager);vmw_release_device_late (dev_priv);vmw_fence_manager_takedown (dev_priv->fman);if (dev_priv->capabilities &SVGA_CAP_IRQMASK )
Signature · 6 lines
2.18.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 7/8] drm/vmwgfx: switch to own vma manager
Quoted 13 lines · Gerd Hoffmann
Add struct
drm_vma_offset_managertovma_private, initialize it and pass it tottm_bo_device_init().With this in place the last user of ttm's embedded vma offset manager is gone and we can remove it (in a separate patch).
Signed-off-by Gerd Hoffmann <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)
I assume this will be merged through drm-misc?
/Thomas
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
[email protected]
maintainerRe: [PATCH 7/8] drm/vmwgfx: switch to own vma manager
Quoted 15 lines · Thomas Hellstrom
Quoted 13 lines · Gerd Hoffmann
Add struct
drm_vma_offset_managertovma_private, initialize it and pass it tottm_bo_device_init().With this in place the last user of ttm's embedded vma offset manager is gone and we can remove it (in a separate patch).
Signed-off-by Gerd Hoffmann <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-)
Quoted 3 lines
Reviewed-by Thomas Hellström <[email protected]>I assume this will be merged through drm-misc?
Yes, that is the plan (after collecting acks for all drivers).
cheers,
Gerd
Gerd Hoffmann
maintainerPATCH 8/8 drm/ttm: remove embedded vma_offset_manager
In reply to a message not in the archiveNo users left. Drivers either setup vma_offset_manager themself (vmwgfx) or pass the gem vma_offset_manager to ttm_bo_device_init (all other drivers).
--- include/drm/ttm/ttm_bo_driver.h | 4 +--- drivers/gpu/drm/ttm/ttm_bo.c | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-)
include/drm/ttm/ttm_bo_driver.h +1 -3
@@ -442,7 +442,6 @@ extern struct ttm_bo_global {* @driver: Pointer to a struct ttm_bo_driver struct setup by the driver. * @man: An array of mem_type_managers. * @vma_manager: Address space manager (pointer) -* @_vma_manager: Address space manager (enbedded) * lru_lock: Spinlock that protects the buffer+device lru lists and * ddestroy lists. * @dev_mapping: A pointer to the struct address_space representing the
@@ -466,7 +465,6 @@ struct ttm_bo_device {* Protected by internal locks. */ struct drm_vma_offset_manager *vma_manager; -struct drm_vma_offset_manager _vma_manager;/* * Protected by the global:lru lock.
@@ -587,7 +585,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);* @glob: A pointer to an initialized struct ttm_bo_global. * @driver: A pointer to a struct ttm_bo_driver set up by the caller. * @mapping: The address space to use for this bo. -* @vma_manager: A pointer to a vma manager or NULL. +* @vma_manager: A pointer to a vma manager. * @file_page_offset: Offset into the device address space that is available * for buffer data. This ensures compatibility with other users of the * address space.
drivers/gpu/drm/ttm/ttm_bo.c +2 -7
@@ -1704,8 +1704,6 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev)pr_debug ("Swap list %d was clean\n" , i);spin_unlock (&glob->lru_lock); -drm_vma_offset_manager_destroy (&bdev->_vma_manager); -if (!ret)ttm_bo_global_release ();
@@ -1722,8 +1720,8 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,struct ttm_bo_global *glob = &ttm_bo_glob;int ret; -if (!vma_manager) - vma_manager = &bdev->_vma_manager; +if (WARN_ON (vma_manager ==NULL )) +return -EINVAL ; ret =ttm_bo_global_init ();if (ret)
@@ -1742,9 +1740,6 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev, goto out_no_sys; bdev->vma_manager = vma_manager; -drm_vma_offset_manager_init (&bdev->_vma_manager, -DRM_FILE_PAGE_OFFSET_START , -DRM_FILE_PAGE_OFFSET_SIZE );INIT_DELAYED_WORK (&bdev->wq, ttm_bo_delayed_workqueue);INIT_LIST_HEAD (&bdev->ddestroy); bdev->dev_mapping = mapping;
Signature · 6 lines
2.18.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Koenig, Christian
maintainerRe: [PATCH 8/8] drm/ttm: remove embedded vma_offset_manager
Am 05.09.19 um 09:05 schrieb Gerd Hoffmann:
Quoted 5 lines
No users left. Drivers either setup
vma_offset_managerthemself (vmwgfx) or pass the gemvma_offset_managertottm_bo_device_init(all other drivers).Signed-off-by Gerd Hoffmann <[email protected]>
Patches #4, #5 and #8 in this series are Reviewed-by: Christian König <[email protected]>
I can't see the rest in my inbox anywhere. Have you send all of them to dri-devel?
Christian.
Quoted 68 lines
--- include/drm/ttm/ttm_bo_driver.h | 4 +--- drivers/gpu/drm/ttm/ttm_bo.c | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-)include/drm/ttm/ttm_bo_driver.h +1
-3@@ -442,7 +442,6 @@ extern struct ttm_bo_global {* @driver: Pointer to a struct ttm_bo_driver struct setup by the driver. * @man: An array of mem_type_managers. * @vma_manager: Address space manager (pointer) -* @_vma_manager: Address space manager (enbedded) * lru_lock: Spinlock that protects the buffer+device lru lists and * ddestroy lists. * @dev_mapping: A pointer to the struct address_space representing the @@ -466,7 +465,6 @@ struct ttm_bo_device {* Protected by internal locks. */ struct drm_vma_offset_manager *vma_manager; -struct drm_vma_offset_manager _vma_manager;/* * Protected by the global:lru lock. @@ -587,7 +585,7 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev);* @glob: A pointer to an initialized struct ttm_bo_global. * @driver: A pointer to a struct ttm_bo_driver set up by the caller. * @mapping: The address space to use for this bo. -* @vma_manager: A pointer to a vma manager or NULL. +* @vma_manager: A pointer to a vma manager. * @file_page_offset: Offset into the device address space that is available * for buffer data. This ensures compatibility with other users of the * address space. drivers/gpu/drm/ttm/ttm_bo.c +2
-7@@ -1704,8 +1704,6 @@ int ttm_bo_device_release(struct ttm_bo_device *bdev)pr_debug ("Swap list %d was clean\n" , i);spin_unlock (&glob->lru_lock); -drm_vma_offset_manager_destroy (&bdev->_vma_manager); -if (!ret)ttm_bo_global_release ();@@ -1722,8 +1720,8 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,struct ttm_bo_global *glob = &ttm_bo_glob;int ret; -if (!vma_manager) - vma_manager = &bdev->_vma_manager; +if (WARN_ON (vma_manager ==NULL )) +return -EINVAL ; ret =ttm_bo_global_init ();if (ret)@@ -1742,9 +1740,6 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev, goto out_no_sys; bdev->vma_manager = vma_manager; -drm_vma_offset_manager_init (&bdev->_vma_manager, -DRM_FILE_PAGE_OFFSET_START , -DRM_FILE_PAGE_OFFSET_SIZE );INIT_DELAYED_WORK (&bdev->wq, ttm_bo_delayed_workqueue);INIT_LIST_HEAD (&bdev->ddestroy); bdev->dev_mapping = mapping;
Gerd Hoffmann
maintainerRe: [PATCH 8/8] drm/ttm: remove embedded vma_offset_manager
Quoted 5 lines · Christian
Am 05.09.19 um 09:05 schrieb Gerd Hoffmann:
Quoted 4 lines
No users left. Drivers either setup
vma_offset_managerthemself (vmwgfx) or pass the gemvma_offset_managertottm_bo_device_init(all other drivers).
Quoted 7 lines
Quoted 1 line
Signed-off-by Gerd Hoffmann <[email protected]>Patches #4, #5 and #8 in this series are Reviewed-by: Christian König <[email protected]>
I can't see the rest in my inbox anywhere. Have you send all of them to dri-devel?
Yes, they are all on dri-devel, but only a subset is Cc'ed to you. Patches 2-7 switch drivers one-by-one, and I guess you only got the ones where you are listed as driver maintainer/reviewer in MAINTAINERS.
cheers,
Gerd
Daniel Vetter
Reviewed-byRe: [PATCH 0/8] drm/ttm: remove embedded vma_manager from ttm_bo_device
In reply to a message not in the archiveQuoted 11 lines · Gerd Hoffmann
Gerd Hoffmann (8):
drm/ttm: turn ttm_bo_device.vma_manager into a pointer drm/nouveau: switch to gem vma offset manager drm/vram: switch to gem vma offset manager drm/radeon: switch to gem vma offset manager drm/amdgpu: switch to gem vma offset manager drm/qxl: switch to gem vma offset manager drm/vmwgfx: switch to own vma manager drm/ttm: remove embeddedvma_offset_manager
Nice. On the series:
Assuming it compiles, I've relied on that when reviewing.
But definitely wait for a few more days for acks before landing it all. -Daniel
Quoted 20 lines
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h | 1 + include/drm/ttm/ttm_bo_driver.h | 6 ++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/drm_vram_mm_helper.c | 1 + drivers/gpu/drm/nouveau/nouveau_ttm.c | 1 + drivers/gpu/drm/qxl/qxl_ttm.c | 1 + drivers/gpu/drm/radeon/radeon_ttm.c | 1 + drivers/gpu/drm/ttm/ttm_bo.c | 14 +++++++------- drivers/gpu/drm/ttm/ttm_bo_vm.c | 6 +++--- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 5 +++++ 10 files changed, 25 insertions(+), 12 deletions(-)Signature · 6 lines
2.18.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel