Changeset 77850 in vbox for trunk/src/VBox/Additions/linux
- Timestamp:
- Mar 22, 2019 2:49:18 PM (6 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.c
r76976 r77850 42 42 #include "vbox_drv.h" 43 43 44 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) 45 #include <drm/drm_probe_helper.h> 46 #endif 47 44 48 #include "version-generated.h" 45 49 #include "revision-generated.h" … … 303 307 static struct drm_driver driver = { 304 308 .driver_features = 305 DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | 309 DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | 310 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) 311 DRIVER_IRQ_SHARED | 312 #endif 306 313 DRIVER_PRIME, 307 314 .dev_priv_size = 0, -
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r76976 r77850 117 117 #endif 118 118 119 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) && !defined(RHEL_75) 120 static inline void drm_gem_object_put(struct drm_gem_object *obj) 121 { 122 drm_gem_object_unreference(obj); 123 } 124 #endif 125 119 126 #define DRIVER_AUTHOR VBOX_VENDOR 120 127 … … 175 182 176 183 struct { 184 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) 177 185 struct drm_global_reference mem_global_ref; 178 186 struct ttm_bo_global_ref bo_global_ref; 187 #endif 179 188 struct ttm_bo_device bdev; 180 189 bool mm_initialised; -
trunk/src/VBox/Additions/linux/drm/vbox_irq.c
r76937 r77850 34 34 #include "vbox_drv.h" 35 35 36 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) 36 37 #include <drm/drm_crtc_helper.h> 38 #else 39 #include <drm/drm_probe_helper.h> 40 #endif 37 41 #include <VBoxVideo.h> 38 42 -
trunk/src/VBox/Additions/linux/drm/vbox_main.c
r76976 r77850 606 606 #endif 607 607 608 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) 608 609 static void vbox_bo_unref(struct vbox_bo **bo) 609 610 { … … 618 619 *bo = NULL; 619 620 } 621 #endif 620 622 621 623 void vbox_gem_free_object(struct drm_gem_object *obj) … … 623 625 struct vbox_bo *vbox_bo = gem_to_vbox_bo(obj); 624 626 627 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) 625 628 vbox_bo_unref(&vbox_bo); 629 #else 630 ttm_bo_put(&vbox_bo->bo); 631 #endif 626 632 } 627 633 … … 658 664 *offset = vbox_bo_mmap_offset(bo); 659 665 660 drm_gem_object_ unreference(obj);666 drm_gem_object_put(obj); 661 667 ret = 0; 662 668 -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r76978 r77850 42 42 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_72) 43 43 #include <drm/drm_plane_helper.h> 44 #endif 45 #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) 46 #include <drm/drm_probe_helper.h> 44 47 #endif 45 48 -
trunk/src/VBox/Additions/linux/drm/vbox_ttm.c
r76553 r77850 47 47 } 48 48 49 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) 49 50 static int vbox_ttm_mem_global_init(struct drm_global_reference *ref) 50 51 { … … 65 66 int ret; 66 67 68 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) 67 69 global_ref = &vbox->ttm.mem_global_ref; 68 70 global_ref->global_type = DRM_GLOBAL_TTM_MEM; … … 77 79 78 80 vbox->ttm.bo_global_ref.mem_glob = vbox->ttm.mem_global_ref.object; 81 #endif 79 82 global_ref = &vbox->ttm.bo_global_ref.ref; 80 83 global_ref->global_type = DRM_GLOBAL_TTM_BO; … … 86 89 if (ret) { 87 90 DRM_ERROR("Failed setting up TTM BO subsystem.\n"); 91 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) 88 92 drm_global_item_unref(&vbox->ttm.mem_global_ref); 93 #endif 89 94 return ret; 90 95 } … … 101 106 drm_global_item_unref(&vbox->ttm.mem_global_ref); 102 107 } 108 #endif 103 109 104 110 static void vbox_bo_ttm_destroy(struct ttm_buffer_object *tbo) … … 288 294 struct ttm_bo_device *bdev = &vbox->ttm.bdev; 289 295 296 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) 290 297 ret = vbox_ttm_global_init(vbox); 291 298 if (ret) 292 299 return ret; 300 #endif 293 301 294 302 ret = ttm_bo_device_init(&vbox->ttm.bdev, 303 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) 295 304 vbox->ttm.bo_global_ref.ref.object, 305 #endif 296 306 &vbox_bo_driver, 297 307 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) || defined(RHEL_71) … … 301 311 if (ret) { 302 312 DRM_ERROR("Error initialising bo driver; %d\n", ret); 313 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) 303 314 goto err_ttm_global_release; 315 #else 316 return ret; 317 #endif 304 318 } 305 319 … … 323 337 err_device_release: 324 338 ttm_bo_device_release(&vbox->ttm.bdev); 339 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) 325 340 err_ttm_global_release: 326 341 vbox_ttm_global_release(vbox); 342 #endif 327 343 return ret; 328 344 } … … 338 354 #endif 339 355 ttm_bo_device_release(&vbox->ttm.bdev); 356 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) 340 357 vbox_ttm_global_release(vbox); 358 #endif 341 359 } 342 360
Note:
See TracChangeset
for help on using the changeset viewer.