Link Here
|
1 |
--- src/nvidia-modeset/nvidia-modeset-freebsd.c.orig 2018-08-21 23:09:28 UTC |
1 |
--- src/nvidia-modeset/nvidia-modeset-freebsd.c.orig 2020-09-23 00:54:46 UTC |
2 |
+++ src/nvidia-modeset/nvidia-modeset-freebsd.c |
2 |
+++ src/nvidia-modeset/nvidia-modeset-freebsd.c |
3 |
@@ -25,6 +25,7 @@ |
3 |
@@ -26,6 +26,7 @@ |
4 |
#include <sys/poll.h> |
|
|
5 |
#include <sys/file.h> |
4 |
#include <sys/file.h> |
6 |
#include <sys/proc.h> |
5 |
#include <sys/proc.h> |
|
|
6 |
#include <sys/stack.h> |
7 |
+#include <sys/sysproto.h> |
7 |
+#include <sys/sysproto.h> |
8 |
|
8 |
|
9 |
#include "nvkms-ioctl.h" |
9 |
#include "nvkms-ioctl.h" |
10 |
#include "nvidia-modeset-os-interface.h" |
10 |
#include "nvidia-modeset-os-interface.h" |
11 |
@@ -48,6 +49,7 @@ |
11 |
@@ -51,6 +52,7 @@ |
12 |
#include "machine/../linux32/linux32_proto.h" |
12 |
#include "machine/../linux32/linux32_proto.h" |
13 |
#endif |
13 |
#endif |
14 |
#include <compat/linux/linux_ioctl.h> |
14 |
#include <compat/linux/linux_ioctl.h> |
Link Here
|
16 |
#endif |
16 |
#endif |
17 |
|
17 |
|
18 |
|
18 |
|
19 |
@@ -250,7 +252,7 @@ struct nvkms_ref_ptr { |
19 |
@@ -276,7 +278,7 @@ struct nvkms_ref_ptr { |
20 |
|
20 |
|
21 |
struct nvkms_ref_ptr* NVKMS_API_CALL nvkms_alloc_ref_ptr(void *ptr) |
21 |
struct nvkms_ref_ptr* NVKMS_API_CALL nvkms_alloc_ref_ptr(void *ptr) |
22 |
{ |
22 |
{ |
Link Here
|
25 |
if (ref_ptr) { |
25 |
if (ref_ptr) { |
26 |
mtx_init(&ref_ptr->lock, "nvkms-ref-ptr-lock", NULL, MTX_SPIN); |
26 |
mtx_init(&ref_ptr->lock, "nvkms-ref-ptr-lock", NULL, MTX_SPIN); |
27 |
// The ref_ptr owner counts as a reference on the ref_ptr itself. |
27 |
// The ref_ptr owner counts as a reference on the ref_ptr itself. |
28 |
@@ -867,33 +869,31 @@ static int nvkms_poll( |
28 |
@@ -894,29 +896,31 @@ static int nvkms_poll( |
29 |
*************************************************************************/ |
29 |
*************************************************************************/ |
30 |
|
30 |
|
31 |
#if defined(NVKMS_SUPPORT_LINUX_COMPAT) |
31 |
#if defined(NVKMS_SUPPORT_LINUX_COMPAT) |
Link Here
|
49 |
- u_long cmd; |
49 |
- u_long cmd; |
50 |
+ static const uint32_t dir[4] = { IOC_VOID, IOC_IN, IOC_OUT, IOC_INOUT }; |
50 |
+ static const uint32_t dir[4] = { IOC_VOID, IOC_IN, IOC_OUT, IOC_INOUT }; |
51 |
|
51 |
|
52 |
-#if NV_FGET_HAS_CAP_RIGHTS_T_ARG |
|
|
53 |
- cap_rights_t rights; |
52 |
- cap_rights_t rights; |
54 |
- status = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), &fp); |
53 |
- status = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), &fp); |
55 |
-#else |
|
|
56 |
- status = fget(td, args->fd, &fp); |
57 |
-#endif |
58 |
- |
54 |
- |
59 |
- if (status != 0) { |
55 |
- if (status != 0) { |
60 |
- return status; |
56 |
- return status; |
Link Here
|
76 |
} |
72 |
} |
77 |
|
73 |
|
78 |
#define NVKMS_LINUX_IOCTL_MIN _IOC(0, NVKMS_IOCTL_MAGIC, NVKMS_IOCTL_CMD, 0) |
74 |
#define NVKMS_LINUX_IOCTL_MIN _IOC(0, NVKMS_IOCTL_MAGIC, NVKMS_IOCTL_CMD, 0) |
79 |
@@ -909,6 +909,7 @@ static struct linux_ioctl_handler nvkms_linux_ioctl_ha |
75 |
@@ -930,6 +930,7 @@ static struct linux_ioctl_handler nvkms_linux_ioctl_ha |
80 |
static void nvkms_linux_compat_load(void) |
76 |
static void nvkms_linux_compat_load(void) |
81 |
{ |
77 |
{ |
82 |
#if defined(NVKMS_SUPPORT_LINUX_COMPAT) |
78 |
#if defined(NVKMS_SUPPORT_LINUX_COMPAT) |
Link Here
|
84 |
linux_ioctl_register_handler(&nvkms_linux_ioctl_handler); |
80 |
linux_ioctl_register_handler(&nvkms_linux_ioctl_handler); |
85 |
#endif |
81 |
#endif |
86 |
} |
82 |
} |
87 |
@@ -917,6 +918,7 @@ static void nvkms_linux_compat_unload(void) |
83 |
@@ -940,6 +941,7 @@ static void nvkms_linux_compat_unload(void) |
88 |
{ |
84 |
{ |
89 |
#if defined(NVKMS_SUPPORT_LINUX_COMPAT) |
85 |
#if defined(NVKMS_SUPPORT_LINUX_COMPAT) |
90 |
linux_ioctl_unregister_handler(&nvkms_linux_ioctl_handler); |
86 |
linux_ioctl_unregister_handler(&nvkms_linux_ioctl_handler); |
Link Here
|
92 |
#endif |
88 |
#endif |
93 |
} |
89 |
} |
94 |
|
90 |
|
95 |
@@ -1100,4 +1102,9 @@ MODULE_DEPEND(nvidia_modeset, /* module |
91 |
@@ -1121,4 +1131,9 @@ MODULE_DEPEND(nvidia_modeset, /* module |
96 |
MODULE_DEPEND(nvidia_modeset, /* module name */ |
92 |
MODULE_DEPEND(nvidia_modeset, /* module name */ |
97 |
linux, /* prerequisite module */ |
93 |
linux, /* prerequisite module */ |
98 |
1, 1, 1); /* vmin, vpref, vmax */ |
94 |
1, 1, 1); /* vmin, vpref, vmax */ |