drm/ttm: add helper structures for bulk moves on lru list
authorChristian König <christian.koenig@amd.com>
Mon, 6 Aug 2018 08:46:26 +0000 (16:46 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 27 Aug 2018 16:11:20 +0000 (11:11 -0500)
Add bulk move pos to store the pointer of first and last buffer object.
The list in between will be bulk moved on lru list.

Signed-off-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Acked-by: Chunming Zhou <david1.zhou@amd.com>
Reviewed-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
include/drm/ttm/ttm_bo_driver.h

index 3234cc322e70eedd8a1cc9d81302153355d9cd63..e4fee8e02559be50a8646710a7370d3033135455 100644 (file)
@@ -490,6 +490,34 @@ struct ttm_bo_device {
        bool no_retry;
 };
 
+/**
+ * struct ttm_lru_bulk_move_pos
+ *
+ * @first: first BO in the bulk move range
+ * @last: last BO in the bulk move range
+ *
+ * Positions for a lru bulk move.
+ */
+struct ttm_lru_bulk_move_pos {
+       struct ttm_buffer_object *first;
+       struct ttm_buffer_object *last;
+};
+
+/**
+ * struct ttm_lru_bulk_move
+ *
+ * @tt: first/last lru entry for BOs in the TT domain
+ * @vram: first/last lru entry for BOs in the VRAM domain
+ * @swap: first/last lru entry for BOs on the swap list
+ *
+ * Helper structure for bulk moves on the LRU list.
+ */
+struct ttm_lru_bulk_move {
+       struct ttm_lru_bulk_move_pos tt[TTM_MAX_BO_PRIORITY];
+       struct ttm_lru_bulk_move_pos vram[TTM_MAX_BO_PRIORITY];
+       struct ttm_lru_bulk_move_pos swap[TTM_MAX_BO_PRIORITY];
+};
+
 /**
  * ttm_flag_masked
  *