46 lines
1.1 KiB
Diff
46 lines
1.1 KiB
Diff
|
--- kernel/os-interface.c 2019-03-05 22:53:13.298064826 +0100
|
||
|
+++ kernel/os-interface.c 2019-03-05 23:04:09.064902532 +0100
|
||
|
@@ -14,6 +14,19 @@
|
||
|
#include "os-interface.h"
|
||
|
#include "nv-linux.h"
|
||
|
|
||
|
+#include <linux/version.h>
|
||
|
+
|
||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
|
||
|
+static inline void do_gettimeofday(struct timeval *tv) {
|
||
|
+ struct timespec64 now;
|
||
|
+
|
||
|
+ ktime_get_real_ts64(&now);
|
||
|
+ tv->tv_sec = now.tv_sec;
|
||
|
+ tv->tv_usec = now.tv_nsec/1000;
|
||
|
+}
|
||
|
+#endif
|
||
|
+
|
||
|
+
|
||
|
RM_STATUS NV_API_CALL os_disable_console_access(void)
|
||
|
{
|
||
|
NV_ACQUIRE_CONSOLE_SEM();
|
||
|
--- kernel/nv-drm.c 2019-03-05 22:37:07.015611635 +0100
|
||
|
+++ kernel/nv-drm.c 2019-03-05 22:54:46.448761250 +0100
|
||
|
@@ -13,6 +13,7 @@
|
||
|
#include "nv-misc.h"
|
||
|
#include "os-interface.h"
|
||
|
#include "nv-linux.h"
|
||
|
+#include <linux/version.h>
|
||
|
|
||
|
#if defined(NV_DRM_AVAILABLE)
|
||
|
|
||
|
@@ -251,8 +252,11 @@
|
||
|
status = RM_ERR_OPERATING_SYSTEM;
|
||
|
goto done;
|
||
|
}
|
||
|
-
|
||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
|
||
|
drm_gem_object_unreference_unlocked(&nv_obj->base);
|
||
|
+#else
|
||
|
+ drm_gem_object_put_unlocked(&nv_obj->base);
|
||
|
+#endif
|
||
|
|
||
|
status = RM_OK;
|
||
|
|