diff options
| author | Christian König <christian.koenig@amd.com> | 2017-04-12 09:08:17 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2017-12-06 12:47:55 -0500 |
| commit | 1144b63a162cef5a57b85108b608f2486b0410c9 (patch) | |
| tree | 153c04887ff664e2229725554f776a2b1e921311 /include/drm | |
| parent | ba87349ed31ee623f3380b5feedaf16a8dfa25bf (diff) | |
drm/ttm: cleanup ttm_bo_driver.h
Extern is the default for function declerations anyway.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'include/drm')
| -rw-r--r-- | include/drm/ttm/ttm_bo_driver.h | 114 |
1 files changed, 54 insertions, 60 deletions
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index cba1477aa983..a7c826a1e53f 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
| @@ -627,12 +627,12 @@ ttm_flag_masked(uint32_t *old, uint32_t new, uint32_t mask) | |||
| 627 | * Returns: | 627 | * Returns: |
| 628 | * NULL: Out of memory. | 628 | * NULL: Out of memory. |
| 629 | */ | 629 | */ |
| 630 | extern int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev, | 630 | int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev, |
| 631 | unsigned long size, uint32_t page_flags, | 631 | unsigned long size, uint32_t page_flags, |
| 632 | struct page *dummy_read_page); | 632 | struct page *dummy_read_page); |
| 633 | extern int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, | 633 | int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, |
| 634 | unsigned long size, uint32_t page_flags, | 634 | unsigned long size, uint32_t page_flags, |
| 635 | struct page *dummy_read_page); | 635 | struct page *dummy_read_page); |
| 636 | 636 | ||
| 637 | /** | 637 | /** |
| 638 | * ttm_tt_fini | 638 | * ttm_tt_fini |
| @@ -641,8 +641,8 @@ extern int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bde | |||
| 641 | * | 641 | * |
| 642 | * Free memory of ttm_tt structure | 642 | * Free memory of ttm_tt structure |
| 643 | */ | 643 | */ |
| 644 | extern void ttm_tt_fini(struct ttm_tt *ttm); | 644 | void ttm_tt_fini(struct ttm_tt *ttm); |
| 645 | extern void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma); | 645 | void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma); |
| 646 | 646 | ||
| 647 | /** | 647 | /** |
| 648 | * ttm_ttm_bind: | 648 | * ttm_ttm_bind: |
| @@ -652,7 +652,7 @@ extern void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma); | |||
| 652 | * | 652 | * |
| 653 | * Bind the pages of @ttm to an aperture location identified by @bo_mem | 653 | * Bind the pages of @ttm to an aperture location identified by @bo_mem |
| 654 | */ | 654 | */ |
| 655 | extern int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem); | 655 | int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem); |
| 656 | 656 | ||
| 657 | /** | 657 | /** |
| 658 | * ttm_ttm_destroy: | 658 | * ttm_ttm_destroy: |
| @@ -661,7 +661,7 @@ extern int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem); | |||
| 661 | * | 661 | * |
| 662 | * Unbind, unpopulate and destroy common struct ttm_tt. | 662 | * Unbind, unpopulate and destroy common struct ttm_tt. |
| 663 | */ | 663 | */ |
| 664 | extern void ttm_tt_destroy(struct ttm_tt *ttm); | 664 | void ttm_tt_destroy(struct ttm_tt *ttm); |
| 665 | 665 | ||
| 666 | /** | 666 | /** |
| 667 | * ttm_ttm_unbind: | 667 | * ttm_ttm_unbind: |
| @@ -670,7 +670,7 @@ extern void ttm_tt_destroy(struct ttm_tt *ttm); | |||
| 670 | * | 670 | * |
| 671 | * Unbind a struct ttm_tt. | 671 | * Unbind a struct ttm_tt. |
| 672 | */ | 672 | */ |
| 673 | extern void ttm_tt_unbind(struct ttm_tt *ttm); | 673 | void ttm_tt_unbind(struct ttm_tt *ttm); |
| 674 | 674 | ||
| 675 | /** | 675 | /** |
| 676 | * ttm_tt_swapin: | 676 | * ttm_tt_swapin: |
| @@ -679,7 +679,7 @@ extern void ttm_tt_unbind(struct ttm_tt *ttm); | |||
| 679 | * | 679 | * |
| 680 | * Swap in a previously swap out ttm_tt. | 680 | * Swap in a previously swap out ttm_tt. |
| 681 | */ | 681 | */ |
| 682 | extern int ttm_tt_swapin(struct ttm_tt *ttm); | 682 | int ttm_tt_swapin(struct ttm_tt *ttm); |
| 683 | 683 | ||
| 684 | /** | 684 | /** |
| 685 | * ttm_tt_set_placement_caching: | 685 | * ttm_tt_set_placement_caching: |
| @@ -694,9 +694,8 @@ extern int ttm_tt_swapin(struct ttm_tt *ttm); | |||
| 694 | * hit RAM. This function may be very costly as it involves global TLB | 694 | * hit RAM. This function may be very costly as it involves global TLB |
| 695 | * and cache flushes and potential page splitting / combining. | 695 | * and cache flushes and potential page splitting / combining. |
| 696 | */ | 696 | */ |
| 697 | extern int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement); | 697 | int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement); |
| 698 | extern int ttm_tt_swapout(struct ttm_tt *ttm, | 698 | int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage); |
| 699 | struct file *persistent_swap_storage); | ||
| 700 | 699 | ||
| 701 | /** | 700 | /** |
| 702 | * ttm_tt_unpopulate - free pages from a ttm | 701 | * ttm_tt_unpopulate - free pages from a ttm |
| @@ -705,7 +704,7 @@ extern int ttm_tt_swapout(struct ttm_tt *ttm, | |||
| 705 | * | 704 | * |
| 706 | * Calls the driver method to free all pages from a ttm | 705 | * Calls the driver method to free all pages from a ttm |
| 707 | */ | 706 | */ |
| 708 | extern void ttm_tt_unpopulate(struct ttm_tt *ttm); | 707 | void ttm_tt_unpopulate(struct ttm_tt *ttm); |
| 709 | 708 | ||
| 710 | /* | 709 | /* |
| 711 | * ttm_bo.c | 710 | * ttm_bo.c |
| @@ -720,8 +719,7 @@ extern void ttm_tt_unpopulate(struct ttm_tt *ttm); | |||
| 720 | * Returns true if the memory described by @mem is PCI memory, | 719 | * Returns true if the memory described by @mem is PCI memory, |
| 721 | * false otherwise. | 720 | * false otherwise. |
| 722 | */ | 721 | */ |
| 723 | extern bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, | 722 | bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); |
| 724 | struct ttm_mem_reg *mem); | ||
| 725 | 723 | ||
| 726 | /** | 724 | /** |
| 727 | * ttm_bo_mem_space | 725 | * ttm_bo_mem_space |
| @@ -742,21 +740,20 @@ extern bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, | |||
| 742 | * fragmentation or concurrent allocators. | 740 | * fragmentation or concurrent allocators. |
| 743 | * -ERESTARTSYS: An interruptible sleep was interrupted by a signal. | 741 | * -ERESTARTSYS: An interruptible sleep was interrupted by a signal. |
| 744 | */ | 742 | */ |
| 745 | extern int ttm_bo_mem_space(struct ttm_buffer_object *bo, | 743 | int ttm_bo_mem_space(struct ttm_buffer_object *bo, |
| 746 | struct ttm_placement *placement, | 744 | struct ttm_placement *placement, |
| 747 | struct ttm_mem_reg *mem, | 745 | struct ttm_mem_reg *mem, |
| 748 | bool interruptible, | 746 | bool interruptible, |
| 749 | bool no_wait_gpu); | 747 | bool no_wait_gpu); |
| 750 | 748 | ||
| 751 | extern void ttm_bo_mem_put(struct ttm_buffer_object *bo, | 749 | void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem); |
| 750 | void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, | ||
| 752 | struct ttm_mem_reg *mem); | 751 | struct ttm_mem_reg *mem); |
| 753 | extern void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo, | ||
| 754 | struct ttm_mem_reg *mem); | ||
| 755 | 752 | ||
| 756 | extern void ttm_bo_global_release(struct drm_global_reference *ref); | 753 | void ttm_bo_global_release(struct drm_global_reference *ref); |
| 757 | extern int ttm_bo_global_init(struct drm_global_reference *ref); | 754 | int ttm_bo_global_init(struct drm_global_reference *ref); |
| 758 | 755 | ||
| 759 | extern int ttm_bo_device_release(struct ttm_bo_device *bdev); | 756 | int ttm_bo_device_release(struct ttm_bo_device *bdev); |
| 760 | 757 | ||
| 761 | /** | 758 | /** |
| 762 | * ttm_bo_device_init | 759 | * ttm_bo_device_init |
| @@ -773,18 +770,17 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev); | |||
| 773 | * Returns: | 770 | * Returns: |
| 774 | * !0: Failure. | 771 | * !0: Failure. |
| 775 | */ | 772 | */ |
| 776 | extern int ttm_bo_device_init(struct ttm_bo_device *bdev, | 773 | int ttm_bo_device_init(struct ttm_bo_device *bdev, struct ttm_bo_global *glob, |
| 777 | struct ttm_bo_global *glob, | 774 | struct ttm_bo_driver *driver, |
| 778 | struct ttm_bo_driver *driver, | 775 | struct address_space *mapping, |
| 779 | struct address_space *mapping, | 776 | uint64_t file_page_offset, bool need_dma32); |
| 780 | uint64_t file_page_offset, bool need_dma32); | ||
| 781 | 777 | ||
| 782 | /** | 778 | /** |
| 783 | * ttm_bo_unmap_virtual | 779 | * ttm_bo_unmap_virtual |
| 784 | * | 780 | * |
| 785 | * @bo: tear down the virtual mappings for this BO | 781 | * @bo: tear down the virtual mappings for this BO |
| 786 | */ | 782 | */ |
| 787 | extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); | 783 | void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); |
| 788 | 784 | ||
| 789 | /** | 785 | /** |
| 790 | * ttm_bo_unmap_virtual | 786 | * ttm_bo_unmap_virtual |
| @@ -793,16 +789,15 @@ extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); | |||
| 793 | * | 789 | * |
| 794 | * The caller must take ttm_mem_io_lock before calling this function. | 790 | * The caller must take ttm_mem_io_lock before calling this function. |
| 795 | */ | 791 | */ |
| 796 | extern void ttm_bo_unmap_virtual_locked(struct ttm_buffer_object *bo); | 792 | void ttm_bo_unmap_virtual_locked(struct ttm_buffer_object *bo); |
| 797 | 793 | ||
| 798 | extern int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo); | 794 | int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo); |
| 799 | extern void ttm_mem_io_free_vm(struct ttm_buffer_object *bo); | 795 | void ttm_mem_io_free_vm(struct ttm_buffer_object *bo); |
| 800 | extern int ttm_mem_io_lock(struct ttm_mem_type_manager *man, | 796 | int ttm_mem_io_lock(struct ttm_mem_type_manager *man, bool interruptible); |
| 801 | bool interruptible); | 797 | void ttm_mem_io_unlock(struct ttm_mem_type_manager *man); |
| 802 | extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man); | ||
| 803 | 798 | ||
| 804 | extern void ttm_bo_del_sub_from_lru(struct ttm_buffer_object *bo); | 799 | void ttm_bo_del_sub_from_lru(struct ttm_buffer_object *bo); |
| 805 | extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo); | 800 | void ttm_bo_add_to_lru(struct ttm_buffer_object *bo); |
| 806 | 801 | ||
| 807 | /** | 802 | /** |
| 808 | * __ttm_bo_reserve: | 803 | * __ttm_bo_reserve: |
| @@ -983,9 +978,9 @@ void ttm_mem_io_free(struct ttm_bo_device *bdev, | |||
| 983 | * !0: Failure. | 978 | * !0: Failure. |
| 984 | */ | 979 | */ |
| 985 | 980 | ||
| 986 | extern int ttm_bo_move_ttm(struct ttm_buffer_object *bo, | 981 | int ttm_bo_move_ttm(struct ttm_buffer_object *bo, |
| 987 | bool interruptible, bool no_wait_gpu, | 982 | bool interruptible, bool no_wait_gpu, |
| 988 | struct ttm_mem_reg *new_mem); | 983 | struct ttm_mem_reg *new_mem); |
| 989 | 984 | ||
| 990 | /** | 985 | /** |
| 991 | * ttm_bo_move_memcpy | 986 | * ttm_bo_move_memcpy |
| @@ -1005,9 +1000,9 @@ extern int ttm_bo_move_ttm(struct ttm_buffer_object *bo, | |||
| 1005 | * !0: Failure. | 1000 | * !0: Failure. |
| 1006 | */ | 1001 | */ |
| 1007 | 1002 | ||
| 1008 | extern int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, | 1003 | int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, |
| 1009 | bool interruptible, bool no_wait_gpu, | 1004 | bool interruptible, bool no_wait_gpu, |
| 1010 | struct ttm_mem_reg *new_mem); | 1005 | struct ttm_mem_reg *new_mem); |
| 1011 | 1006 | ||
| 1012 | /** | 1007 | /** |
| 1013 | * ttm_bo_free_old_node | 1008 | * ttm_bo_free_old_node |
| @@ -1016,7 +1011,7 @@ extern int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, | |||
| 1016 | * | 1011 | * |
| 1017 | * Utility function to free an old placement after a successful move. | 1012 | * Utility function to free an old placement after a successful move. |
| 1018 | */ | 1013 | */ |
| 1019 | extern void ttm_bo_free_old_node(struct ttm_buffer_object *bo); | 1014 | void ttm_bo_free_old_node(struct ttm_buffer_object *bo); |
| 1020 | 1015 | ||
| 1021 | /** | 1016 | /** |
| 1022 | * ttm_bo_move_accel_cleanup. | 1017 | * ttm_bo_move_accel_cleanup. |
| @@ -1033,10 +1028,9 @@ extern void ttm_bo_free_old_node(struct ttm_buffer_object *bo); | |||
| 1033 | * destroyed when the move is complete. This will help pipeline | 1028 | * destroyed when the move is complete. This will help pipeline |
| 1034 | * buffer moves. | 1029 | * buffer moves. |
| 1035 | */ | 1030 | */ |
| 1036 | 1031 | int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, | |
| 1037 | extern int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo, | 1032 | struct dma_fence *fence, bool evict, |
| 1038 | struct dma_fence *fence, bool evict, | 1033 | struct ttm_mem_reg *new_mem); |
| 1039 | struct ttm_mem_reg *new_mem); | ||
| 1040 | 1034 | ||
| 1041 | /** | 1035 | /** |
| 1042 | * ttm_bo_pipeline_move. | 1036 | * ttm_bo_pipeline_move. |
| @@ -1062,7 +1056,7 @@ int ttm_bo_pipeline_move(struct ttm_buffer_object *bo, | |||
| 1062 | * Utility function that returns the pgprot_t that should be used for | 1056 | * Utility function that returns the pgprot_t that should be used for |
| 1063 | * setting up a PTE with the caching model indicated by @c_state. | 1057 | * setting up a PTE with the caching model indicated by @c_state. |
| 1064 | */ | 1058 | */ |
| 1065 | extern pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); | 1059 | pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); |
| 1066 | 1060 | ||
| 1067 | extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; | 1061 | extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; |
| 1068 | 1062 | ||
| @@ -1083,10 +1077,10 @@ extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; | |||
| 1083 | * for TT memory. This function uses the linux agpgart interface to | 1077 | * for TT memory. This function uses the linux agpgart interface to |
| 1084 | * bind and unbind memory backing a ttm_tt. | 1078 | * bind and unbind memory backing a ttm_tt. |
| 1085 | */ | 1079 | */ |
| 1086 | extern struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, | 1080 | struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, |
| 1087 | struct agp_bridge_data *bridge, | 1081 | struct agp_bridge_data *bridge, |
| 1088 | unsigned long size, uint32_t page_flags, | 1082 | unsigned long size, uint32_t page_flags, |
| 1089 | struct page *dummy_read_page); | 1083 | struct page *dummy_read_page); |
| 1090 | int ttm_agp_tt_populate(struct ttm_tt *ttm); | 1084 | int ttm_agp_tt_populate(struct ttm_tt *ttm); |
| 1091 | void ttm_agp_tt_unpopulate(struct ttm_tt *ttm); | 1085 | void ttm_agp_tt_unpopulate(struct ttm_tt *ttm); |
| 1092 | #endif | 1086 | #endif |
