virtualbox/vbox-4.7.patch

77 lines
3.0 KiB
Diff

Index: VirtualBox-5.0.18/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
===================================================================
--- VirtualBox-5.0.18.orig/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
+++ VirtualBox-5.0.18/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c
@@ -152,7 +152,11 @@ static int vboxNetAdpLinuxXmit(struct sk
pPriv->Stats.tx_packets++;
pPriv->Stats.tx_bytes += pSkb->len;
/* Update transmission time stamp. */
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ netif_trans_update(pNetDev);
+# else
pNetDev->trans_start = jiffies;
+# endif
/* Nothing else to do, just free the sk_buff. */
dev_kfree_skb(pSkb);
return 0;
Index: VirtualBox-5.0.18/src/VBox/Additions/linux/drm/vbox_drv.h
===================================================================
--- VirtualBox-5.0.18.orig/src/VBox/Additions/linux/drm/vbox_drv.h
+++ VirtualBox-5.0.18/src/VBox/Additions/linux/drm/vbox_drv.h
@@ -285,7 +285,11 @@ static inline int vbox_bo_reserve(struct
{
int ret;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ ret = ttm_bo_reserve(&bo->bo, true, no_wait, NULL);
+#else
ret = ttm_bo_reserve(&bo->bo, true, no_wait, false, 0);
+#endif
if (ret)
{
if (ret != -ERESTARTSYS && ret != -EBUSY)
Index: VirtualBox-5.0.18/src/VBox/Additions/linux/drm/vbox_main.c
===================================================================
--- VirtualBox-5.0.18.orig/src/VBox/Additions/linux/drm/vbox_main.c
+++ VirtualBox-5.0.18/src/VBox/Additions/linux/drm/vbox_main.c
@@ -203,7 +203,11 @@ vbox_user_framebuffer_create(struct drm_
int ret;
LogFunc(("vboxvideo: %d\n", __LINE__));
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]);
+#else
obj = drm_gem_object_lookup(dev, filp, mode_cmd->handles[0]);
+#endif
if (obj == NULL)
return ERR_PTR(-ENOENT);
@@ -546,7 +550,11 @@ vbox_dumb_mmap_offset(struct drm_file *f
LogFunc(("vboxvideo: %d: dev=%p, handle=%u\n", __LINE__,
dev, (unsigned)handle));
mutex_lock(&dev->struct_mutex);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ obj = drm_gem_object_lookup(file, handle);
+#else
obj = drm_gem_object_lookup(dev, file, handle);
+#endif
if (obj == NULL) {
ret = -ENOENT;
goto out_unlock;
Index: VirtualBox-5.0.18/src/VBox/Additions/linux/drm/vbox_mode.c
===================================================================
--- VirtualBox-5.0.18.orig/src/VBox/Additions/linux/drm/vbox_mode.c
+++ VirtualBox-5.0.18/src/VBox/Additions/linux/drm/vbox_mode.c
@@ -714,7 +714,11 @@ static int vbox_cursor_set2(struct drm_c
|| !(caps & VMMDEV_MOUSE_HOST_WANTS_ABSOLUTE))
return -EINVAL;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0)
+ obj = drm_gem_object_lookup(file_priv, handle);
+#else
obj = drm_gem_object_lookup(crtc->dev, file_priv, handle);
+#endif
if (obj)
{
bo = gem_to_vbox_bo(obj);