.. | .. |
---|
68 | 68 | #include <linux/hashtable.h> |
---|
69 | 69 | #include <linux/dma-fence.h> |
---|
70 | 70 | |
---|
| 71 | +#ifdef CONFIG_MMU_NOTIFIER |
---|
| 72 | +#include <linux/mmu_notifier.h> |
---|
| 73 | +#endif |
---|
| 74 | + |
---|
71 | 75 | #include <drm/ttm/ttm_bo_api.h> |
---|
72 | 76 | #include <drm/ttm/ttm_bo_driver.h> |
---|
73 | 77 | #include <drm/ttm/ttm_placement.h> |
---|
.. | .. |
---|
448 | 452 | * TTM. |
---|
449 | 453 | */ |
---|
450 | 454 | struct radeon_mman { |
---|
451 | | - struct ttm_bo_global_ref bo_global_ref; |
---|
452 | | - struct drm_global_reference mem_global_ref; |
---|
453 | 455 | struct ttm_bo_device bdev; |
---|
454 | | - bool mem_global_referenced; |
---|
455 | 456 | bool initialized; |
---|
456 | 457 | |
---|
457 | 458 | #if defined(CONFIG_DEBUG_FS) |
---|
.. | .. |
---|
508 | 509 | struct list_head va; |
---|
509 | 510 | /* Constant after initialization */ |
---|
510 | 511 | struct radeon_device *rdev; |
---|
511 | | - struct drm_gem_object gem_base; |
---|
512 | 512 | |
---|
513 | 513 | struct ttm_bo_kmap_obj dma_buf_vmap; |
---|
514 | 514 | pid_t pid; |
---|
515 | 515 | |
---|
516 | | - struct radeon_mn *mn; |
---|
517 | | - struct list_head mn_list; |
---|
| 516 | +#ifdef CONFIG_MMU_NOTIFIER |
---|
| 517 | + struct mmu_interval_notifier notifier; |
---|
| 518 | +#endif |
---|
518 | 519 | }; |
---|
519 | | -#define gem_to_radeon_bo(gobj) container_of((gobj), struct radeon_bo, gem_base) |
---|
| 520 | +#define gem_to_radeon_bo(gobj) container_of((gobj), struct radeon_bo, tbo.base) |
---|
520 | 521 | |
---|
521 | 522 | int radeon_gem_debugfs_init(struct radeon_device *rdev); |
---|
522 | 523 | |
---|
.. | .. |
---|
623 | 624 | struct radeon_fence *fence); |
---|
624 | 625 | int radeon_sync_resv(struct radeon_device *rdev, |
---|
625 | 626 | struct radeon_sync *sync, |
---|
626 | | - struct reservation_object *resv, |
---|
| 627 | + struct dma_resv *resv, |
---|
627 | 628 | bool shared); |
---|
628 | 629 | int radeon_sync_rings(struct radeon_device *rdev, |
---|
629 | 630 | struct radeon_sync *sync, |
---|
.. | .. |
---|
1917 | 1918 | uint64_t src_offset, |
---|
1918 | 1919 | uint64_t dst_offset, |
---|
1919 | 1920 | unsigned num_gpu_pages, |
---|
1920 | | - struct reservation_object *resv); |
---|
| 1921 | + struct dma_resv *resv); |
---|
1921 | 1922 | u32 blit_ring_index; |
---|
1922 | 1923 | struct radeon_fence *(*dma)(struct radeon_device *rdev, |
---|
1923 | 1924 | uint64_t src_offset, |
---|
1924 | 1925 | uint64_t dst_offset, |
---|
1925 | 1926 | unsigned num_gpu_pages, |
---|
1926 | | - struct reservation_object *resv); |
---|
| 1927 | + struct dma_resv *resv); |
---|
1927 | 1928 | u32 dma_ring_index; |
---|
1928 | 1929 | /* method used for bo copy */ |
---|
1929 | 1930 | struct radeon_fence *(*copy)(struct radeon_device *rdev, |
---|
1930 | 1931 | uint64_t src_offset, |
---|
1931 | 1932 | uint64_t dst_offset, |
---|
1932 | 1933 | unsigned num_gpu_pages, |
---|
1933 | | - struct reservation_object *resv); |
---|
| 1934 | + struct dma_resv *resv); |
---|
1934 | 1935 | /* ring used for bo copies */ |
---|
1935 | 1936 | u32 copy_ring_index; |
---|
1936 | 1937 | } copy; |
---|
.. | .. |
---|
2391 | 2392 | struct radeon_wb wb; |
---|
2392 | 2393 | struct radeon_dummy_page dummy_page; |
---|
2393 | 2394 | bool shutdown; |
---|
2394 | | - bool need_dma32; |
---|
2395 | 2395 | bool need_swiotlb; |
---|
2396 | 2396 | bool accel_working; |
---|
2397 | 2397 | bool fastfb_working; /* IGP feature*/ |
---|
.. | .. |
---|
2455 | 2455 | /* tracking pinned memory */ |
---|
2456 | 2456 | u64 vram_pin_size; |
---|
2457 | 2457 | u64 gart_pin_size; |
---|
2458 | | - |
---|
2459 | | - struct mutex mn_lock; |
---|
2460 | | - DECLARE_HASHTABLE(mn_hash, 7); |
---|
2461 | 2458 | }; |
---|
2462 | 2459 | |
---|
2463 | 2460 | bool radeon_is_px(struct drm_device *dev); |
---|
.. | .. |
---|
2819 | 2816 | extern void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable); |
---|
2820 | 2817 | extern void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain); |
---|
2821 | 2818 | extern bool radeon_ttm_bo_is_radeon_bo(struct ttm_buffer_object *bo); |
---|
2822 | | -extern int radeon_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr, |
---|
| 2819 | +extern int radeon_ttm_tt_set_userptr(struct radeon_device *rdev, |
---|
| 2820 | + struct ttm_tt *ttm, uint64_t addr, |
---|
2823 | 2821 | uint32_t flags); |
---|
2824 | | -extern bool radeon_ttm_tt_has_userptr(struct ttm_tt *ttm); |
---|
2825 | | -extern bool radeon_ttm_tt_is_readonly(struct ttm_tt *ttm); |
---|
| 2822 | +extern bool radeon_ttm_tt_has_userptr(struct radeon_device *rdev, struct ttm_tt *ttm); |
---|
| 2823 | +extern bool radeon_ttm_tt_is_readonly(struct radeon_device *rdev, struct ttm_tt *ttm); |
---|
| 2824 | +bool radeon_ttm_tt_is_bound(struct ttm_bo_device *bdev, struct ttm_tt *ttm); |
---|
2826 | 2825 | extern void radeon_vram_location(struct radeon_device *rdev, struct radeon_mc *mc, u64 base); |
---|
2827 | 2826 | extern void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc); |
---|
2828 | 2827 | extern int radeon_resume_kms(struct drm_device *dev, bool resume, bool fbcon); |
---|
.. | .. |
---|
2832 | 2831 | extern void radeon_program_register_sequence(struct radeon_device *rdev, |
---|
2833 | 2832 | const u32 *registers, |
---|
2834 | 2833 | const u32 array_size); |
---|
| 2834 | +struct radeon_device *radeon_get_rdev(struct ttm_bo_device *bdev); |
---|
2835 | 2835 | |
---|
2836 | 2836 | /* |
---|
2837 | 2837 | * vm |
---|
.. | .. |
---|
2860 | 2860 | struct radeon_vm *vm); |
---|
2861 | 2861 | int radeon_vm_bo_update(struct radeon_device *rdev, |
---|
2862 | 2862 | struct radeon_bo_va *bo_va, |
---|
2863 | | - struct ttm_mem_reg *mem); |
---|
| 2863 | + struct ttm_resource *mem); |
---|
2864 | 2864 | void radeon_vm_bo_invalidate(struct radeon_device *rdev, |
---|
2865 | 2865 | struct radeon_bo *bo); |
---|
2866 | 2866 | struct radeon_bo_va *radeon_vm_bo_find(struct radeon_vm *vm, |
---|