| 1 | Index: trunk/src/VBox/Additions/linux/drm/vbox_drv.c
|
|---|
| 2 | ===================================================================
|
|---|
| 3 | --- trunk/src/VBox/Additions/linux/drm/vbox_drv.c (revision 140593)
|
|---|
| 4 | +++ trunk/src/VBox/Additions/linux/drm/vbox_drv.c (working copy)
|
|---|
| 5 | @@ -262,7 +262,12 @@
|
|---|
| 6 | .read = drm_read,
|
|---|
| 7 | };
|
|---|
| 8 |
|
|---|
| 9 | -static int vbox_master_set(struct drm_device *dev,
|
|---|
| 10 | +#if RTLNX_VER_MIN(5,9,0)
|
|---|
| 11 | +static void
|
|---|
| 12 | +#else
|
|---|
| 13 | +static int
|
|---|
| 14 | +#endif
|
|---|
| 15 | + vbox_master_set(struct drm_device *dev,
|
|---|
| 16 | struct drm_file *file_priv, bool from_open)
|
|---|
| 17 | {
|
|---|
| 18 | struct vbox_private *vbox = dev->dev_private;
|
|---|
| 19 | @@ -281,7 +286,9 @@
|
|---|
| 20 | schedule_delayed_work(&vbox->refresh_work, VBOX_REFRESH_PERIOD);
|
|---|
| 21 | mutex_unlock(&vbox->hw_mutex);
|
|---|
| 22 |
|
|---|
| 23 | +#if RTLNX_VER_MAX(5,9,0)
|
|---|
| 24 | return 0;
|
|---|
| 25 | +#endif
|
|---|
| 26 | }
|
|---|
| 27 |
|
|---|
| 28 | #if RTLNX_VER_MAX(4,8,0) && !RTLNX_RHEL_MAJ_PREREQ(7,4)
|
|---|
| 29 | Index: trunk/src/VBox/Additions/linux/drm/vbox_fb.c
|
|---|
| 30 | ===================================================================
|
|---|
| 31 | --- trunk/src/VBox/Additions/linux/drm/vbox_fb.c (revision 140593)
|
|---|
| 32 | +++ trunk/src/VBox/Additions/linux/drm/vbox_fb.c (working copy)
|
|---|
| 33 | @@ -405,7 +405,11 @@
|
|---|
| 34 | vbox_bo_unpin(bo);
|
|---|
| 35 | vbox_bo_unreserve(bo);
|
|---|
| 36 | }
|
|---|
| 37 | +#if RTLNX_VER_MIN(5,9,0)
|
|---|
| 38 | + drm_gem_object_put(afb->obj);
|
|---|
| 39 | +#else
|
|---|
| 40 | drm_gem_object_put_unlocked(afb->obj);
|
|---|
| 41 | +#endif
|
|---|
| 42 | afb->obj = NULL;
|
|---|
| 43 | }
|
|---|
| 44 | drm_fb_helper_fini(&fbdev->helper);
|
|---|
| 45 | Index: trunk/src/VBox/Additions/linux/drm/vbox_main.c
|
|---|
| 46 | ===================================================================
|
|---|
| 47 | --- trunk/src/VBox/Additions/linux/drm/vbox_main.c (revision 140593)
|
|---|
| 48 | +++ trunk/src/VBox/Additions/linux/drm/vbox_main.c (working copy)
|
|---|
| 49 | @@ -46,7 +46,11 @@
|
|---|
| 50 | struct vbox_framebuffer *vbox_fb = to_vbox_framebuffer(fb);
|
|---|
| 51 |
|
|---|
| 52 | if (vbox_fb->obj)
|
|---|
| 53 | +#if RTLNX_VER_MIN(5,9,0)
|
|---|
| 54 | + drm_gem_object_put(vbox_fb->obj);
|
|---|
| 55 | +#else
|
|---|
| 56 | drm_gem_object_put_unlocked(vbox_fb->obj);
|
|---|
| 57 | +#endif
|
|---|
| 58 |
|
|---|
| 59 | drm_framebuffer_cleanup(fb);
|
|---|
| 60 | kfree(fb);
|
|---|
| 61 | @@ -221,7 +225,11 @@
|
|---|
| 62 | err_free_vbox_fb:
|
|---|
| 63 | kfree(vbox_fb);
|
|---|
| 64 | err_unref_obj:
|
|---|
| 65 | +#if RTLNX_VER_MIN(5,9,0)
|
|---|
| 66 | + drm_gem_object_put(obj);
|
|---|
| 67 | +#else
|
|---|
| 68 | drm_gem_object_put_unlocked(obj);
|
|---|
| 69 | +#endif
|
|---|
| 70 | return ERR_PTR(ret);
|
|---|
| 71 | }
|
|---|
| 72 |
|
|---|
| 73 | @@ -588,7 +596,11 @@
|
|---|
| 74 | return ret;
|
|---|
| 75 |
|
|---|
| 76 | ret = drm_gem_handle_create(file, gobj, &handle);
|
|---|
| 77 | +#if RTLNX_VER_MIN(5,9,0)
|
|---|
| 78 | + drm_gem_object_put(gobj);
|
|---|
| 79 | +#else
|
|---|
| 80 | drm_gem_object_put_unlocked(gobj);
|
|---|
| 81 | +#endif
|
|---|
| 82 | if (ret)
|
|---|
| 83 | return ret;
|
|---|
| 84 |
|
|---|
| 85 | Index: trunk/src/VBox/Additions/linux/drm/vbox_mode.c
|
|---|
| 86 | ===================================================================
|
|---|
| 87 | --- trunk/src/VBox/Additions/linux/drm/vbox_mode.c (revision 140593)
|
|---|
| 88 | +++ trunk/src/VBox/Additions/linux/drm/vbox_mode.c (working copy)
|
|---|
| 89 | @@ -884,7 +884,11 @@
|
|---|
| 90 | out_unreserve_bo:
|
|---|
| 91 | vbox_bo_unreserve(bo);
|
|---|
| 92 | out_unref_obj:
|
|---|
| 93 | +#if RTLNX_VER_MIN(5,9,0)
|
|---|
| 94 | + drm_gem_object_put(obj);
|
|---|
| 95 | +#else
|
|---|
| 96 | drm_gem_object_put_unlocked(obj);
|
|---|
| 97 | +#endif
|
|---|
| 98 |
|
|---|
| 99 | return ret;
|
|---|
| 100 | }
|
|---|
| 101 | Index: trunk/src/VBox/Additions/linux/drm/vbox_ttm.c
|
|---|
| 102 | ===================================================================
|
|---|
| 103 | --- trunk/src/VBox/Additions/linux/drm/vbox_ttm.c (revision 140593)
|
|---|
| 104 | +++ trunk/src/VBox/Additions/linux/drm/vbox_ttm.c (working copy)
|
|---|
| 105 | @@ -445,7 +445,11 @@
|
|---|
| 106 |
|
|---|
| 107 | static inline u64 vbox_bo_gpu_offset(struct vbox_bo *bo)
|
|---|
| 108 | {
|
|---|
| 109 | +#if RTLNX_VER_MIN(5,9,0)
|
|---|
| 110 | + return bo->bo.mem.start << PAGE_SHIFT;
|
|---|
| 111 | +#else
|
|---|
| 112 | return bo->bo.offset;
|
|---|
| 113 | +#endif
|
|---|
| 114 | }
|
|---|
| 115 |
|
|---|
| 116 | int vbox_bo_pin(struct vbox_bo *bo, u32 pl_flag, u64 *gpu_addr)
|
|---|
| 117 | Index: trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c
|
|---|
| 118 | ===================================================================
|
|---|
| 119 | --- trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c (revision 140593)
|
|---|
| 120 | +++ trunk/src/VBox/Runtime/r0drv/linux/memobj-r0drv-linux.c (working copy)
|
|---|
| 121 | @@ -1181,7 +1181,9 @@
|
|---|
| 122 | */
|
|---|
| 123 | else
|
|---|
| 124 | rc = get_user_pages_remote(
|
|---|
| 125 | +# if GET_USER_PAGES_API < KERNEL_VERSION(5, 9, 0)
|
|---|
| 126 | pTask, /* Task for fault accounting. */
|
|---|
| 127 | +# endif
|
|---|
| 128 | pTask->mm, /* Whose pages. */
|
|---|
| 129 | R3Ptr, /* Where from. */
|
|---|
| 130 | cPages, /* How many pages. */
|
|---|
| 131 | Index: trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h
|
|---|
| 132 | ===================================================================
|
|---|
| 133 | --- trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h (revision 140593)
|
|---|
| 134 | +++ trunk/src/VBox/Runtime/r0drv/linux/the-linux-kernel.h (working copy)
|
|---|
| 135 | @@ -137,7 +137,11 @@
|
|---|
| 136 | #include <linux/interrupt.h>
|
|---|
| 137 | #include <linux/completion.h>
|
|---|
| 138 | #include <linux/compiler.h>
|
|---|
| 139 | -#ifndef HAVE_UNLOCKED_IOCTL /* linux/fs.h defines this */
|
|---|
| 140 | +/* linux/fs.h defines HAVE_UNLOCKED_IOCTL from 2.6.11 till 5.9, but its meaning remains valid */
|
|---|
| 141 | +#if RTLNX_VER_MIN(5,9,0)
|
|---|
| 142 | +# define HAVE_UNLOCKED_IOCTL 1
|
|---|
| 143 | +#endif
|
|---|
| 144 | +#if !defined(HAVE_UNLOCKED_IOCTL) && RTLNX_VER_MAX(2,6,38)
|
|---|
| 145 | # include <linux/smp_lock.h>
|
|---|
| 146 | #endif
|
|---|
| 147 | /* For the shared folders module */
|
|---|
| 148 | Index: trunk/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c
|
|---|
| 149 | ===================================================================
|
|---|
| 150 | --- trunk/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c (revision 140593)
|
|---|
| 151 | +++ trunk/src/VBox/Runtime/r0drv/linux/thread2-r0drv-linux.c (working copy)
|
|---|
| 152 | @@ -54,51 +54,44 @@
|
|---|
| 153 |
|
|---|
| 154 | DECLHIDDEN(int) rtThreadNativeSetPriority(PRTTHREADINT pThread, RTTHREADTYPE enmType)
|
|---|
| 155 | {
|
|---|
| 156 | -#if RTLNX_VER_MIN(2,6,11)
|
|---|
| 157 | - /* See comment near MAX_RT_PRIO in linux/sched.h for details on
|
|---|
| 158 | - sched_priority. */
|
|---|
| 159 | - int iSchedClass = SCHED_NORMAL;
|
|---|
| 160 | - struct sched_param Param = { .sched_priority = MAX_PRIO - 1 };
|
|---|
| 161 | + int iSchedClass = SCHED_FIFO;
|
|---|
| 162 | + int rc = VINF_SUCCESS;
|
|---|
| 163 | + struct sched_param Param = { 0 };
|
|---|
| 164 | +
|
|---|
| 165 | + RT_NOREF_PV(pThread);
|
|---|
| 166 | +#if RTLNX_VER_MIN(5,9,0)
|
|---|
| 167 | + RT_NOREF_PV(iSchedClass);
|
|---|
| 168 | + RT_NOREF_PV(Param);
|
|---|
| 169 | +#endif
|
|---|
| 170 | switch (enmType)
|
|---|
| 171 | {
|
|---|
| 172 | - case RTTHREADTYPE_INFREQUENT_POLLER:
|
|---|
| 173 | - Param.sched_priority = MAX_RT_PRIO + 5;
|
|---|
| 174 | - break;
|
|---|
| 175 | -
|
|---|
| 176 | - case RTTHREADTYPE_EMULATION:
|
|---|
| 177 | - Param.sched_priority = MAX_RT_PRIO + 4;
|
|---|
| 178 | - break;
|
|---|
| 179 | -
|
|---|
| 180 | - case RTTHREADTYPE_DEFAULT:
|
|---|
| 181 | - Param.sched_priority = MAX_RT_PRIO + 3;
|
|---|
| 182 | - break;
|
|---|
| 183 | -
|
|---|
| 184 | - case RTTHREADTYPE_MSG_PUMP:
|
|---|
| 185 | - Param.sched_priority = MAX_RT_PRIO + 2;
|
|---|
| 186 | - break;
|
|---|
| 187 | -
|
|---|
| 188 | case RTTHREADTYPE_IO:
|
|---|
| 189 | - iSchedClass = SCHED_FIFO;
|
|---|
| 190 | +#if RTLNX_VER_MAX(5,9,0)
|
|---|
| 191 | + /* Set max. priority to preempt all other threads on this CPU. */
|
|---|
| 192 | Param.sched_priority = MAX_RT_PRIO - 1;
|
|---|
| 193 | +#else
|
|---|
| 194 | + /* Effectively changes prio to 50 */
|
|---|
| 195 | + sched_set_fifo(current);
|
|---|
| 196 | +#endif
|
|---|
| 197 | break;
|
|---|
| 198 | -
|
|---|
| 199 | case RTTHREADTYPE_TIMER:
|
|---|
| 200 | - iSchedClass = SCHED_FIFO;
|
|---|
| 201 | +#if RTLNX_VER_MAX(5,9,0)
|
|---|
| 202 | Param.sched_priority = 1; /* not 0 just in case */
|
|---|
| 203 | +#else
|
|---|
| 204 | + /* Just one above SCHED_NORMAL class */
|
|---|
| 205 | + sched_set_fifo_low(current);
|
|---|
| 206 | +#endif
|
|---|
| 207 | break;
|
|---|
| 208 | -
|
|---|
| 209 | default:
|
|---|
| 210 | - AssertMsgFailed(("enmType=%d\n", enmType));
|
|---|
| 211 | - return VERR_INVALID_PARAMETER;
|
|---|
| 212 | + /* pretend success instead of VERR_NOT_SUPPORTED */
|
|---|
| 213 | + return rc;
|
|---|
| 214 | + }
|
|---|
| 215 | +#if RTLNX_VER_MAX(5,9,0)
|
|---|
| 216 | + if ((sched_setscheduler(current, iSchedClass, &Param)) != 0) {
|
|---|
| 217 | + rc = VERR_GENERAL_FAILURE;
|
|---|
| 218 | }
|
|---|
| 219 | -
|
|---|
| 220 | - sched_setscheduler(current, iSchedClass, &Param);
|
|---|
| 221 | -#else
|
|---|
| 222 | - RT_NOREF_PV(enmType);
|
|---|
| 223 | #endif
|
|---|
| 224 | - RT_NOREF_PV(pThread);
|
|---|
| 225 | -
|
|---|
| 226 | - return VINF_SUCCESS;
|
|---|
| 227 | + return rc;
|
|---|
| 228 | }
|
|---|
| 229 |
|
|---|
| 230 |
|
|---|