Ticket #18093: vbox_video_build_rhel76_fix.patch
| File vbox_video_build_rhel76_fix.patch, 4.6 KB (added by , 6 years ago) |
|---|
-
vbox_drv.h
46 46 #include <linux/string.h> 47 47 48 48 #if defined(RHEL_MAJOR) && defined(RHEL_MINOR) 49 # if RHEL_MAJOR == 7 && RHEL_MINOR >= 6 50 # define RHEL_76 51 # endif 49 52 # if RHEL_MAJOR == 7 && RHEL_MINOR >= 5 50 53 # define RHEL_75 51 54 # endif -
vbox_mode.c
356 356 /* pick the encoder ids */ 357 357 if (enc_id) 358 358 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0) || \ 359 (defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15) 359 (defined(CONFIG_SUSE_VERSION) && CONFIG_SUSE_VERSION == 15) || \ 360 defined(RHEL_76) 360 361 return drm_encoder_find(connector->dev, NULL, enc_id); 361 362 #else 362 363 return drm_encoder_find(connector->dev, enc_id); -
vbox_ttm.c
204 204 .destroy = &vbox_ttm_backend_destroy, 205 205 }; 206 206 207 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)207 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)) && !defined(RHEL_76) 208 208 static struct ttm_tt *vbox_ttm_tt_create(struct ttm_bo_device *bdev, 209 209 unsigned long size, 210 210 u32 page_flags, … … 221 221 return NULL; 222 222 223 223 tt->func = &vbox_tt_backend_func; 224 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)224 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0)) && !defined(RHEL_76) 225 225 if (ttm_tt_init(tt, bdev, size, page_flags, dummy_read_page)) { 226 226 #else 227 227 if (ttm_tt_init(tt, bo, page_flags)) { … … 234 234 } 235 235 236 236 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 17, 0) 237 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)237 # if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)) && !defined(RHEL_76) 238 238 static int vbox_ttm_tt_populate(struct ttm_tt *ttm) 239 239 { 240 240 return ttm_pool_populate(ttm); … … 268 268 .io_mem_reserve = &vbox_ttm_io_mem_reserve, 269 269 .io_mem_free = &vbox_ttm_io_mem_free, 270 270 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) || defined(RHEL_75) 271 # if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)271 # if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)) && !defined(RHEL_76) 272 272 .io_mem_pfn = ttm_bo_default_io_mem_pfn, 273 273 # endif 274 274 #endif … … 407 407 #else 408 408 align >> PAGE_SHIFT, false, acc_size, 409 409 #endif 410 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_72)410 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_72)) && !defined(RHEL_76) 411 411 NULL, NULL, vbox_bo_ttm_destroy); 412 412 #else 413 413 NULL, vbox_bo_ttm_destroy); … … 431 431 432 432 int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr) 433 433 { 434 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)434 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)) || defined(RHEL_76) 435 435 struct ttm_operation_ctx ctx = { false, false }; 436 436 #endif 437 437 int i, ret; … … 449 449 for (i = 0; i < bo->placement.num_placement; i++) 450 450 PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT; 451 451 452 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)452 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)) && !defined(RHEL_76) 453 453 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); 454 454 #else 455 455 ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx); … … 467 467 468 468 int vbox_bo_unpin(struct vbox_bo *bo) 469 469 { 470 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)470 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)) || defined(RHEL_76) 471 471 struct ttm_operation_ctx ctx = { false, false }; 472 472 #endif 473 473 int i, ret; … … 483 483 for (i = 0; i < bo->placement.num_placement; i++) 484 484 PLACEMENT_FLAGS(bo->placements[i]) &= ~TTM_PL_FLAG_NO_EVICT; 485 485 486 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)486 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)) && !defined(RHEL_76) 487 487 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); 488 488 #else 489 489 ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx); … … 501 501 */ 502 502 int vbox_bo_push_sysram(struct vbox_bo *bo) 503 503 { 504 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)504 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 16, 0)) || defined(RHEL_76) 505 505 struct ttm_operation_ctx ctx = { false, false }; 506 506 #endif 507 507 int i, ret; … … 522 522 for (i = 0; i < bo->placement.num_placement; i++) 523 523 PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT; 524 524 525 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)525 #if (LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)) && !defined(RHEL_76) 526 526 ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false); 527 527 #else 528 528 ret = ttm_bo_validate(&bo->bo, &bo->placement, &ctx);

