Index: trunk/src/VBox/Additions/linux/drm/vbox_drv.h
===================================================================
--- trunk/src/VBox/Additions/linux/drm/vbox_drv.h	(revision 56466)
+++ trunk/src/VBox/Additions/linux/drm/vbox_drv.h	(revision 56467)
@@ -63,4 +63,8 @@
 #include <drm/ttm/ttm_memory.h>
 #include <drm/ttm/ttm_module.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
+# include <drm/drm_gem.h>
+#endif
 
 /* #include "vboxvideo.h" */
@@ -206,5 +210,9 @@
     struct ttm_bo_kmap_obj kmap;
     struct drm_gem_object gem;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
     u32 placements[3];
+#else
+    struct ttm_place placements[3];
+#endif
     int pin_count;
 };
Index: trunk/src/VBox/Additions/linux/drm/vbox_fb.c
===================================================================
--- trunk/src/VBox/Additions/linux/drm/vbox_fb.c	(revision 56466)
+++ trunk/src/VBox/Additions/linux/drm/vbox_fb.c	(revision 56467)
@@ -446,5 +446,9 @@
 
     vbox->fbdev = afbdev;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
     afbdev->helper.funcs = &vbox_fb_helper_funcs;
+#else
+    drm_fb_helper_prepare(dev, &afbdev->helper, &vbox_fb_helper_funcs);
+#endif
     ret = drm_fb_helper_init(dev, &afbdev->helper, vbox->cCrtcs, vbox->cCrtcs);
     if (ret)
Index: trunk/src/VBox/Additions/linux/drm/vbox_mode.c
===================================================================
--- trunk/src/VBox/Additions/linux/drm/vbox_mode.c	(revision 56466)
+++ trunk/src/VBox/Additions/linux/drm/vbox_mode.c	(revision 56467)
@@ -54,4 +54,7 @@
 #include <linux/export.h>
 #include <drm/drm_crtc_helper.h>
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
+# include <drm/drm_plane_helper.h>
+#endif
 
 static int vbox_cursor_set2(struct drm_crtc *crtc, struct drm_file *file_priv,
@@ -443,5 +446,9 @@
     pVBoxConnector = to_vbox_connector(pConnector);
     device_remove_file(pConnector->dev->dev, &pVBoxConnector->deviceAttribute);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
     drm_sysfs_connector_remove(pConnector);
+#else
+    drm_connector_unregister(pConnector);
+#endif
     drm_connector_cleanup(pConnector);
     kfree(pConnector);
@@ -537,5 +544,9 @@
     pConnector->doublescan_allowed = 0;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
     drm_sysfs_connector_add(pConnector);
+#else
+    drm_connector_register(pConnector);
+#endif
 
     /* The connector supports hot-plug detection: we promise to call
Index: trunk/src/VBox/Additions/linux/drm/vbox_ttm.c
===================================================================
--- trunk/src/VBox/Additions/linux/drm/vbox_ttm.c	(revision 56466)
+++ trunk/src/VBox/Additions/linux/drm/vbox_ttm.c	(revision 56467)
@@ -48,4 +48,10 @@
 #include "vbox_drv.h"
 #include <ttm/ttm_page_alloc.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
+# define PLACEMENT_FLAGS(placement) (placement)
+#else
+# define PLACEMENT_FLAGS(placement) (placement).flags
+#endif
 
 static inline struct vbox_private *
@@ -345,16 +351,28 @@
 {
     u32 c = 0;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
     bo->placement.fpfn = 0;
     bo->placement.lpfn = 0;
+#else
+    unsigned i;
+#endif
+
     bo->placement.placement = bo->placements;
     bo->placement.busy_placement = bo->placements;
     if (domain & TTM_PL_FLAG_VRAM)
-        bo->placements[c++] = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM;
+        PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_FLAG_WC | TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_VRAM;
     if (domain & TTM_PL_FLAG_SYSTEM)
-        bo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
+        PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
     if (!c)
-        bo->placements[c++] = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
+        PLACEMENT_FLAGS(bo->placements[c++]) = TTM_PL_MASK_CACHING | TTM_PL_FLAG_SYSTEM;
     bo->placement.num_placement = c;
     bo->placement.num_busy_placement = c;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
+    for (i = 0; i < c; ++i)
+    {
+        bo->placements[i].fpfn = 0;
+        bo->placements[i].lpfn = 0;
+    }
+#endif
 }
 
@@ -410,4 +428,7 @@
               ttm_bo_type_device, &vboxbo->placement,
               align >> PAGE_SHIFT, false, NULL, acc_size,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
+              NULL,
+#endif
               NULL, vbox_bo_ttm_destroy);
     if (ret)
@@ -437,5 +458,5 @@
     vbox_ttm_placement(bo, pl_flag);
     for (i = 0; i < bo->placement.num_placement; i++)
-        bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
+        PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT;
     ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
     if (ret)
@@ -461,5 +482,5 @@
 
     for (i = 0; i < bo->placement.num_placement ; i++)
-        bo->placements[i] &= ~TTM_PL_FLAG_NO_EVICT;
+        PLACEMENT_FLAGS(bo->placements[i]) &= ~TTM_PL_FLAG_NO_EVICT;
     ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
     if (ret)
@@ -489,5 +510,5 @@
     vbox_ttm_placement(bo, TTM_PL_FLAG_SYSTEM);
     for (i = 0; i < bo->placement.num_placement ; i++)
-        bo->placements[i] |= TTM_PL_FLAG_NO_EVICT;
+        PLACEMENT_FLAGS(bo->placements[i]) |= TTM_PL_FLAG_NO_EVICT;
 
     ret = ttm_bo_validate(&bo->bo, &bo->placement, false, false);
@@ -506,5 +527,5 @@
 
     if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
-        return drm_mmap(filp, vma);
+        return -EINVAL;
 
     file_priv = filp->private_data;
