drm/ttm: Add the priority queue to appropriate structs
Subsystems (9)
RFC 2/3 drm/ttm: Add the priority queue to appropriate structs
Signed-off-by Lauri Kasanen <[email protected]>
--- drivers/gpu/drm/ast/ast_ttm.c | 1 + drivers/gpu/drm/bochs/bochs_mm.c | 1 + drivers/gpu/drm/cirrus/cirrus_ttm.c | 1 + drivers/gpu/drm/mgag200/mgag200_ttm.c | 1 + drivers/gpu/drm/nouveau/nouveau_ttm.c | 2 +- drivers/gpu/drm/qxl/qxl_ttm.c | 2 +- drivers/gpu/drm/radeon/radeon_ttm.c | 1 + drivers/gpu/drm/ttm/ttm_bo.c | 2 ++ drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- include/drm/ttm/ttm_bo_api.h | 2 ++ include/drm/ttm/ttm_bo_driver.h | 7 +++++++ 11 files changed, 19 insertions(+), 3 deletions(-)
drivers/gpu/drm/ast/ast_ttm.c +1 -0
@@ -263,6 +263,7 @@ int ast_mm_init(struct ast_private *ast) dev->anon_inode->i_mapping,DRM_FILE_PAGE_OFFSET , true, + false, 0);if (ret) {DRM_ERROR ("Error initialising bo driver; %d\n" , ret);
drivers/gpu/drm/bochs/bochs_mm.c +1 -0
@@ -229,6 +229,7 @@ int bochs_mm_init(struct bochs_device *bochs) bochs->dev->anon_inode->i_mapping,DRM_FILE_PAGE_OFFSET , true, + false, 0);if (ret) {DRM_ERROR ("Error initialising bo driver; %d\n" , ret);
drivers/gpu/drm/cirrus/cirrus_ttm.c +1 -0
@@ -263,6 +263,7 @@ int cirrus_mm_init(struct cirrus_device *cirrus) dev->anon_inode->i_mapping,DRM_FILE_PAGE_OFFSET , true, + false, 0);if (ret) {DRM_ERROR ("Error initialising bo driver; %d\n" , ret);
drivers/gpu/drm/mgag200/mgag200_ttm.c +1 -0
@@ -263,6 +263,7 @@ int mgag200_mm_init(struct mga_device *mdev) dev->anon_inode->i_mapping,DRM_FILE_PAGE_OFFSET , true, + false, 0);if (ret) {DRM_ERROR ("Error initialising bo driver; %d\n" , ret);
drivers/gpu/drm/nouveau/nouveau_ttm.c +1 -1
@@ -384,7 +384,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) &nouveau_bo_driver, dev->anon_inode->i_mapping,DRM_FILE_PAGE_OFFSET , - bits <= 32 ? true : false, 0); + bits <= 32 ? true : false, false, 0);if (ret) {NV_ERROR (drm,"error initialising bo driver, %d\n" , ret);return ret;
drivers/gpu/drm/qxl/qxl_ttm.c +1 -1
@@ -495,7 +495,7 @@ int qxl_ttm_init(struct qxl_device *qdev) qdev->mman.bo_global_ref.ref.object, &qxl_bo_driver, qdev->ddev->anon_inode->i_mapping, - DRM_FILE_PAGE_OFFSET, 0, 0); + DRM_FILE_PAGE_OFFSET, 0, false, 0);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);return r;
drivers/gpu/drm/radeon/radeon_ttm.c +1 -0
@@ -711,6 +711,7 @@ int radeon_ttm_init(struct radeon_device *rdev) rdev->ddev->anon_inode->i_mapping,DRM_FILE_PAGE_OFFSET , rdev->need_dma32, + false, 512 * 1024);if (r) {DRM_ERROR ("failed initializing buffer object driver(%d).\n" , r);
drivers/gpu/drm/ttm/ttm_bo.c +2 -0
@@ -1454,6 +1454,7 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev,struct address_space *mapping, uint64_t file_page_offset, bool need_dma32, + bool use_pqueue, uint32_t alloc_threshold) { int ret = -EINVAL;
@@ -1477,6 +1478,7 @@ int ttm_bo_device_init(struct ttm_bo_device *bdev, bdev->dev_mapping = mapping; bdev->glob = glob; bdev->need_dma32 = need_dma32; + bdev->use_pqueue = use_pqueue; bdev->alloc_threshold = alloc_threshold; bdev->val_seq =0 ;spin_lock_init (&bdev->fence_lock);
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -1
@@ -725,7 +725,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) &vmw_bo_driver, dev->anon_inode->i_mapping,VMWGFX_FILE_PAGE_OFFSET , - false, 0); + false, false, 0);if (unlikely (ret !=0 )) {DRM_ERROR ("Failed initializing TTM buffer object driver.\n" ); goto out_err1;
include/drm/ttm/ttm_bo_api.h +2 -0
@@ -33,6 +33,7 @@#include <drm/drm_hashtab.h> #include <drm/drm_vma_manager.h> +#include <ttm/ttm_priority.h> #include <linux/kref.h> #include <linux/list.h> #include <linux/wait.h>
@@ -225,6 +226,7 @@ struct ttm_buffer_object {struct list_head ddestroy;struct list_head swap;struct list_head io_reserve_lru; +struct ttm_pqueue_entry pqueue;/** * Members protected by struct buffer_object_device::fence_lock
include/drm/ttm/ttm_bo_driver.h +7 -0
@@ -34,6 +34,7 @@#include <ttm/ttm_memory.h> #include <ttm/ttm_module.h> #include <ttm/ttm_placement.h> +#include <ttm/ttm_priority.h> #include <drm/drm_mm.h> #include <drm/drm_global.h> #include <drm/drm_vma_manager.h>
@@ -257,6 +258,7 @@ struct ttm_mem_type_manager_func {* @io_reserve_fastpath: Only use bdev::driver::io_mem_reserve to obtain * static information. bdev::driver::io_mem_free is never used. * @lru: The lru list for this memory type. +* @pqueue: The priority queue for this memory type. Only lru or pqueue is used. * * This structure is used to identify and manage memory types for a device. * It's set up by the ttm_bo_driver::init_mem_type method.
@@ -295,6 +297,7 @@ struct ttm_mem_type_manager {*/ struct list_head lru; +struct ttm_pqueue pqueue; };/**
@@ -527,6 +530,7 @@ struct ttm_bo_global {* @dev_mapping: A pointer to the struct address_space representing the * device address space. * @wq: Work queue structure for the delayed delete workqueue. +* @use_pqueue: Whether to use a priority queue for VRAM bos instead of lru. * @alloc_threshold: If non-zero, use this as the threshold for two-ended * allocation. *
@@ -567,6 +571,7 @@ struct ttm_bo_device {struct delayed_work wq;bool need_dma32; +bool use_pqueue;uint32_t alloc_threshold; };
@@ -754,6 +759,7 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);* @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. +* @use_pqueue: Whether to use a priority queue for VRAM bos instead of lru. * @alloc_threshold: If non-zero, use this as the threshold for two-ended * allocation. *
@@ -767,6 +773,7 @@ extern int ttm_bo_device_init(struct ttm_bo_device *bdev,struct address_space *mapping, uint64_t file_page_offset, bool need_dma32, + bool use_pqueue, uint32_t alloc_threshold);/**
Signature · 1 line
1.8.3.1