Changeset 89278 in vbox for trunk/src/VBox/Additions/linux
- Timestamp:
- May 25, 2021 4:23:05 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 144624
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r88274 r89278 174 174 #include <drm/ttm/ttm_bo_driver.h> 175 175 #include <drm/ttm/ttm_placement.h> 176 #include <drm/ttm/ttm_memory.h> 176 #if RTLNX_VER_MAX(5,13,0) 177 # include <drm/ttm/ttm_memory.h> 178 #endif 177 179 #if RTLNX_VER_MAX(5,12,0) 178 180 # include <drm/ttm/ttm_module.h> … … 264 266 struct ttm_bo_global_ref bo_global_ref; 265 267 #endif 268 #if RTLNX_VER_MIN(5,13,0) 269 struct ttm_device bdev; 270 #else 266 271 struct ttm_bo_device bdev; 272 #endif 267 273 bool mm_initialised; 268 274 } ttm; -
trunk/src/VBox/Additions/linux/drm/vbox_ttm.c
r88509 r89278 49 49 50 50 51 #if RTLNX_VER_MIN(5,13,0) 52 static inline struct vbox_private *vbox_bdev(struct ttm_device *bd) 53 #else 51 54 static inline struct vbox_private *vbox_bdev(struct ttm_bo_device *bd) 55 #endif 52 56 { 53 57 return container_of(bd, struct vbox_private, ttm.bdev); … … 206 210 } 207 211 #else 212 # if RTLNX_VER_MAX(5,13,0) 208 213 static int vbox_ttm_io_mem_reserve(struct ttm_bo_device *bdev, 209 214 struct ttm_resource *mem) 215 # else /* > 5.13.0 */ 216 static int vbox_ttm_io_mem_reserve(struct ttm_device *bdev, 217 struct ttm_resource *mem) 218 # endif /* > 5.13.0 */ 210 219 { 211 220 struct vbox_private *vbox = vbox_bdev(bdev); … … 242 251 243 252 244 #if RTLNX_VER_MIN(5,10,0) 253 #if RTLNX_VER_MIN(5,13,0) 254 static void vbox_ttm_io_mem_free(struct ttm_device *bdev, 255 struct ttm_resource *mem) 256 { 257 } 258 #elif RTLNX_VER_MIN(5,10,0) 245 259 static void vbox_ttm_io_mem_free(struct ttm_bo_device *bdev, 246 260 struct ttm_resource *mem) … … 254 268 #endif 255 269 256 #if RTLNX_VER_MIN(5,10,0) 270 #if RTLNX_VER_MIN(5,13,0) 271 static void vbox_ttm_tt_destroy(struct ttm_device *bdev, struct ttm_tt *tt) 272 { 273 ttm_tt_fini(tt); 274 kfree(tt); 275 } 276 #elif RTLNX_VER_MIN(5,10,0) 257 277 static void vbox_ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *tt) 258 278 { … … 334 354 #endif 335 355 356 #if RTLNX_VER_MIN(5,13,0) 357 static struct ttm_device_funcs vbox_bo_driver = { 358 #else /* < 5.13.0 */ 336 359 static struct ttm_bo_driver vbox_bo_driver = { 360 #endif /* < 5.13.0 */ 337 361 .ttm_tt_create = vbox_ttm_tt_create, 338 362 #if RTLNX_VER_MIN(5,10,0) … … 371 395 int ret; 372 396 struct drm_device *dev = vbox->dev; 397 #if RTLNX_VER_MIN(5,13,0) 398 struct ttm_device *bdev = &vbox->ttm.bdev; 399 #else 373 400 struct ttm_bo_device *bdev = &vbox->ttm.bdev; 401 #endif 374 402 375 403 #if RTLNX_VER_MAX(5,0,0) && !RTLNX_RHEL_MAJ_PREREQ(7,7) && !RTLNX_RHEL_MAJ_PREREQ(8,1) … … 378 406 return ret; 379 407 #endif 408 #if RTLNX_VER_MIN(5,13,0) 409 ret = ttm_device_init(&vbox->ttm.bdev, 410 #else 380 411 ret = ttm_bo_device_init(&vbox->ttm.bdev, 412 #endif 381 413 #if RTLNX_VER_MAX(5,0,0) && !RTLNX_RHEL_MAJ_PREREQ(7,7) && !RTLNX_RHEL_MAJ_PREREQ(8,1) 382 414 vbox->ttm.bo_global_ref.ref.object, … … 430 462 431 463 err_device_release: 464 #if RTLNX_VER_MIN(5,13,0) 465 ttm_device_fini(&vbox->ttm.bdev); 466 #else 432 467 ttm_bo_device_release(&vbox->ttm.bdev); 468 #endif 433 469 #if RTLNX_VER_MAX(5,0,0) && !RTLNX_RHEL_MAJ_PREREQ(7,7) && !RTLNX_RHEL_MAJ_PREREQ(8,1) 434 470 err_ttm_global_release: … … 447 483 arch_phys_wc_del(vbox->fb_mtrr); 448 484 #endif 485 #if RTLNX_VER_MIN(5,13,0) 486 ttm_device_fini(&vbox->ttm.bdev); 487 #else 449 488 ttm_bo_device_release(&vbox->ttm.bdev); 489 #endif 450 490 #if RTLNX_VER_MAX(5,0,0) && !RTLNX_RHEL_MAJ_PREREQ(7,7) && !RTLNX_RHEL_MAJ_PREREQ(8,1) 451 491 vbox_ttm_global_release(vbox); … … 529 569 struct vbox_private *vbox = dev->dev_private; 530 570 struct vbox_bo *vboxbo; 571 #if RTLNX_VER_MAX(5,13,0) 531 572 size_t acc_size; 573 #endif 532 574 int ret; 533 575 … … 552 594 vbox_ttm_placement(vboxbo, VBOX_MEM_TYPE_VRAM | VBOX_MEM_TYPE_SYSTEM); 553 595 596 #if RTLNX_VER_MAX(5,13,0) 554 597 acc_size = ttm_bo_dma_acc_size(&vbox->ttm.bdev, size, 555 598 sizeof(struct vbox_bo)); 599 #endif 556 600 557 601 ret = ttm_bo_init(&vbox->ttm.bdev, &vboxbo->bo, size, … … 559 603 #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) 560 604 align >> PAGE_SHIFT, false, NULL, acc_size, 561 #el se605 #elif RTLNX_VER_MAX(5,13,0) /* < 5.13.0 */ 562 606 align >> PAGE_SHIFT, false, acc_size, 563 #endif 607 #else /* > 5.13.0 */ 608 align >> PAGE_SHIFT, false, 609 #endif /* > 5.13.0 */ 564 610 #if RTLNX_VER_MIN(3,18,0) || RTLNX_RHEL_MAJ_PREREQ(7,2) 565 611 NULL, NULL, vbox_bo_ttm_destroy);
Note:
See TracChangeset
for help on using the changeset viewer.