diff -Nru virtualbox-hwe-5.2.18-dfsg/debian/changelog virtualbox-hwe-5.2.18-dfsg/debian/changelog --- virtualbox-hwe-5.2.18-dfsg/debian/changelog 2019-03-08 10:10:38.000000000 -0800 +++ virtualbox-hwe-5.2.18-dfsg/debian/changelog 2019-07-05 14:14:38.000000000 -0700 @@ -1,3 +1,16 @@ +virtualbox-hwe (5.2.18-dfsg-3~ubuntu18.04.4) bionic; urgency=medium + + * Fix build for Linux 5.0 (LP: #1835576) + - debian/patches/ubuntu-0001-linux-5.0-compat.patch + - debian/patches/ubuntu-0002-linux-5.0-move-ms-remount.patch + - debian/patches/ubuntu-0003-linux-5.0-make-driver-work-with-Linux-5.0.patch + - debian/patches/ubuntu-0004-drop-FBINFO_CAN_FORCE_OUTPUT-flag.patch + - debian/patches/ubuntu-0005-switch-to-drm_get-drm_put-helpers.patch + - debian/patches/ubuntu-0006-fixup-vboxvideo-module-include.patch + - debian/patches/ubuntu-0007-update-connector-functions.patch + + -- Connor Kuehl Fri, 05 Jul 2019 14:14:38 -0700 + virtualbox-hwe (5.2.18-dfsg-3~ubuntu18.04.3) bionic; urgency=medium * Fixup java breakage and switch to java11 (this fixes a build failure). diff -Nru virtualbox-hwe-5.2.18-dfsg/debian/patches/series virtualbox-hwe-5.2.18-dfsg/debian/patches/series --- virtualbox-hwe-5.2.18-dfsg/debian/patches/series 2019-03-08 10:10:38.000000000 -0800 +++ virtualbox-hwe-5.2.18-dfsg/debian/patches/series 2019-07-05 14:14:38.000000000 -0700 @@ -23,3 +23,10 @@ fix-guest-to-host-escape-vulnerability.patch java11.patch java11-upstream.patch +ubuntu-0001-linux-5.0-compat.patch +ubuntu-0002-linux-5.0-move-ms-remount.patch +ubuntu-0003-linux-5.0-make-driver-work-with-Linux-5.0.patch +ubuntu-0004-drop-FBINFO_CAN_FORCE_OUTPUT-flag.patch +ubuntu-0005-switch-to-drm_get-drm_put-helpers.patch +ubuntu-0006-fixup-vboxvideo-module-include.patch +ubuntu-0007-update-connector-functions.patch diff -Nru virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0001-linux-5.0-compat.patch virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0001-linux-5.0-compat.patch --- virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0001-linux-5.0-compat.patch 1969-12-31 16:00:00.000000000 -0800 +++ virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0001-linux-5.0-compat.patch 2019-07-05 14:14:38.000000000 -0700 @@ -0,0 +1,144 @@ +From: Trent Nelson +Subject: Linux 5.0 Compatibility + +[ Connor Kuehl : added the required + #ifdef _LINUX_TIME64_h that is present in upstream to the + RTTimeSpecSetTimespec64() addition. ] +--- +Index: virtualbox-hwe-5.2.18-dfsg/include/iprt/time.h +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/include/iprt/time.h ++++ virtualbox-hwe-5.2.18-dfsg/include/iprt/time.h +@@ -427,6 +427,13 @@ DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTim + { + return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimespec->tv_sec), pTimespec->tv_nsec); + } ++ ++# ifdef _LINUX_TIME64_H ++DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimespec) ++{ ++ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimespec->tv_sec), pTimespec->tv_nsec); ++} ++# endif + #endif /* various ways of detecting struct timespec */ + + +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Runtime/r0drv/linux/memuserkernel-r0drv-linux.c +@@ -33,6 +33,7 @@ + + #include + #include ++#include + + + RTR0DECL(int) RTR0MemUserCopyFrom(void *pvDst, RTR3PTR R3PtrSrc, size_t cb) +@@ -66,7 +67,11 @@ RT_EXPORT_SYMBOL(RTR0MemUserCopyTo); + RTR0DECL(bool) RTR0MemUserIsValidAddr(RTR3PTR R3Ptr) + { + IPRT_LINUX_SAVE_EFL_AC(); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + bool fRc = access_ok(VERIFY_READ, (void *)R3Ptr, 1); ++#else ++ bool fRc = access_ok((void *)R3Ptr, 1); ++#endif + IPRT_LINUX_RESTORE_EFL_AC(); + return fRc; + } +@@ -82,7 +87,11 @@ RTR0DECL(bool) RTR0MemKernelIsValidAddr( + return (uintptr_t)pv >= PAGE_OFFSET; + #else + # error "PORT ME" ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + return !access_ok(VERIFY_READ, pv, 1); ++#else ++ return !access_ok(pv, 1); ++#endif + #endif + } + RT_EXPORT_SYMBOL(RTR0MemKernelIsValidAddr); +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Runtime/r0drv/linux/time-r0drv-linux.c +@@ -170,7 +170,13 @@ RT_EXPORT_SYMBOL(RTTimeSystemMilliTS); + RTDECL(PRTTIMESPEC) RTTimeNow(PRTTIMESPEC pTime) + { + IPRT_LINUX_SAVE_EFL_AC(); +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++ struct timespec64 Ts; ++ ktime_get_real_ts64(&Ts); ++ IPRT_LINUX_RESTORE_EFL_AC(); ++ return RTTimeSpecSetTimespec64(pTime, &Ts); ++ ++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16) + struct timespec Ts; + ktime_get_real_ts(&Ts); + IPRT_LINUX_RESTORE_EFL_AC(); +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/HostDrivers/VBoxNetAdp/linux/VBoxNetAdp-linux.c +@@ -84,7 +84,12 @@ static long VBoxNetAdpLinuxIOCtlUnlocked + #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36) */ + + static void vboxNetAdpEthGetDrvinfo(struct net_device *dev, struct ethtool_drvinfo *info); ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, ++ struct ethtool_link_ksettings *lks); ++#else + static int vboxNetAdpEthGetSettings(struct net_device *dev, struct ethtool_cmd *cmd); ++#endif + + + /********************************************************************************************************************************* +@@ -129,7 +134,11 @@ static struct miscdevice g_CtlDev = + static const struct ethtool_ops gEthToolOpsVBoxNetAdp = + { + .get_drvinfo = vboxNetAdpEthGetDrvinfo, ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++ .get_link_ksettings = vboxNetAdpEthGetLinkSettings, ++#else + .get_settings = vboxNetAdpEthGetSettings, ++#endif + .get_link = ethtool_op_get_link, + }; + +@@ -201,6 +210,26 @@ static void vboxNetAdpEthGetDrvinfo(stru + } + + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++static int vboxNetAdpEthGetLinkSettings(struct net_device *pNetDev, struct ethtool_link_ksettings *lks) ++{ ++ /* new */ ++ lks->base.cmd = ETHTOOL_GLINKSETTINGS; ++ /* unchanged */ ++ lks->base.speed = SPEED_10; ++ lks->base.duplex = DUPLEX_FULL; ++ lks->base.port = PORT_TP; ++ lks->base.phy_address = 0; ++ lks->base.autoneg = AUTONEG_DISABLE; ++ /* removed ++ * lks->base.tranceiver = 0; ++ * lks->base.maxtxpkt = 0; ++ * lks->base.maxrxpkt = 0; ++ */ ++ ++ return 0; ++} ++#else /* < 5.0.0 */ + /* ethtool_ops::get_settings */ + static int vboxNetAdpEthGetSettings(struct net_device *pNetDev, struct ethtool_cmd *cmd) + { +@@ -220,6 +249,7 @@ static int vboxNetAdpEthGetSettings(stru + cmd->maxrxpkt = 0; + return 0; + } ++#endif + + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) diff -Nru virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0002-linux-5.0-move-ms-remount.patch virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0002-linux-5.0-move-ms-remount.patch --- virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0002-linux-5.0-move-ms-remount.patch 1969-12-31 16:00:00.000000000 -0800 +++ virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0002-linux-5.0-move-ms-remount.patch 2019-07-05 14:14:38.000000000 -0700 @@ -0,0 +1,25 @@ +From: vboxsync +Subject: linux/vboxsf: MS_REMOUNT and friends moved to uapi/linux/mount.h in 5.0 (rc8), so we need to include it to use it. + +bugref:9172 + +[ Connor Kuehl : Patch found in + Virtualbox's online repository. Required minor offset + adjustments. ] +--- +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/sharedfolders/vfsmod.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/sharedfolders/vfsmod.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/sharedfolders/vfsmod.c +@@ -33,6 +33,11 @@ + #include "revision-generated.h" + #include "product-generated.h" + #include "VBoxGuestR0LibInternal.h" ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0) ++# include /* for MS_REMOUNT */ ++#elif LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) ++# include ++#endif + + MODULE_DESCRIPTION(VBOX_PRODUCT " VFS Module for Host File System Access"); + MODULE_AUTHOR(VBOX_VENDOR); diff -Nru virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0003-linux-5.0-make-driver-work-with-Linux-5.0.patch virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0003-linux-5.0-make-driver-work-with-Linux-5.0.patch --- virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0003-linux-5.0-make-driver-work-with-Linux-5.0.patch 1969-12-31 16:00:00.000000000 -0800 +++ virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0003-linux-5.0-make-driver-work-with-Linux-5.0.patch 2019-07-05 14:14:38.000000000 -0700 @@ -0,0 +1,212 @@ +From: vboxsync +Subject: bugref:4567: Linux kernel driver maintenance. + +This change mainly consists of adaptations of the parts of the following +kernel changes which affect staging/vboxvideo: + +commit c58ac649e3553c23a9bafba8c2e5d040aee87484 +Author: Cihangir Akturk +Date: Fri Aug 11 15:33:14 2017 +0300 + + drm: vboxvideo: switch to drm_*_get(), drm_*_put() helpers + +Author: Christian König +Date: Fri Oct 19 13:49:05 2018 +0200 + + drm/ttm: use a static ttm_mem_global instance + +commit a64f784bb14a56bfdfad2dc397dd67e4564e3a29 +Author: Christian König +Date: Fri Oct 19 16:55:26 2018 +0200 + + drm/ttm: initialize globals during device init (v2) + +--- +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_drv.h +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_drv.h ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_drv.h +@@ -146,8 +146,10 @@ struct vbox_private { + int fb_mtrr; + + struct { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + struct drm_global_reference mem_global_ref; + struct ttm_bo_global_ref bo_global_ref; ++#endif + struct ttm_bo_device bdev; + bool mm_initialised; + } ttm; +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_main.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_main.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_main.c +@@ -506,6 +506,7 @@ int vbox_dumb_destroy(struct drm_file *f + } + #endif + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) + static void vbox_bo_unref(struct vbox_bo **bo) + { + struct ttm_buffer_object *tbo; +@@ -518,12 +519,17 @@ static void vbox_bo_unref(struct vbox_bo + if (!tbo) + *bo = NULL; + } ++#endif + + void vbox_gem_free_object(struct drm_gem_object *obj) + { + struct vbox_bo *vbox_bo = gem_to_vbox_bo(obj); + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) + vbox_bo_unref(&vbox_bo); ++#else ++ ttm_bo_put(&vbox_bo->bo); ++#endif + } + + static inline u64 vbox_bo_mmap_offset(struct vbox_bo *bo) +@@ -558,7 +564,7 @@ vbox_dumb_mmap_offset(struct drm_file *f + bo = gem_to_vbox_bo(obj); + *offset = vbox_bo_mmap_offset(bo); + +- drm_gem_object_unreference(obj); ++ drm_gem_object_put(obj); + ret = 0; + + out_unlock: +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_mode.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_mode.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_mode.c +@@ -42,6 +42,9 @@ + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_73) + #include + #endif ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) ++#include ++#endif + + #include "VBoxVideo.h" + #include "hgsmi_channels.h" +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_ttm.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_ttm.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_ttm.c +@@ -46,6 +46,7 @@ static inline struct vbox_private *vbox_ + return container_of(bd, struct vbox_private, ttm.bdev); + } + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + static int vbox_ttm_mem_global_init(struct drm_global_reference *ref) + { + return ttm_mem_global_init(ref->object); +@@ -64,6 +65,7 @@ static int vbox_ttm_global_init(struct v + struct drm_global_reference *global_ref; + int r; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + global_ref = &vbox->ttm.mem_global_ref; + global_ref->global_type = DRM_GLOBAL_TTM_MEM; + global_ref->size = sizeof(struct ttm_mem_global); +@@ -76,6 +78,7 @@ static int vbox_ttm_global_init(struct v + } + + vbox->ttm.bo_global_ref.mem_glob = vbox->ttm.mem_global_ref.object; ++#endif + global_ref = &vbox->ttm.bo_global_ref.ref; + global_ref->global_type = DRM_GLOBAL_TTM_BO; + global_ref->size = sizeof(struct ttm_bo_global); +@@ -85,7 +88,9 @@ static int vbox_ttm_global_init(struct v + r = drm_global_item_ref(global_ref); + if (r != 0) { + DRM_ERROR("Failed setting up TTM BO subsystem.\n"); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + drm_global_item_unref(&vbox->ttm.mem_global_ref); ++#endif + return r; + } + +@@ -104,6 +109,7 @@ static void vbox_ttm_global_release(stru + drm_global_item_unref(&vbox->ttm.mem_global_ref); + vbox->ttm.mem_global_ref.release = NULL; + } ++#endif + + static void vbox_bo_ttm_destroy(struct ttm_buffer_object *tbo) + { +@@ -291,12 +297,16 @@ int vbox_mm_init(struct vbox_private *vb + struct drm_device *dev = vbox->dev; + struct ttm_bo_device *bdev = &vbox->ttm.bdev; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + ret = vbox_ttm_global_init(vbox); + 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, ++#endif + &vbox_bo_driver, + #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 15, 0) || defined(RHEL_73) + dev->anon_inode->i_mapping, +@@ -335,8 +345,9 @@ void vbox_mm_fini(struct vbox_private *v + if (!vbox->ttm.mm_initialised) + return; + ttm_bo_device_release(&vbox->ttm.bdev); +- ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) + vbox_ttm_global_release(vbox); ++#endif + + #ifdef DRM_MTRR_WC + drm_mtrr_del(vbox->fb_mtrr, +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_drv.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_drv.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_drv.c +@@ -34,6 +34,10 @@ + */ + #include "vbox_drv.h" + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) ++#include ++#endif ++ + #include "version-generated.h" + #include "revision-generated.h" + +@@ -262,7 +266,10 @@ static void vbox_master_drop(struct drm_ + + static struct drm_driver driver = { + .driver_features = +- DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | ++ DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ | ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) ++ DRIVER_IRQ_SHARED | ++#endif + DRIVER_PRIME, + .dev_priv_size = 0, + +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_irq.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_irq.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_irq.c +@@ -34,9 +34,12 @@ + + #include "vbox_drv.h" + +-#include +- ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) + #include ++#else ++#include ++#endif ++#include + + static void vbox_clear_irq(void) + { diff -Nru virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0004-drop-FBINFO_CAN_FORCE_OUTPUT-flag.patch virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0004-drop-FBINFO_CAN_FORCE_OUTPUT-flag.patch --- virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0004-drop-FBINFO_CAN_FORCE_OUTPUT-flag.patch 1969-12-31 16:00:00.000000000 -0800 +++ virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0004-drop-FBINFO_CAN_FORCE_OUTPUT-flag.patch 2019-07-05 14:14:38.000000000 -0700 @@ -0,0 +1,31 @@ +From: vboxsync +Subject: Additions/linux/drm: drop FBINFO_CAN_FORCE_OUTPUT flag + +bugref:4567: Linux kernel driver maintenance +In the drm routines, info->flags no longer accepts FBINFO_CAN_FORCE_OUTPUT. +According to the kernel commit message, this flag was unused and it can be +deleted without any harmful effects. +Thank you Larry Finger for the patch + +[ Connor Kuehl : adjusted patch to conditionally + retain FBINFO_CAN_FORCE_OUTPUT since it was removed in 4.20 and this package + is intended to remain building for 4.15 ] + +--- +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_fb.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_fb.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_fb.c +@@ -297,8 +297,10 @@ static int vboxfb_create(struct drm_fb_h + * The last flag forces a mode set on VT switches even if the kernel + * does not think it is needed. + */ +- info->flags = FBINFO_DEFAULT | FBINFO_CAN_FORCE_OUTPUT | +- FBINFO_MISC_ALWAYS_SETPAR; ++ info->flags = FBINFO_DEFAULT | FBINFO_MISC_ALWAYS_SETPAR; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 20, 0) ++ info->flags |= FBINFO_CAN_FORCE_OUTPUT; ++#endif + info->fbops = &vboxfb_ops; + + ret = fb_alloc_cmap(&info->cmap, 256, 0); diff -Nru virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0005-switch-to-drm_get-drm_put-helpers.patch virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0005-switch-to-drm_get-drm_put-helpers.patch --- virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0005-switch-to-drm_get-drm_put-helpers.patch 1969-12-31 16:00:00.000000000 -0800 +++ virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0005-switch-to-drm_get-drm_put-helpers.patch 2019-07-05 14:14:38.000000000 -0700 @@ -0,0 +1,109 @@ +From: vboxsync +Subject: Additions/linux/vboxvideo: switch to drm_*_get(), drm_*_put() helpers + +bugref:8282: Additions/linux: track kernel changes to vboxvideo in our own tree + + Use drm_*_get() and drm_*_put() helpers instead of drm_*_reference() + and drm_*_unreference() helpers. + + drm_*_reference() and drm_*_unreference() functions are just + compatibility alias for drm_*_get() and drm_*_put() and should not be + used by new code. So convert all users of compatibility functions to + use the new APIs. + + Generated by: scripts/coccinelle/api/drm-get-put.cocci + + Signed-off-by: Cihangir Akturk + Reviewed-by: Hans de Goede + Signed-off-by: Sean Paul + Link: https://patchwork.freedesktop.org/patch/msgid/1502454794-28558-29-git- +send-email-cakturk@gmail.com +Adjusted by the VirtualBox team. + +[ Connor Kuehl : the original patch is based on a + revision that contains a number of cleanups and error-handling paths. I solely + took the function calls and updated each call site. ] +--- +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_drv.h +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_drv.h ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_drv.h +@@ -99,6 +99,13 @@ + + #include "product-generated.h" + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) && !defined(RHEL_75) ++static inline void drm_gem_object_put_unlocked(struct drm_gem_object *obj) ++{ ++ drm_gem_object_unreference_unlocked(obj); ++} ++#endif ++ + #define DRIVER_AUTHOR VBOX_VENDOR + + #define DRIVER_NAME "vboxvideo" +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_main.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_main.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_main.c +@@ -45,7 +45,7 @@ static void vbox_user_framebuffer_destro + struct vbox_framebuffer *vbox_fb = to_vbox_framebuffer(fb); + + if (vbox_fb->obj) +- drm_gem_object_unreference_unlocked(vbox_fb->obj); ++ drm_gem_object_put_unlocked(vbox_fb->obj); + + drm_framebuffer_cleanup(fb); + kfree(fb); +@@ -210,14 +210,14 @@ static struct drm_framebuffer *vbox_user + + vbox_fb = kzalloc(sizeof(*vbox_fb), GFP_KERNEL); + if (!vbox_fb) { +- drm_gem_object_unreference_unlocked(obj); ++ drm_gem_object_put_unlocked(obj); + return ERR_PTR(-ENOMEM); + } + + ret = vbox_framebuffer_init(dev, vbox_fb, mode_cmd, obj); + if (ret) { +- drm_gem_object_unreference_unlocked(obj); + kfree(vbox_fb); ++ drm_gem_object_put_unlocked(obj); + return ERR_PTR(ret); + } + +@@ -489,7 +489,7 @@ int vbox_dumb_create(struct drm_file *fi + return ret; + + ret = drm_gem_handle_create(file, gobj, &handle); +- drm_gem_object_unreference_unlocked(gobj); ++ drm_gem_object_put_unlocked(gobj); + if (ret) + return ret; + +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_mode.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_mode.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_mode.c +@@ -859,7 +859,7 @@ static int vbox_cursor_set2(struct drm_c + } + vbox_bo_unreserve(bo); + } +- drm_gem_object_unreference_unlocked(obj); ++ drm_gem_object_put_unlocked(obj); + } else { + DRM_ERROR("Cannot find cursor object %x for crtc\n", handle); + ret = -ENOENT; +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_fb.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_fb.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_fb.c +@@ -373,7 +373,7 @@ static void vbox_fbdev_destroy(struct dr + vbox_bo_unpin(bo); + vbox_bo_unreserve(bo); + } +- drm_gem_object_unreference_unlocked(afb->obj); ++ drm_gem_object_put_unlocked(afb->obj); + afb->obj = NULL; + } + drm_fb_helper_fini(&fbdev->helper); diff -Nru virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0006-fixup-vboxvideo-module-include.patch virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0006-fixup-vboxvideo-module-include.patch --- virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0006-fixup-vboxvideo-module-include.patch 1969-12-31 16:00:00.000000000 -0800 +++ virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0006-fixup-vboxvideo-module-include.patch 2019-07-05 14:14:38.000000000 -0700 @@ -0,0 +1,31 @@ +From: vboxsync +Subject: More linux kernel module Makefile cleanups: Somehow missed the drm module (vboxvideo) + +[ Connor Kuehl : This patch was based on a revision that + had a large number of clean-ups. Instead of bringing in all those changes, I cherry + picked only the lines that would properly update the include path so this module will + build properly; otherwise the compiler cannot find vboxvideo.h ] +--- +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/Makefile.module.kms +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/Makefile.module.kms ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/Makefile.module.kms +@@ -17,6 +17,9 @@ + # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. + # + ++# Find the directory of this makefile. ++VBOXDRM_DIR := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) ++ + # Linux kbuild sets this to our source directory if we are called from there + obj ?= $(CURDIR) + include $(obj)/Makefile.include.header +@@ -38,7 +41,7 @@ MOD_NAME = vboxvideo + MOD_OBJS = hgsmi_base.o \ + modesetting.o vbox_drv.o vbox_fb.o vbox_irq.o vbox_main.o \ + vbox_mode.o vbox_ttm.o vbva_base.o vbox_prime.o vbox_hgsmi.o +-MOD_INCL = -I$(KBUILD_EXTMOD) -Iinclude/drm ++MOD_INCL = -I$(VBOXDRM_DIR) -Iinclude/drm + + include $(obj)/Makefile.include.footer + diff -Nru virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0007-update-connector-functions.patch virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0007-update-connector-functions.patch --- virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0007-update-connector-functions.patch 1969-12-31 16:00:00.000000000 -0800 +++ virtualbox-hwe-5.2.18-dfsg/debian/patches/ubuntu-0007-update-connector-functions.patch 2019-07-05 14:14:38.000000000 -0700 @@ -0,0 +1,36 @@ +From: vboxsync +Subject: Addiitons/linux/vboxvideo: Fixes for API changes in kernel 4.19 + +Contributed by Larry Finger. Many thanks! + +[ Connor Kuehl : Added missing #endif to + the newly added code in vbox_set_edid(). ] +--- +Index: virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_mode.c +=================================================================== +--- virtualbox-hwe-5.2.18-dfsg.orig/src/VBox/Additions/linux/drm/vbox_mode.c ++++ virtualbox-hwe-5.2.18-dfsg/src/VBox/Additions/linux/drm/vbox_mode.c +@@ -539,7 +539,11 @@ static void vbox_set_edid(struct drm_con + for (i = 0; i < EDID_SIZE - 1; ++i) + sum += edid[i]; + edid[EDID_SIZE - 1] = (0x100 - (sum & 0xFF)) & 0xFF; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) ++ drm_connector_update_edid_property(connector, (struct edid *)edid); ++#else + drm_mode_connector_update_edid_property(connector, (struct edid *)edid); ++#endif + } + + static int vbox_get_modes(struct drm_connector *connector) +@@ -706,7 +710,11 @@ static int vbox_connector_init(struct dr + drm_connector_register(connector); + #endif + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) ++ drm_connector_attach_encoder(connector, encoder); ++#else + drm_mode_connector_attach_encoder(connector, encoder); ++#endif + + return 0; + }