aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2017-04-12 09:08:17 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-12-06 12:47:55 -0500
commit1144b63a162cef5a57b85108b608f2486b0410c9 (patch)
tree153c04887ff664e2229725554f776a2b1e921311 /include/drm
parentba87349ed31ee623f3380b5feedaf16a8dfa25bf (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.h114
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 */
630extern int ttm_tt_init(struct ttm_tt *ttm, struct ttm_bo_device *bdev, 630int 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);
633extern int ttm_dma_tt_init(struct ttm_dma_tt *ttm_dma, struct ttm_bo_device *bdev, 633int 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 */
644extern void ttm_tt_fini(struct ttm_tt *ttm); 644void ttm_tt_fini(struct ttm_tt *ttm);
645extern void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma); 645void 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 */
655extern int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem); 655int 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 */
664extern void ttm_tt_destroy(struct ttm_tt *ttm); 664void 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 */
673extern void ttm_tt_unbind(struct ttm_tt *ttm); 673void 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 */
682extern int ttm_tt_swapin(struct ttm_tt *ttm); 682int 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 */
697extern int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement); 697int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement);
698extern int ttm_tt_swapout(struct ttm_tt *ttm, 698int 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 */
708extern void ttm_tt_unpopulate(struct ttm_tt *ttm); 707void 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 */
723extern bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, 722bool 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 */
745extern int ttm_bo_mem_space(struct ttm_buffer_object *bo, 743int 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
751extern void ttm_bo_mem_put(struct ttm_buffer_object *bo, 749void ttm_bo_mem_put(struct ttm_buffer_object *bo, struct ttm_mem_reg *mem);
750void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo,
752 struct ttm_mem_reg *mem); 751 struct ttm_mem_reg *mem);
753extern void ttm_bo_mem_put_locked(struct ttm_buffer_object *bo,
754 struct ttm_mem_reg *mem);
755 752
756extern void ttm_bo_global_release(struct drm_global_reference *ref); 753void ttm_bo_global_release(struct drm_global_reference *ref);
757extern int ttm_bo_global_init(struct drm_global_reference *ref); 754int ttm_bo_global_init(struct drm_global_reference *ref);
758 755
759extern int ttm_bo_device_release(struct ttm_bo_device *bdev); 756int 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 */
776extern int ttm_bo_device_init(struct ttm_bo_device *bdev, 773int 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 */
787extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); 783void 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 */
796extern void ttm_bo_unmap_virtual_locked(struct ttm_buffer_object *bo); 792void ttm_bo_unmap_virtual_locked(struct ttm_buffer_object *bo);
797 793
798extern int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo); 794int ttm_mem_io_reserve_vm(struct ttm_buffer_object *bo);
799extern void ttm_mem_io_free_vm(struct ttm_buffer_object *bo); 795void ttm_mem_io_free_vm(struct ttm_buffer_object *bo);
800extern int ttm_mem_io_lock(struct ttm_mem_type_manager *man, 796int ttm_mem_io_lock(struct ttm_mem_type_manager *man, bool interruptible);
801 bool interruptible); 797void ttm_mem_io_unlock(struct ttm_mem_type_manager *man);
802extern void ttm_mem_io_unlock(struct ttm_mem_type_manager *man);
803 798
804extern void ttm_bo_del_sub_from_lru(struct ttm_buffer_object *bo); 799void ttm_bo_del_sub_from_lru(struct ttm_buffer_object *bo);
805extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo); 800void 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
986extern int ttm_bo_move_ttm(struct ttm_buffer_object *bo, 981int 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
1008extern int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, 1003int 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 */
1019extern void ttm_bo_free_old_node(struct ttm_buffer_object *bo); 1014void 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 1031int ttm_bo_move_accel_cleanup(struct ttm_buffer_object *bo,
1037extern 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 */
1065extern pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp); 1059pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp);
1066 1060
1067extern const struct ttm_mem_type_manager_func ttm_bo_manager_func; 1061extern 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 */
1086extern struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, 1080struct 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);
1090int ttm_agp_tt_populate(struct ttm_tt *ttm); 1084int ttm_agp_tt_populate(struct ttm_tt *ttm);
1091void ttm_agp_tt_unpopulate(struct ttm_tt *ttm); 1085void ttm_agp_tt_unpopulate(struct ttm_tt *ttm);
1092#endif 1086#endif