--- src/VBox/Additions/linux/drm/vboxvideo_drm.c.orig 2014-07-15 14:27:37.000000000 +0200 +++ src/VBox/Additions/linux/drm/vboxvideo_drm.c 2015-04-04 10:36:04.000000000 +0200 @@ -77,6 +77,9 @@ # endif #include "drm/drmP.h" +# if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) +# include "drm/drm_legacy.h" +# endif #include "vboxvideo_drm.h" # ifndef RHEL_RELEASE_CODE @@ -126,7 +129,14 @@ .open = drm_open, .release = drm_release, .unlocked_ioctl = drm_ioctl, - .mmap = drm_mmap, +# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) + /* This shouldn't be necessary even for old kernels as there is + * nothing sensible to mmap. But we play safe and keep it for + * legacy reasons. */ + .mmap = drm_mmap, +# else + .mmap = drm_legacy_mmap, +# endif .poll = drm_poll, }; #endif @@ -143,6 +153,12 @@ .get_map_ofs = drm_core_get_map_ofs, .get_reg_ofs = drm_core_get_reg_ofs, #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) + /* If this is missing a warning gets printed to dmesg. We will not + * attempt to make kernels work to which the change (915b4d11b) got back- + * ported, as the problem is only cosmetic. */ + .set_busid = drm_pci_set_busid, +#endif # if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) && !defined(DRM_FOPS_AS_POINTER) .fops = { @@ -156,7 +172,11 @@ #else .ioctl = drm_ioctl, #endif +# if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0) .mmap = drm_mmap, +# else + .mmap = drm_legacy_mmap, +# endif .poll = drm_poll, }, #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(3, 3, 0) || defined(DRM_FOPS_AS_POINTER) */