Changeset 68297 in vbox for trunk/src/VBox/Additions/linux
- Timestamp:
- Aug 4, 2017 10:25:39 AM (7 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.c
r67395 r68297 205 205 .mmap = vbox_mmap, 206 206 .poll = drm_poll, 207 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) 207 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7) 208 208 .fasync = drm_fasync, 209 209 #endif … … 272 272 .master_set = vbox_master_set, 273 273 .master_drop = vbox_master_drop, 274 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) 274 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_7) 275 275 .set_busid = drm_pci_set_busid, 276 276 #endif … … 288 288 .dumb_create = vbox_dumb_create, 289 289 .dumb_map_offset = vbox_dumb_mmap_offset, 290 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) 290 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7) 291 291 .dumb_destroy = vbox_dumb_destroy, 292 292 #else -
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r67396 r68297 49 49 #include <drm/ttm/ttm_module.h> 50 50 51 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) 51 #if defined(RHEL_MAJOR) && defined(RHEL_MINOR) 52 # if RHEL_MAJOR == 7 && RHEL_MINOR >= 3 53 # define RHEL_7 54 # endif 55 #endif 56 57 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_7) 52 58 #include <drm/drm_gem.h> 53 59 #endif … … 207 213 #endif 208 214 209 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) 215 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && !defined(RHEL_7) 210 216 #define CRTC_FB(crtc) ((crtc)->fb) 211 217 #else … … 223 229 int vbox_framebuffer_init(struct drm_device *dev, 224 230 struct vbox_framebuffer *vbox_fb, 225 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) 231 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(RHEL_7) 226 232 const 227 233 #endif … … 239 245 struct ttm_bo_kmap_obj kmap; 240 246 struct drm_gem_object gem; 241 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) 247 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7) 242 248 u32 placements[3]; 243 249 #else … … 259 265 struct drm_device *dev, 260 266 struct drm_mode_create_dumb *args); 261 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) 267 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7) 262 268 int vbox_dumb_destroy(struct drm_file *file, 263 269 struct drm_device *dev, u32 handle); … … 314 320 struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj); 315 321 struct drm_gem_object *vbox_gem_prime_import_sg_table(struct drm_device *dev, 316 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) 322 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7) 317 323 size_t size, 318 324 #else -
trunk/src/VBox/Additions/linux/drm/vbox_fb.c
r67397 r68297 409 409 spin_lock_init(&fbdev->dirty_lock); 410 410 411 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) 411 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) && !defined(RHEL_7) 412 412 fbdev->helper.funcs = &vbox_fb_helper_funcs; 413 413 #else -
trunk/src/VBox/Additions/linux/drm/vbox_irq.c
r67402 r68297 200 200 201 201 vbox_update_mode_hints(vbox); 202 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) 202 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || defined(RHEL_7) 203 203 ret = drm_irq_install(vbox->dev, vbox->dev->pdev->irq); 204 204 #else -
trunk/src/VBox/Additions/linux/drm/vbox_main.c
r67403 r68297 165 165 int vbox_framebuffer_init(struct drm_device *dev, 166 166 struct vbox_framebuffer *vbox_fb, 167 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) 167 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(RHEL_7) 168 168 const 169 169 #endif … … 191 191 struct drm_device *dev, 192 192 struct drm_file *filp, 193 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) 193 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(RHEL_7) 194 194 const struct drm_mode_fb_cmd2 *mode_cmd) 195 195 #else … … 242 242 } 243 243 244 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0) 244 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0) && !defined(RHEL_7) 245 245 #define pci_iomap_range(dev, bar, offset, maxlen) \ 246 246 ioremap(pci_resource_start(dev, bar) + (offset), maxlen) … … 440 440 struct vbox_private *vbox = dev->dev_private; 441 441 442 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) 442 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0) || defined(RHEL_7) 443 443 if (vbox->fbdev) 444 444 drm_fb_helper_restore_fbdev_mode_unlocked(&vbox->fbdev->helper); … … 499 499 } 500 500 501 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) 501 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7) 502 502 int vbox_dumb_destroy(struct drm_file *file, 503 503 struct drm_device *dev, u32 handle) … … 529 529 static inline u64 vbox_bo_mmap_offset(struct vbox_bo *bo) 530 530 { 531 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) 531 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) && !defined(RHEL_7) 532 532 return bo->bo.addr_space_offset; 533 533 #else -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r67404 r68297 43 43 #include <linux/export.h> 44 44 #include <drm/drm_crtc_helper.h> 45 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) 45 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) && defined(RHEL_7) 46 46 #include <drm/drm_plane_helper.h> 47 47 #endif … … 396 396 } 397 397 398 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) 398 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0) && !defined(RHEL_7) 399 399 static struct drm_encoder *drm_encoder_find(struct drm_device *dev, u32 id) 400 400 { … … 466 466 drm_encoder_init(dev, &vbox_encoder->base, &vbox_enc_funcs, 467 467 DRM_MODE_ENCODER_DAC 468 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) 468 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0) || defined(RHEL_7) 469 469 , NULL 470 470 #endif … … 593 593 } 594 594 vbox_set_edid(connector, preferred_width, preferred_height); 595 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) 595 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) || defined(RHEL_7) 596 596 drm_object_property_set_value( 597 597 &connector->base, vbox->dev->mode_config.suggested_x_property, … … 616 616 617 617 vbox_connector = to_vbox_connector(connector); 618 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) 618 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) && !defined(RHEL_7) 619 619 drm_sysfs_connector_remove(connector); 620 620 #else … … 688 688 connector->doublescan_allowed = 0; 689 689 690 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) 690 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) || defined(RHEL_7) 691 691 drm_mode_create_suggested_offset_properties(dev); 692 692 drm_object_attach_property(&connector->base, … … 695 695 dev->mode_config.suggested_y_property, -1); 696 696 #endif 697 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) 697 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) && !defined(RHEL_7) 698 698 drm_sysfs_connector_add(connector); 699 699 #else -
trunk/src/VBox/Additions/linux/drm/vbox_prime.c
r67405 r68297 50 50 51 51 struct drm_gem_object *vbox_gem_prime_import_sg_table(struct drm_device *dev, 52 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) 52 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7) 53 53 size_t size, 54 54 #else -
trunk/src/VBox/Additions/linux/drm/vbox_ttm.c
r67406 r68297 36 36 #include <ttm/ttm_page_alloc.h> 37 37 38 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) 38 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7) 39 39 #define PLACEMENT_FLAGS(placement) (placement) 40 40 #else … … 290 290 vbox->ttm.bo_global_ref.ref.object, 291 291 &vbox_bo_driver, 292 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) 292 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) || defined(RHEL_7) 293 293 dev->anon_inode->i_mapping, 294 294 #endif … … 342 342 { 343 343 u32 c = 0; 344 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) 344 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) && !defined(RHEL_7) 345 345 bo->placement.fpfn = 0; 346 346 bo->placement.lpfn = 0; … … 364 364 bo->placement.num_placement = c; 365 365 bo->placement.num_busy_placement = c; 366 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) 366 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_7) 367 367 for (i = 0; i < c; ++i) { 368 368 bo->placements[i].fpfn = 0; … … 391 391 392 392 vboxbo->bo.bdev = &vbox->ttm.bdev; 393 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) 393 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 15, 0) && !defined(RHEL_7) 394 394 vboxbo->bo.bdev->dev_mapping = dev->dev_mapping; 395 395 #endif … … 403 403 ttm_bo_type_device, &vboxbo->placement, 404 404 align >> PAGE_SHIFT, false, NULL, acc_size, 405 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) 405 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_7) 406 406 NULL, 407 407 #endif
Note:
See TracChangeset
for help on using the changeset viewer.