summaryrefslogtreecommitdiffstats
path: root/debian/patches/fix-vboxvideo-with-linux-5.0.patch
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:54 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 03:01:54 +0000
commit0494175483c2d82f445ddca9cadb6ee6338e9f9c (patch)
tree336364dc245983722e34439ece449564e77ca286 /debian/patches/fix-vboxvideo-with-linux-5.0.patch
parentAdding upstream version 6.0.4-dfsg. (diff)
downloadvirtualbox-0494175483c2d82f445ddca9cadb6ee6338e9f9c.tar.xz
virtualbox-0494175483c2d82f445ddca9cadb6ee6338e9f9c.zip
Adding debian version 6.0.4-dfsg-7.debian/6.0.4-dfsg-7debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/fix-vboxvideo-with-linux-5.0.patch')
-rw-r--r--debian/patches/fix-vboxvideo-with-linux-5.0.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/debian/patches/fix-vboxvideo-with-linux-5.0.patch b/debian/patches/fix-vboxvideo-with-linux-5.0.patch
new file mode 100644
index 00000000..e3cbec4f
--- /dev/null
+++ b/debian/patches/fix-vboxvideo-with-linux-5.0.patch
@@ -0,0 +1,80 @@
+Origin: Ubuntu
+Index: virtualbox-6.0.4-dfsg/src/VBox/Additions/linux/drm/vbox_drv.h
+===================================================================
+--- virtualbox-6.0.4-dfsg.orig/src/VBox/Additions/linux/drm/vbox_drv.h
++++ virtualbox-6.0.4-dfsg/src/VBox/Additions/linux/drm/vbox_drv.h
+@@ -114,6 +114,11 @@ static inline void drm_gem_object_put_un
+ {
+ drm_gem_object_unreference_unlocked(obj);
+ }
++
++static inline void drm_gem_object_put(struct drm_gem_object *obj)
++{
++ drm_gem_object_unreference(obj);
++}
+ #endif
+
+ #define DRIVER_AUTHOR VBOX_VENDOR
+@@ -174,8 +179,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-6.0.4-dfsg/src/VBox/Additions/linux/drm/vbox_main.c
+===================================================================
+--- virtualbox-6.0.4-dfsg.orig/src/VBox/Additions/linux/drm/vbox_main.c
++++ virtualbox-6.0.4-dfsg/src/VBox/Additions/linux/drm/vbox_main.c
+@@ -652,7 +652,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-6.0.4-dfsg/src/VBox/Additions/linux/drm/vbox_ttm.c
+===================================================================
+--- virtualbox-6.0.4-dfsg.orig/src/VBox/Additions/linux/drm/vbox_ttm.c
++++ virtualbox-6.0.4-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);
+@@ -100,6 +101,16 @@ static void vbox_ttm_global_release(stru
+ drm_global_item_unref(&vbox->ttm.bo_global_ref.ref);
+ drm_global_item_unref(&vbox->ttm.mem_global_ref);
+ }
++#else
++static inline int vbox_ttm_global_init(struct vbox_private *vbox)
++{
++ return 0;
++}
++
++static inline void vbox_ttm_global_release(struct vbox_private *vbox)
++{
++}
++#endif
+
+ static void vbox_bo_ttm_destroy(struct ttm_buffer_object *tbo)
+ {
+@@ -292,7 +303,9 @@ int vbox_mm_init(struct vbox_private *vb
+ return ret;
+
+ 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_71)
+ dev->anon_inode->i_mapping,