aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/ttm
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2014-08-27 07:16:04 -0400
committerChristian König <christian.koenig@amd.com>2014-08-27 07:16:04 -0400
commitf1217ed09f827e42a49ffa6a5aab672aa6f57a65 (patch)
treeab6a78bc2f7b0d42165eb647e13e87f92b97f149 /include/drm/ttm
parent484048db6b4890bc433aac7f5e32fdcf1b2b4786 (diff)
drm/ttm: move fpfn and lpfn into each placement v2
This allows us to more fine grained specify where to place the buffer object. v2: rebased on drm-next, add bochs changes as well Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/drm/ttm')
-rw-r--r--include/drm/ttm/ttm_bo_api.h40
-rw-r--r--include/drm/ttm/ttm_bo_driver.h3
2 files changed, 19 insertions, 24 deletions
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 7526c5bf5610..e3d39c80a091 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -45,12 +45,24 @@ struct ttm_bo_device;
45 45
46struct drm_mm_node; 46struct drm_mm_node;
47 47
48/**
49 * struct ttm_place
50 *
51 * @fpfn: first valid page frame number to put the object
52 * @lpfn: last valid page frame number to put the object
53 * @flags: memory domain and caching flags for the object
54 *
55 * Structure indicating a possible place to put an object.
56 */
57struct ttm_place {
58 unsigned fpfn;
59 unsigned lpfn;
60 uint32_t flags;
61};
48 62
49/** 63/**
50 * struct ttm_placement 64 * struct ttm_placement
51 * 65 *
52 * @fpfn: first valid page frame number to put the object
53 * @lpfn: last valid page frame number to put the object
54 * @num_placement: number of preferred placements 66 * @num_placement: number of preferred placements
55 * @placement: preferred placements 67 * @placement: preferred placements
56 * @num_busy_placement: number of preferred placements when need to evict buffer 68 * @num_busy_placement: number of preferred placements when need to evict buffer
@@ -59,12 +71,10 @@ struct drm_mm_node;
59 * Structure indicating the placement you request for an object. 71 * Structure indicating the placement you request for an object.
60 */ 72 */
61struct ttm_placement { 73struct ttm_placement {
62 unsigned fpfn; 74 unsigned num_placement;
63 unsigned lpfn; 75 const struct ttm_place *placement;
64 unsigned num_placement; 76 unsigned num_busy_placement;
65 const uint32_t *placement; 77 const struct ttm_place *busy_placement;
66 unsigned num_busy_placement;
67 const uint32_t *busy_placement;
68}; 78};
69 79
70/** 80/**
@@ -519,20 +529,6 @@ extern int ttm_bo_create(struct ttm_bo_device *bdev,
519 struct ttm_buffer_object **p_bo); 529 struct ttm_buffer_object **p_bo);
520 530
521/** 531/**
522 * ttm_bo_check_placement
523 *
524 * @bo: the buffer object.
525 * @placement: placements
526 *
527 * Performs minimal validity checking on an intended change of
528 * placement flags.
529 * Returns
530 * -EINVAL: Intended change is invalid or not allowed.
531 */
532extern int ttm_bo_check_placement(struct ttm_buffer_object *bo,
533 struct ttm_placement *placement);
534
535/**
536 * ttm_bo_init_mm 532 * ttm_bo_init_mm
537 * 533 *
538 * @bdev: Pointer to a ttm_bo_device struct. 534 * @bdev: Pointer to a ttm_bo_device struct.
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 1d9f0f1ff52d..5c8bb5699a6f 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -208,8 +208,7 @@ struct ttm_mem_type_manager_func {
208 */ 208 */
209 int (*get_node)(struct ttm_mem_type_manager *man, 209 int (*get_node)(struct ttm_mem_type_manager *man,
210 struct ttm_buffer_object *bo, 210 struct ttm_buffer_object *bo,
211 struct ttm_placement *placement, 211 const struct ttm_place *place,
212 uint32_t flags,
213 struct ttm_mem_reg *mem); 212 struct ttm_mem_reg *mem);
214 213
215 /** 214 /**