commit 2b42cfc085f34b5c10de9de3c4d1c81beeb9732f
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Sat Sep 14 05:50:09 2019 +0100
git add kernel-el7.7.patch
kernel-el7.7.patch | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 164 insertions(+)
---
diff --git a/kernel-el7.7.patch b/kernel-el7.7.patch
new file mode 100644
index 0000000..756d9a8
--- /dev/null
+++ b/kernel-el7.7.patch
@@ -0,0 +1,164 @@
+diff -up VirtualBox-kmod-6.0.12/vboxvideo/vbox_drv.c
VBoxGuestAdditions/src/vboxguest-6.0.13/vboxvideo/vbox_drv.c
+--- VirtualBox-kmod-6.0.12/vboxvideo/vbox_drv.c 2019-09-06 16:28:36.000000000 +0100
++++ VBoxGuestAdditions/vboxvideo/vbox_drv.c 2019-09-14 05:16:27.955884295 +0100
+@@ -37,7 +37,7 @@
+
+ #include "vbox_drv.h"
+
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || defined(RHEL_81)
+ #include <drm/drm_probe_helper.h>
+ #endif
+
+@@ -267,7 +267,7 @@ static void vbox_master_drop(struct drm_
+ static struct drm_driver driver = {
+ .driver_features =
+ DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ |
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) && !defined(RHEL_81)
+ DRIVER_IRQ_SHARED |
+ #endif
+ DRIVER_PRIME,
+diff -up VirtualBox-kmod-6.0.12/vboxvideo/vbox_drv.h
VBoxGuestAdditions/src/vboxguest-6.0.13/vboxvideo/vbox_drv.h
+--- VirtualBox-kmod-6.0.12/vboxvideo/vbox_drv.h 2019-09-06 16:28:36.000000000 +0100
++++ VBoxGuestAdditions/vboxvideo/vbox_drv.h 2019-09-14 05:16:27.962884436 +0100
+@@ -45,6 +46,15 @@
+ #include <linux/string.h>
+
+ #if defined(RHEL_MAJOR) && defined(RHEL_MINOR)
++# if RHEL_MAJOR == 8 && RHEL_MINOR >= 1
++# define RHEL_81
++# endif
++# if RHEL_MAJOR == 8 && RHEL_MINOR >= 0
++# define RHEL_80
++# endif
++# if RHEL_MAJOR == 7 && RHEL_MINOR >= 7
++# define RHEL_77
++# endif
+ # if RHEL_MAJOR == 7 && RHEL_MINOR >= 6
+ # define RHEL_76
+ # endif
+@@ -182,7 +192,7 @@ struct vbox_private {
+ int fb_mtrr;
+
+ struct {
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) && !defined(RHEL_77)
&& !defined(RHEL_81)
+ struct drm_global_reference mem_global_ref;
+ struct ttm_bo_global_ref bo_global_ref;
+ #endif
+diff -up VirtualBox-kmod-6.0.12/vboxvideo/vbox_irq.c
VBoxGuestAdditions/src/vboxguest-6.0.13/vboxvideo/vbox_irq.c
+--- VirtualBox-kmod-6.0.12/vboxvideo/vbox_irq.c 2019-09-06 16:28:36.000000000 +0100
++++ VBoxGuestAdditions/vboxvideo/vbox_irq.c 2019-09-14 05:16:27.933883851 +0100
+@@ -1,3 +1,4 @@
++/* $Id: vbox_irq.c 133264 2019-09-11 09:56:19Z paulson $ */
+ /*
+ * Copyright (C) 2016-2019 Oracle Corporation
+ * This file is based on qxl_irq.c
+@@ -30,6 +31,9 @@
+
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
+ #include <drm/drm_crtc_helper.h>
++# if defined(RHEL_81)
++# include <drm/drm_probe_helper.h>
++# endif
+ #else
+ #include <drm/drm_probe_helper.h>
+ #endif
+diff -up VirtualBox-kmod-6.0.12/vboxvideo/vbox_main.c
VBoxGuestAdditions/src/vboxguest-6.0.13/vboxvideo/vbox_main.c
+--- VirtualBox-kmod-6.0.12/vboxvideo/vbox_main.c 2019-09-06 16:28:36.000000000 +0100
++++ VBoxGuestAdditions/vboxvideo/vbox_main.c 2019-09-14 05:16:27.959884375 +0100
+@@ -595,7 +596,7 @@ int vbox_dumb_destroy(struct drm_file *f
+ }
+ #endif
+
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && !defined(OPENSUSE_151)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0) && !defined(OPENSUSE_151)
&& !defined(RHEL_77) && !defined(RHEL_81)
+ static void ttm_bo_put(struct ttm_buffer_object *bo)
+ {
+ ttm_bo_unref(&bo);
+diff -up VirtualBox-kmod-6.0.12/vboxvideo/vbox_mode.c
VBoxGuestAdditions/src/vboxguest-6.0.13/vboxvideo/vbox_mode.c
+--- VirtualBox-kmod-6.0.12/vboxvideo/vbox_mode.c 2019-09-06 16:28:36.000000000 +0100
++++ VBoxGuestAdditions/vboxvideo/vbox_mode.c 2019-09-14 05:16:27.968884557 +0100
+@@ -37,7 +38,7 @@
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0) || defined(RHEL_72)
+ #include <drm/drm_plane_helper.h>
+ #endif
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) || defined(RHEL_81)
+ #include <drm/drm_probe_helper.h>
+ #endif
+
+@@ -493,7 +494,7 @@ 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) || defined(OPENSUSE_151)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || defined(OPENSUSE_151) ||
defined(RHEL_77) || defined(RHEL_81)
+ drm_connector_update_edid_property(connector, (struct edid *)edid);
+ #else
+ drm_mode_connector_update_edid_property(connector, (struct edid *)edid);
+@@ -664,7 +665,7 @@ static int vbox_connector_init(struct dr
+ drm_connector_register(connector);
+ #endif
+
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || defined(OPENSUSE_151)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) || defined(OPENSUSE_151) ||
defined(RHEL_77) || defined(RHEL_81)
+ drm_connector_attach_encoder(connector, encoder);
+ #else
+ drm_mode_connector_attach_encoder(connector, encoder);
+diff -up VirtualBox-kmod-6.0.12/vboxvideo/vbox_ttm.c
VBoxGuestAdditions/src/vboxguest-6.0.13/vboxvideo/vbox_ttm.c
+--- VirtualBox-kmod-6.0.12/vboxvideo/vbox_ttm.c 2019-09-06 16:28:36.000000000 +0100
++++ VBoxGuestAdditions/vboxvideo/vbox_ttm.c 2019-09-14 05:16:27.945884093 +0100
+@@ -41,7 +42,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)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) && !defined(RHEL_77)
&& !defined(RHEL_81)
+ static int vbox_ttm_mem_global_init(struct drm_global_reference *ref)
+ {
+ return ttm_mem_global_init(ref->object);
+@@ -292,13 +293,13 @@ 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)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) && !defined(RHEL_77)
&& !defined(RHEL_81)
+ 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)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) && !defined(RHEL_77)
&& !defined(RHEL_81)
+ vbox->ttm.bo_global_ref.ref.object,
+ #endif
+ &vbox_bo_driver,
+@@ -312,7 +313,7 @@ int vbox_mm_init(struct vbox_private *vb
+ #endif
+ if (ret) {
+ DRM_ERROR("Error initialising bo driver; %d\n", ret);
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) && !defined(RHEL_77)
&& !defined(RHEL_81)
+ goto err_ttm_global_release;
+ #else
+ return ret;
+@@ -338,7 +339,7 @@ int vbox_mm_init(struct vbox_private *vb
+
+ err_device_release:
+ ttm_bo_device_release(&vbox->ttm.bdev);
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) && !defined(RHEL_77)
&& !defined(RHEL_81)
+ err_ttm_global_release:
+ vbox_ttm_global_release(vbox);
+ #endif
+@@ -355,7 +356,7 @@ void vbox_mm_fini(struct vbox_private *v
+ arch_phys_wc_del(vbox->fb_mtrr);
+ #endif
+ ttm_bo_device_release(&vbox->ttm.bdev);
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0) && !defined(RHEL_77)
&& !defined(RHEL_81)
+ vbox_ttm_global_release(vbox);
+ #endif
+ }