On 5/30/19 10:04 AM, Gianfranco Costamagna wrote:
Hello,
sorry for not stepping in before, I crafted a patch one week ago, that seems to be working so far


https://salsa.debian.org/pkg-virtualbox-team/virtualbox/blob/master/debian/patches/new-kernel-5.2.patch


MIT attached
(I already sent it over irc as soon as I did it)

HTH

G.

Il giovedì 30 maggio 2019, 08:47:41 CEST, Larry Finger <[email protected]> ha scritto:


On 5/29/19 11:59 PM, Valdis Klētnieks wrote:
 > On Wed, 29 May 2019 13:32:40 -0500, Larry Finger said:
 >
 >> 2. The arguments for ttm_bo_device_init() are changed.
 >
 >> ===================================================================
 >> --- VirtualBox-6.0.8.orig/src/VBox/Additions/linux/drm/vbox_ttm.c
 >> +++ VirtualBox-6.0.8/src/VBox/Additions/linux/drm/vbox_ttm.c
 >> @@ -298,6 +298,11 @@ int vbox_mm_init(struct vbox_private *vb
 >>      if (ret)
 >>          return ret;
 >>  #endif
 >> +int ttm_bo_device_init(struct ttm_bo_device *bdev,
 >> +                      struct ttm_bo_driver *driver,
 >> +                      struct address_space *mapping,
 >> +                      bool need_dma32);
 >> +
 >
 > Umm.. doesn't this prototype need #ifdef's for kernel version?

This patch is incorrect. I will have the corrected one tomorrow.


My corrected patch is attached.

Larry
There are two kernel 5.2 API changes that affect VirtualBox:

1. drm_fb_helper_fill_fix() and drm_fb_helper_fill_var() are replaced
   by drm_fb_helper_fill_info().
2. The arguments for ttm_bo_device_init() are changed.


Index: VirtualBox-6.0.8/src/VBox/Additions/linux/drm/vbox_fb.c
===================================================================
--- VirtualBox-6.0.8.orig/src/VBox/Additions/linux/drm/vbox_fb.c
+++ VirtualBox-6.0.8/src/VBox/Additions/linux/drm/vbox_fb.c
@@ -335,13 +335,17 @@ static int vboxfb_create(struct drm_fb_h
 	info->apertures->ranges[0].base = pci_resource_start(dev->pdev, 0);
 	info->apertures->ranges[0].size = pci_resource_len(dev->pdev, 0);
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) || defined(RHEL_75)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 2, 0)
+	drm_fb_helper_fill_info(info, &fbdev->helper, sizes);
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) || defined(RHEL_75)
 	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->format->depth);
 #else
 	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
 #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
 	drm_fb_helper_fill_var(info, &fbdev->helper, sizes->fb_width,
 			       sizes->fb_height);
+#endif
 
 	info->screen_base = bo->kmap.virtual;
 	info->screen_size = size;
Index: VirtualBox-6.0.8/src/VBox/Additions/linux/drm/vbox_ttm.c
===================================================================
--- VirtualBox-6.0.8.orig/src/VBox/Additions/linux/drm/vbox_ttm.c
+++ VirtualBox-6.0.8/src/VBox/Additions/linux/drm/vbox_ttm.c
@@ -298,7 +298,6 @@ int vbox_mm_init(struct vbox_private *vb
 	if (ret)
 		return ret;
 #endif
-
 	ret = ttm_bo_device_init(&vbox->ttm.bdev,
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
 				 vbox->ttm.bo_global_ref.ref.object,
@@ -307,7 +306,11 @@ int vbox_mm_init(struct vbox_private *vb
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) || defined(RHEL_71)
 				 dev->anon_inode->i_mapping,
 #endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 2, 0)
 				 DRM_FILE_PAGE_OFFSET, true);
+#else
+				 true);
+#endif
 	if (ret) {
 		DRM_ERROR("Error initialising bo driver; %d\n", ret);
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev

Reply via email to