Index: /trunk/src/VBox/Additions/linux/drm/Makefile.module.kms
===================================================================
--- /trunk/src/VBox/Additions/linux/drm/Makefile.module.kms	(revision 66188)
+++ /trunk/src/VBox/Additions/linux/drm/Makefile.module.kms	(revision 66189)
@@ -37,5 +37,5 @@
 MOD_OBJS   = HGSMIBase.o HGSMICommon.o HGSMIMemAlloc.o \
              Modesetting.o vbox_drv.o vbox_fb.o vbox_irq.o vbox_main.o \
-             vbox_mode.o vbox_ttm.o VBVABase.o
+             vbox_mode.o vbox_ttm.o VBVABase.o vbox_prime.o
 
 MOD_CFLAGS = -Wno-declaration-after-statement -fshort-wchar -fno-pie
Index: /trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv
===================================================================
--- /trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv	(revision 66188)
+++ /trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv	(revision 66189)
@@ -53,4 +53,5 @@
     ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_main.c=>vbox_main.c \
     ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_mode.c=>vbox_mode.c \
+    ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_prime.c=>vbox_prime.c \
     ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_ttm.c=>vbox_ttm.c \
     ${PATH_ROOT}/src/VBox/GuestHost/HGSMI/HGSMICommon.cpp=>HGSMICommon.c \
Index: /trunk/src/VBox/Additions/linux/drm/vbox_drv.c
===================================================================
--- /trunk/src/VBox/Additions/linux/drm/vbox_drv.c	(revision 66188)
+++ /trunk/src/VBox/Additions/linux/drm/vbox_drv.c	(revision 66189)
@@ -273,5 +273,5 @@
 static struct drm_driver driver =
 {
-    .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED,
+    .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_PRIME,
     .dev_priv_size = 0,
 
@@ -302,4 +302,15 @@
     .dumb_destroy = drm_gem_dumb_destroy,
 #endif
+    .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
+    .prime_fd_to_handle = drm_gem_prime_fd_to_handle,
+    .gem_prime_export = drm_gem_prime_export,
+    .gem_prime_import = drm_gem_prime_import,
+    .gem_prime_pin = vbox_gem_prime_pin,
+    .gem_prime_unpin = vbox_gem_prime_unpin,
+    .gem_prime_get_sg_table = vbox_gem_prime_get_sg_table,
+    .gem_prime_import_sg_table = vbox_gem_prime_import_sg_table,
+    .gem_prime_vmap = vbox_gem_prime_vmap,
+    .gem_prime_vunmap = vbox_gem_prime_vunmap,
+    .gem_prime_mmap = vbox_gem_prime_mmap,
 
 };
Index: /trunk/src/VBox/Additions/linux/drm/vbox_drv.h
===================================================================
--- /trunk/src/VBox/Additions/linux/drm/vbox_drv.h	(revision 66188)
+++ /trunk/src/VBox/Additions/linux/drm/vbox_drv.h	(revision 66189)
@@ -321,4 +321,21 @@
 int vbox_mmap(struct file *filp, struct vm_area_struct *vma);
 
+/*vbox_prime*/
+int vbox_gem_prime_pin(struct drm_gem_object *obj);
+void vbox_gem_prime_unpin(struct drm_gem_object *obj);
+struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj);
+struct drm_gem_object *vbox_gem_prime_import_sg_table(
+        struct drm_device *dev,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
+        size_t size,
+#else
+        struct dma_buf_attachment *attach,
+#endif
+        struct sg_table *table);
+void *vbox_gem_prime_vmap(struct drm_gem_object *obj);
+void vbox_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr);
+int vbox_gem_prime_mmap(struct drm_gem_object *obj,
+        struct vm_area_struct *area);
+
 /* vbox_irq.c */
 int vbox_irq_init(struct vbox_private *vbox);
Index: /trunk/src/VBox/Additions/linux/drm/vbox_prime.c
===================================================================
--- /trunk/src/VBox/Additions/linux/drm/vbox_prime.c	(revision 66189)
+++ /trunk/src/VBox/Additions/linux/drm/vbox_prime.c	(revision 66189)
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2017 Oracle Corporation
+ *
+ * This file is part of VirtualBox Open Source Edition (OSE), as
+ * available from http://www.virtualbox.org. This file is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License (GPL) as published by the Free Software
+ * Foundation, in version 2 as it comes in the "COPYING" file of the
+ * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
+ * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
+ * --------------------------------------------------------------------
+
+ * Copyright 2017 Canonical
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: Andreas Pokorny
+ */
+
+#include "vbox_drv.h"
+
+/* Based on qxl_prime.c:
+ * Empty Implementations as there should not be any other driver for a virtual
+ * device that might share buffers with vboxvideo */
+
+int vbox_gem_prime_pin(struct drm_gem_object *obj)
+{
+    WARN_ONCE(1, "not implemented");
+    return -ENOSYS;
+}
+
+void vbox_gem_prime_unpin(struct drm_gem_object *obj)
+{
+    WARN_ONCE(1, "not implemented");
+}
+
+
+struct sg_table *vbox_gem_prime_get_sg_table(struct drm_gem_object *obj)
+{
+    WARN_ONCE(1, "not implemented");
+    return ERR_PTR(-ENOSYS);
+}
+
+struct drm_gem_object *vbox_gem_prime_import_sg_table(
+        struct drm_device *dev,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 18, 0)
+        size_t size,
+#else
+        struct dma_buf_attachment *attach,
+#endif
+        struct sg_table *table)
+{
+    WARN_ONCE(1, "not implemented");
+    return ERR_PTR(-ENOSYS);
+}
+
+void *vbox_gem_prime_vmap(struct drm_gem_object *obj)
+{
+    WARN_ONCE(1, "not implemented");
+    return ERR_PTR(-ENOSYS);
+}
+
+void vbox_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
+{
+    WARN_ONCE(1, "not implemented");
+}
+
+int vbox_gem_prime_mmap(struct drm_gem_object *obj,
+        struct vm_area_struct *area)
+{
+    WARN_ONCE(1, "not implemented");
+    return -ENOSYS;
+}
