Changeset 56467 in vbox for trunk/src/VBox/Additions/linux
- Timestamp:
- Jun 17, 2015 7:02:41 AM (9 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r56354 r56467 63 63 #include <drm/ttm/ttm_memory.h> 64 64 #include <drm/ttm/ttm_module.h> 65 66 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) 67 # include <drm/drm_gem.h> 68 #endif 65 69 66 70 /* #include "vboxvideo.h" */ … … 206 210 struct ttm_bo_kmap_obj kmap; 207 211 struct drm_gem_object gem; 212 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) 208 213 u32 placements[3]; 214 #else 215 struct ttm_place placements[3]; 216 #endif 209 217 int pin_count; 210 218 }; -
trunk/src/VBox/Additions/linux/drm/vbox_fb.c
r55808 r56467 446 446 447 447 vbox->fbdev = afbdev; 448 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) 448 449 afbdev->helper.funcs = &vbox_fb_helper_funcs; 450 #else 451 drm_fb_helper_prepare(dev, &afbdev->helper, &vbox_fb_helper_funcs); 452 #endif 449 453 ret = drm_fb_helper_init(dev, &afbdev->helper, vbox->cCrtcs, vbox->cCrtcs); 450 454 if (ret) -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r55808 r56467 54 54 #include <linux/export.h> 55 55 #include <drm/drm_crtc_helper.h> 56 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) 57 # include <drm/drm_plane_helper.h> 58 #endif 56 59 57 60 static int vbox_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv, … … 443 446 pVBoxConnector = to_vbox_connector(pConnector); 444 447 device_remove_file(pConnector->dev->dev, &pVBoxConnector->deviceAttribute); 448 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) 445 449 drm_sysfs_connector_remove(pConnector); 450 #else 451 drm_connector_unregister(pConnector); 452 #endif 446 453 drm_connector_cleanup(pConnector); 447 454 kfree(pConnector); … … 537 544 pConnector->doublescan_allowed = 0; 538 545 546 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) 539 547 drm_sysfs_connector_add(pConnector); 548 #else 549 drm_connector_register(pConnector); 550 #endif 540 551 541 552 /* The connector supports hot-plug detection: we promise to call -
trunk/src/VBox/Additions/linux/drm/vbox_ttm.c
r53793 r56467 48 48 #include "vbox_drv.h" 49 49 #include <ttm/ttm_page_alloc.h> 50 51 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) 52 # define PLACEMENT_FLAGS(placement) (placement) 53 #else 54 # define PLACEMENT_FLAGS(placement) (placement).flags 55 #endif 50 56 51 57 static inline struct vbox_private * … … 345 351 { 346 352 u32 c = 0; 353 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) 347 354 bo->placement.fpfn = 0; 348 355 bo->placement.lpfn = 0; 356 #else 357 unsigned i; 358 #endif 359 349 360 bo->placement.placement = bo->placements; 350 361 bo->placement.busy_placement = bo->placements; 351 362 if (domain & TTM_PL_FLAG_VRAM) 352 bo->placements[c++]= TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM;363 PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM; 353 364 if (domain & TTM_PL_FLAG_SYSTEM) 354 bo->placements[c++]= TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;365 PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM; 355 366 if (!c) 356 bo->placements[c++]= TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;367 PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM; 357 368 bo->placement.num_placement = c; 358 369 bo->placement.num_busy_placement = c; 370 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) 371 for (i = 0; i < c; ++i) 372 { 373 bo->placements[i].fpfn = 0; 374 bo->placements[i].lpfn = 0; 375 } 376 #endif 359 377 } 360 378 … … 410 428 ttm_bo_type_device, &vboxbo->placement, 411 429 align >> PAGE_SHIFT, false, NULL, acc_size, 430 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) 431 NULL, 432 #endif 412 433 NULL, vbox_bo_ttm_destroy); 413 434 if (ret) … … 437 458 vbox_ttm_placement(bo, pl_flag); 438 459 for (i = 0; i < bo->placement.num_placement; i++) 439 bo->placements[i]|= TTM_PL_FLAG_NO_EVICT;460 PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT; 440 461 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); 441 462 if (ret) … … 461 482 462 483 for (i = 0; i < bo->placement.num_placement ; i++) 463 bo->placements[i]&= ~TTM_PL_FLAG_NO_EVICT;484 PLACEMENT_FLAGS(bo->placements[i]) &= ~TTM_PL_FLAG_NO_EVICT; 464 485 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); 465 486 if (ret) … … 489 510 vbox_ttm_placement(bo, TTM_PL_FLAG_SYSTEM); 490 511 for (i = 0; i < bo->placement.num_placement ; i++) 491 bo->placements[i]|= TTM_PL_FLAG_NO_EVICT;512 PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT; 492 513 493 514 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); … … 506 527 507 528 if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) 508 return drm_mmap(filp, vma);529 return -EINVAL; 509 530 510 531 file_priv = filp->private_data;
Note:
See TracChangeset
for help on using the changeset viewer.