Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/vmwgfx: drop bo map/unmap dma functions.

The map one was used once, just inline it, and drop them both.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200804025632.3868079-3-airlied@gmail.com

+6 -42
-2
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h
··· 1019 1019 extern struct ttm_placement vmw_mob_ne_placement; 1020 1020 extern struct ttm_placement vmw_nonfixed_placement; 1021 1021 extern struct ttm_bo_driver vmw_bo_driver; 1022 - extern int vmw_bo_map_dma(struct ttm_buffer_object *bo); 1023 - extern void vmw_bo_unmap_dma(struct ttm_buffer_object *bo); 1024 1022 extern const struct vmw_sg_table * 1025 1023 vmw_bo_sg_table(struct ttm_buffer_object *bo); 1026 1024 extern int vmw_bo_create_and_populate(struct vmw_private *dev_priv,
+6 -40
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
··· 519 519 vmw_tt->mapped = false; 520 520 } 521 521 522 - 523 - /** 524 - * vmw_bo_map_dma - Make sure buffer object pages are visible to the device 525 - * 526 - * @bo: Pointer to a struct ttm_buffer_object 527 - * 528 - * Wrapper around vmw_ttm_map_dma, that takes a TTM buffer object pointer 529 - * instead of a pointer to a struct vmw_ttm_backend as argument. 530 - * Note that the buffer object must be either pinned or reserved before 531 - * calling this function. 532 - */ 533 - int vmw_bo_map_dma(struct ttm_buffer_object *bo) 534 - { 535 - struct vmw_ttm_tt *vmw_tt = 536 - container_of(bo->ttm, struct vmw_ttm_tt, dma_ttm.ttm); 537 - 538 - return vmw_ttm_map_dma(vmw_tt); 539 - } 540 - 541 - 542 - /** 543 - * vmw_bo_unmap_dma - Make sure buffer object pages are visible to the device 544 - * 545 - * @bo: Pointer to a struct ttm_buffer_object 546 - * 547 - * Wrapper around vmw_ttm_unmap_dma, that takes a TTM buffer object pointer 548 - * instead of a pointer to a struct vmw_ttm_backend as argument. 549 - */ 550 - void vmw_bo_unmap_dma(struct ttm_buffer_object *bo) 551 - { 552 - struct vmw_ttm_tt *vmw_tt = 553 - container_of(bo->ttm, struct vmw_ttm_tt, dma_ttm.ttm); 554 - 555 - vmw_ttm_unmap_dma(vmw_tt); 556 - } 557 - 558 - 559 522 /** 560 523 * vmw_bo_sg_table - Return a struct vmw_sg_table object for a 561 524 * TTM buffer object ··· 804 841 805 842 ret = ttm_bo_reserve(bo, false, true, NULL); 806 843 BUG_ON(ret != 0); 807 - ret = vmw_bo_driver.ttm_tt_populate(bo->ttm, &ctx); 808 - if (likely(ret == 0)) 809 - ret = vmw_bo_map_dma(bo); 844 + ret = vmw_ttm_populate(bo->ttm, &ctx); 845 + if (likely(ret == 0)) { 846 + struct vmw_ttm_tt *vmw_tt = 847 + container_of(bo->ttm, struct vmw_ttm_tt, dma_ttm.ttm); 848 + ret = vmw_ttm_map_dma(vmw_tt); 849 + } 810 850 811 851 ttm_bo_unreserve(bo); 812 852