Commit d398811e authored by Dave Airlie's avatar Dave Airlie

drm/ttm: allow drivers to provide their own manager subclasses

This will get removed eventually and all drivers will use this.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-45-airlied@gmail.com
parent 01057278
...@@ -419,7 +419,7 @@ struct ttm_bo_device { ...@@ -419,7 +419,7 @@ struct ttm_bo_device {
* access via ttm_manager_type. * access via ttm_manager_type.
*/ */
struct ttm_mem_type_manager man_priv[TTM_NUM_MEM_TYPES]; struct ttm_mem_type_manager man_priv[TTM_NUM_MEM_TYPES];
struct ttm_mem_type_manager *man_drv[TTM_NUM_MEM_TYPES];
/* /*
* Protected by internal locks. * Protected by internal locks.
*/ */
...@@ -450,9 +450,18 @@ struct ttm_bo_device { ...@@ -450,9 +450,18 @@ struct ttm_bo_device {
static inline struct ttm_mem_type_manager *ttm_manager_type(struct ttm_bo_device *bdev, static inline struct ttm_mem_type_manager *ttm_manager_type(struct ttm_bo_device *bdev,
int mem_type) int mem_type)
{ {
if (bdev->man_drv[mem_type])
return bdev->man_drv[mem_type];
return &bdev->man_priv[mem_type]; return &bdev->man_priv[mem_type];
} }
static inline void ttm_set_driver_manager(struct ttm_bo_device *bdev,
int type,
struct ttm_mem_type_manager *manager)
{
bdev->man_drv[type] = manager;
}
/** /**
* struct ttm_lru_bulk_move_pos * struct ttm_lru_bulk_move_pos
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment