Changeset 90577 in vbox for trunk/src/VBox/Additions
- Timestamp:
- Aug 9, 2021 9:57:00 AM (3 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.c
r90519 r90577 366 366 #if RTLNX_VER_MAX(3,12,0) && !RTLNX_RHEL_MAJ_PREREQ(7,3) 367 367 .dumb_destroy = vbox_dumb_destroy, 368 #elif RTLNX_VER_MAX(5,12,0) 368 #elif RTLNX_VER_MAX(5,12,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 369 369 .dumb_destroy = drm_gem_dumb_destroy, 370 370 #endif … … 376 376 .gem_prime_mmap = vbox_gem_prime_mmap, 377 377 378 #if RTLNX_VER_MAX(5,11,0) 378 #if RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 379 379 .dev_priv_size = 0, 380 380 # if RTLNX_VER_MIN(4,7,0) -
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r90519 r90577 177 177 # include <drm/ttm/ttm_memory.h> 178 178 #endif 179 #if RTLNX_VER_MAX(5,12,0) 179 #if RTLNX_VER_MAX(5,12,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 180 180 # include <drm/ttm/ttm_module.h> 181 181 #endif -
trunk/src/VBox/Additions/linux/drm/vbox_fb.c
r90519 r90577 304 304 #if RTLNX_VER_MIN(5,14,0) 305 305 ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.resource->num_pages, &bo->kmap); 306 #elif RTLNX_VER_MIN(5,12,0) 306 #elif RTLNX_VER_MIN(5,12,0) || RTLNX_RHEL_MAJ_PREREQ(8,5) 307 307 ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.mem.num_pages, &bo->kmap); 308 308 #else -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r90519 r90577 863 863 #if RTLNX_VER_MIN(5,14,0) 864 864 ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.resource->num_pages, &uobj_map); 865 #elif RTLNX_VER_MIN(5,12,0) 865 #elif RTLNX_VER_MIN(5,12,0) || RTLNX_RHEL_MAJ_PREREQ(8,5) 866 866 ret = ttm_bo_kmap(&bo->bo, 0, bo->bo.mem.num_pages, &uobj_map); 867 867 #else -
trunk/src/VBox/Additions/linux/drm/vbox_ttm.c
r90519 r90577 34 34 */ 35 35 #include "vbox_drv.h" 36 #if RTLNX_VER_MIN(5,11,0) 36 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_MAJ_PREREQ(8,5) 37 37 # include <drm/drm_gem.h> 38 38 # include <drm/drm_gem_ttm_helper.h> … … 141 141 } 142 142 143 #if RTLNX_VER_MAX(5,10,0) 143 #if RTLNX_VER_MAX(5,10,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 144 144 static int 145 145 vbox_bo_init_mem_type(struct ttm_bo_device *bdev, u32 type, … … 187 187 #endif 188 188 189 #if RTLNX_VER_MAX(5,10,0) 189 #if RTLNX_VER_MAX(5,10,0) && !RTLNX_RHEL_RANGE(8,5, 8,99) 190 190 static int vbox_ttm_io_mem_reserve(struct ttm_bo_device *bdev, 191 191 struct ttm_mem_reg *mem) … … 227 227 mem->bus.addr = NULL; 228 228 mem->bus.offset = 0; 229 # if RTLNX_VER_MAX(5,12,0) 229 # if RTLNX_VER_MAX(5,12,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 230 230 mem->size = mem->num_pages << PAGE_SHIFT; 231 231 # endif … … 237 237 return 0; 238 238 case TTM_PL_VRAM: 239 # if RTLNX_VER_MIN(5,11,0) 239 # if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 240 240 mem->bus.caching = ttm_write_combined; 241 241 # endif 242 # if RTLNX_VER_MIN(5,10,0) 242 # if RTLNX_VER_MIN(5,10,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 243 243 mem->bus.offset = (mem->start << PAGE_SHIFT) + pci_resource_start(VBOX_DRM_TO_PCI_DEV(vbox->dev), 0); 244 244 # else … … 262 262 { 263 263 } 264 #elif RTLNX_VER_MIN(5,10,0) 264 #elif RTLNX_VER_MIN(5,10,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 265 265 static void vbox_ttm_io_mem_free(struct ttm_bo_device *bdev, 266 266 struct ttm_resource *mem) … … 280 280 kfree(tt); 281 281 } 282 #elif RTLNX_VER_MIN(5,10,0) 282 #elif RTLNX_VER_MIN(5,10,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 283 283 static void vbox_ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *tt) 284 284 { … … 314 314 return NULL; 315 315 316 #if RTLNX_VER_MAX(5,10,0) 316 #if RTLNX_VER_MAX(5,10,0) && !RTLNX_RHEL_RANGE(8,5, 8,99) 317 317 tt->func = &vbox_tt_backend_func; 318 318 #endif 319 319 #if RTLNX_VER_MAX(4,17,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5) 320 320 if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { 321 #elif RTLNX_VER_MAX(5,11,0) 321 #elif RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_RANGE(8,5, 8,99) 322 322 if (ttm_tt_init(tt, bo, page_flags)) { 323 323 #else … … 351 351 #endif 352 352 353 #if RTLNX_VER_MIN(5,11,0) 353 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 354 354 static int vbox_bo_move(struct ttm_buffer_object *bo, bool evict, 355 355 struct ttm_operation_ctx *ctx, struct ttm_resource *new_mem, … … 366 366 #endif /* < 5.13.0 */ 367 367 .ttm_tt_create = vbox_ttm_tt_create, 368 #if RTLNX_VER_MIN(5,10,0) 368 #if RTLNX_VER_MIN(5,10,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 369 369 .ttm_tt_destroy = vbox_ttm_tt_destroy, 370 370 #endif … … 373 373 .ttm_tt_unpopulate = vbox_ttm_tt_unpopulate, 374 374 #endif 375 #if RTLNX_VER_MAX(5,10,0) 375 #if RTLNX_VER_MAX(5,10,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 376 376 .init_mem_type = vbox_bo_init_mem_type, 377 377 #endif … … 394 394 .swap_lru_tail = &ttm_bo_default_swap_lru_tail, 395 395 #endif 396 #if RTLNX_VER_MIN(5,11,0) 396 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 397 397 .move = &vbox_bo_move, 398 398 #endif … … 423 423 #endif 424 424 &vbox_bo_driver, 425 #if RTLNX_VER_MIN(5,11,0) 425 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 426 426 dev->dev, 427 427 #endif … … 434 434 DRM_FILE_PAGE_OFFSET, 435 435 #endif 436 #if RTLNX_VER_MIN(5,11,0) 436 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 437 437 false, 438 438 #endif … … 447 447 } 448 448 449 #if RTLNX_VER_MIN(5,10,0) 449 #if RTLNX_VER_MIN(5,10,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 450 450 ret = ttm_range_man_init(bdev, TTM_PL_VRAM, false, 451 451 vbox->available_vram_size >> PAGE_SHIFT); … … 515 515 516 516 if (mem_type & VBOX_MEM_TYPE_VRAM) { 517 #if RTLNX_VER_MIN(5,11,0) 517 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 518 518 bo->placements[c].mem_type = TTM_PL_VRAM; 519 519 PLACEMENT_FLAGS(bo->placements[c++]) = 0; … … 528 528 } 529 529 if (mem_type & VBOX_MEM_TYPE_SYSTEM) { 530 #if RTLNX_VER_MIN(5,11,0) 530 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 531 531 bo->placements[c].mem_type = TTM_PL_SYSTEM; 532 532 PLACEMENT_FLAGS(bo->placements[c++]) = 0; … … 541 541 } 542 542 if (!c) { 543 #if RTLNX_VER_MIN(5,11,0) 543 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 544 544 bo->placements[c].mem_type = TTM_PL_SYSTEM; 545 545 PLACEMENT_FLAGS(bo->placements[c++]) = 0; … … 565 565 } 566 566 567 #if RTLNX_VER_MIN(5,11,0) 567 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 568 568 static const struct drm_gem_object_funcs vbox_drm_gem_object_funcs = { 569 569 .free = vbox_gem_free_object, … … 593 593 goto err_free_vboxbo; 594 594 595 #if RTLNX_VER_MIN(5,11,0) 595 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 596 596 if (!vboxbo->gem.funcs) { 597 597 vboxbo->gem.funcs = &vbox_drm_gem_object_funcs; … … 669 669 #endif 670 670 int ret; 671 #if RTLNX_VER_MAX(5,11,0) 671 #if RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 672 672 int i; 673 673 #endif … … 683 683 vbox_ttm_placement(bo, mem_type); 684 684 685 #if RTLNX_VER_MAX(5,11,0) 685 #if RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 686 686 for (i = 0; i < bo->placement.num_placement; i++) 687 687 PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT; … … 698 698 bo->pin_count = 1; 699 699 700 #if RTLNX_VER_MIN(5,11,0) 700 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 701 701 ttm_bo_pin(&bo->bo); 702 702 #endif … … 711 711 { 712 712 #if RTLNX_VER_MIN(4,16,0) || RTLNX_RHEL_MAJ_PREREQ(7,6) || RTLNX_SUSE_MAJ_PREREQ(15,1) || RTLNX_SUSE_MAJ_PREREQ(12,5) 713 # if RTLNX_VER_MAX(5,11,0) 713 # if RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 714 714 struct ttm_operation_ctx ctx = { false, false }; 715 715 # endif 716 716 #endif 717 717 int ret = 0; 718 #if RTLNX_VER_MAX(5,11,0) 718 #if RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 719 719 int i; 720 720 #endif … … 728 728 return 0; 729 729 730 #if RTLNX_VER_MAX(5,11,0) 730 #if RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 731 731 for (i = 0; i < bo->placement.num_placement; i++) 732 732 PLACEMENT_FLAGS(bo->placements[i]) &= ~TTM_PL_FLAG_NO_EVICT; … … 735 735 #if RTLNX_VER_MAX(4,16,0) && !RTLNX_RHEL_MAJ_PREREQ(7,6) && !RTLNX_SUSE_MAJ_PREREQ(15,1) && !RTLNX_SUSE_MAJ_PREREQ(12,5) 736 736 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); 737 #elif RTLNX_VER_MAX(5,11,0) 737 #elif RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 738 738 ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx); 739 739 #endif … … 741 741 return ret; 742 742 743 #if RTLNX_VER_MIN(5,11,0) 743 #if RTLNX_VER_MIN(5,11,0) || RTLNX_RHEL_RANGE(8,5, 8,99) 744 744 ttm_bo_unpin(&bo->bo); 745 745 #endif … … 748 748 } 749 749 750 #if RTLNX_VER_MAX(5,11,0) 750 #if RTLNX_VER_MAX(5,11,0) && !RTLNX_RHEL_MAJ_PREREQ(8,5) 751 751 /* 752 752 * Move a vbox-owned buffer object to system memory if no one else has it
Note:
See TracChangeset
for help on using the changeset viewer.