ttm_mock_manager.h 853 B

123456789101112131415161718192021222324252627282930
  1. /* SPDX-License-Identifier: GPL-2.0 AND MIT */
  2. /*
  3. * Copyright © 2023 Intel Corporation
  4. */
  5. #ifndef TTM_MOCK_MANAGER_H
  6. #define TTM_MOCK_MANAGER_H
  7. #include <drm/drm_buddy.h>
  8. struct ttm_mock_manager {
  9. struct ttm_resource_manager man;
  10. struct drm_buddy mm;
  11. u64 default_page_size;
  12. /* protects allocations of mock buffer objects */
  13. struct mutex lock;
  14. };
  15. struct ttm_mock_resource {
  16. struct ttm_resource base;
  17. struct list_head blocks;
  18. unsigned long flags;
  19. };
  20. int ttm_mock_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size);
  21. int ttm_bad_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size);
  22. int ttm_busy_manager_init(struct ttm_device *bdev, u32 mem_type, u32 size);
  23. void ttm_mock_manager_fini(struct ttm_device *bdev, u32 mem_type);
  24. void ttm_bad_manager_fini(struct ttm_device *bdev, u32 mem_type);
  25. #endif // TTM_MOCK_MANAGER_H