FreeBSD Bugzilla – Attachment 218141 Details for
Bug 249505
[patch]x11/nvidia-driver and x11/linux-nvidia-libs: Update to latest 460.32.03
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for x11/nvidia-driver
nvidia-driver-450.66.diff (text/plain), 9.11 KB, created by
Tomoaki AOKI
on 2020-09-21 11:22:58 UTC
(
hide
)
Description:
Patch for x11/nvidia-driver
Filename:
MIME Type:
Creator:
Tomoaki AOKI
Created:
2020-09-21 11:22:58 UTC
Size:
9.11 KB
patch
obsolete
>Modified: x11/nvidia-driver/Makefile >============================================================================== >--- x11/nvidia-driver/Makefile.orig 2020-06-30 18:29:23.486227000 +0900 >+++ x11/nvidia-driver/Makefile 2020-09-19 22:45:36.692631000 +0900 >@@ -11,7 +11,7 @@ > # or `x11/nvidia-driver-304'). > > PORTNAME= nvidia-driver >-DISTVERSION?= 440.100 >+DISTVERSION?= 450.66 > # Always try to set PORTREVISION as it can be overridden by the slave ports > PORTREVISION?= 0 > CATEGORIES= x11 >@@ -44,13 +44,23 @@ SUB_FILES= pkg-message nvidia.conf > .if ${NVVERSION} < 410.057 > SUB_FILES+= pkg-deinstall pkg-install > .endif >+.if ${NVVERSION} >= 450.057 > SUB_PATCHES= extra-patch-src-Makefile \ > extra-patch-src-nv-freebsd.h \ > extra-patch-src-nv-misc.h \ >+ extra-patch-450-src-nvidia_ctl.c \ >+ extra-patch-src-nvidia_dev.c \ >+ extra-patch-src-nvidia_linux.c \ >+ extra-patch-src-nvidia_pci.c >+.else >+SUB_PATCHES= extra-patch-src-Makefile \ >+ extra-patch-src-nv-freebsd.h \ >+ extra-patch-src-nv-misc.h \ > extra-patch-src-nvidia_ctl.c \ > extra-patch-src-nvidia_dev.c \ > extra-patch-src-nvidia_linux.c \ > extra-patch-src-nvidia_pci.c >+.endif > DOCSDIR= ${PREFIX}/share/doc/NVIDIA_GLX-1.0 > MODULESDIR= lib/xorg/modules > PORTDOCS= * >@@ -67,7 +77,9 @@ NVSRC= . > NVSRC= nvidia > .endif > >-.if ${NVVERSION} >= 358.009 >+.if ${NVVERSION} >= 450.057 >+EXTRA_PATCHES+= ${FILESDIR}/extra-patch-450-src_nvidia-modeset_nvidia-modeset-freebsd.c >+.else if ${NVVERSION} >= 358.009 > # Initialize memory allocations to avoid spurious "lock re-initialization" > # errors. A little more detail can be found in bug 201340 starting around > # comment #50. >Modified: x11/nvidia-driver/distinfo >============================================================================== >--- x11/nvidia-driver/distinfo.orig 2020-06-30 18:29:23.423968000 +0900 >+++ x11/nvidia-driver/distinfo 2020-09-19 22:56:33.690534000 +0900 >@@ -1,6 +1,6 @@ > TIMESTAMP = 1482026038 >-SHA256 (NVIDIA-FreeBSD-x86_64-440.100.tar.gz) = da5abe605560890405976785eb28e6d9fa79181ac7d158e52e5327d4d0faef5f >-SIZE (NVIDIA-FreeBSD-x86_64-440.100.tar.gz) = 82523267 >+SHA256 (NVIDIA-FreeBSD-x86_64-450.66.tar.gz) = 8c8ccfc2c9e2e888f3342a9b520ef95b483a1d2f01587d02c2014ffab01d3abb >+SIZE (NVIDIA-FreeBSD-x86_64-450.66.tar.gz) = 82963662 > SHA256 (NVIDIA-FreeBSD-x86_64-390.138.tar.gz) = 51cb38cd826ba34c1cc71db5bd3ef645b4cfb5647311e255b4631e5c41d0ba07 > SIZE (NVIDIA-FreeBSD-x86_64-390.138.tar.gz) = 65280213 > SHA256 (NVIDIA-FreeBSD-x86-390.138.tar.gz) = ca06e877af81e2e895a92fc9ec6f5bc106a48a0223912992d5cb0f482c9dac9a >Added: x11/nvidia-driver/files/extra-patch-450-src_nvidia-modeset_nvidia-modeset-freebsd.c >============================================================================== >--- /dev/null 00:00:00 1970 (empty, because file is newly added) >+++ x11/nvidia-driver/files/extra-patch-450-src_nvidia-modeset_nvidia-modeset-freebsd.c 2020-08-04 07:51:36.692631000 +0900 >@@ -0,0 +1,104 @@ >+--- src/nvidia-modeset/nvidia-modeset-freebsd.c.orig 2018-08-21 23:09:28 UTC >++++ src/nvidia-modeset/nvidia-modeset-freebsd.c >+@@ -26,6 +26,7 @@ >+ #include <sys/file.h> >+ #include <sys/proc.h> >+ #include <sys/stack.h> >++#include <sys/sysproto.h> >+ >+ #include "nvkms-ioctl.h" >+ #include "nvidia-modeset-os-interface.h" >+@@ -48,6 +49,7 @@ >+ #include "machine/../linux32/linux32_proto.h" >+ #endif >+ #include <compat/linux/linux_ioctl.h> >++ #include <compat/linux/linux_util.h> >+ #endif >+ >+ >+@@ -250,7 +252,7 @@ struct nvkms_ref_ptr { >+ >+ struct nvkms_ref_ptr* NVKMS_API_CALL nvkms_alloc_ref_ptr(void *ptr) >+ { >+- struct nvkms_ref_ptr *ref_ptr = nvkms_alloc(sizeof(*ref_ptr), NV_FALSE); >++ struct nvkms_ref_ptr *ref_ptr = nvkms_alloc(sizeof(*ref_ptr), NV_TRUE); >+ if (ref_ptr) { >+ mtx_init(&ref_ptr->lock, "nvkms-ref-ptr-lock", NULL, MTX_SPIN); >+ // The ref_ptr owner counts as a reference on the ref_ptr itself. >+@@ -867,33 +869,31 @@ static int nvkms_poll( >+ *************************************************************************/ >+ >+ #if defined(NVKMS_SUPPORT_LINUX_COMPAT) >++static struct linux_device_handler nvkms_linux_device_handler = { >++ .bsd_driver_name = "nvidia-modeset", >++ .linux_driver_name = "nvidia-modeset", >++ .bsd_device_name = "nvidia-modeset", >++ .linux_device_name = "nvidia-modeset", >++ .linux_major = 195, >++ .linux_minor = 254, >++ .linux_char_device = 1 >++}; >+ >+ static int nvkms_linux_ioctl_function( >+ struct thread *td, >+ struct linux_ioctl_args *args >+ ) >+ { >+- struct file *fp; >+- int status; >+- u_long cmd; >++ static const uint32_t dir[4] = { IOC_VOID, IOC_IN, IOC_OUT, IOC_INOUT }; >+ >+-#if NV_FGET_HAS_CAP_RIGHTS_T_ARG >+- cap_rights_t rights; >+- status = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), &fp); >+-#else >+- status = fget(td, args->fd, &fp); >+-#endif >+- >+- if (status != 0) { >+- return status; >++ if ((args->cmd & (1<<29)) != 0) { >++ /* FreeBSD has only 13 bits to encode the size. */ >++ printf("nvidia: pid %d (%s): ioctl cmd=0x%x size too large\n", >++ (int)td->td_proc->p_pid, td->td_proc->p_comm, args->cmd); >++ return (EINVAL); >+ } >+- >+- cmd = args->cmd; >+- >+- status = fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td); >+- fdrop(fp, td); >+- >+- return status; >++ args->cmd = (args->cmd & ~IOC_DIRMASK) | dir[args->cmd >> 30]; >++ return (sys_ioctl(td, (struct ioctl_args *)args)); >+ } >+ >+ #define NVKMS_LINUX_IOCTL_MIN _IOC(0, NVKMS_IOCTL_MAGIC, NVKMS_IOCTL_CMD, 0) >+@@ -909,6 +909,7 @@ static struct linux_ioctl_handler nvkms_linux_ioctl_ha >+ static void nvkms_linux_compat_load(void) >+ { >+ #if defined(NVKMS_SUPPORT_LINUX_COMPAT) >++ linux_device_register_handler(&nvkms_linux_device_handler); >+ linux_ioctl_register_handler(&nvkms_linux_ioctl_handler); >+ #endif >+ } >+@@ -917,6 +918,7 @@ static void nvkms_linux_compat_unload(void) >+ { >+ #if defined(NVKMS_SUPPORT_LINUX_COMPAT) >+ linux_ioctl_unregister_handler(&nvkms_linux_ioctl_handler); >++ linux_device_unregister_handler(&nvkms_linux_device_handler); >+ #endif >+ } >+ >+@@ -1100,4 +1102,9 @@ MODULE_DEPEND(nvidia_modeset, /* module >+ MODULE_DEPEND(nvidia_modeset, /* module name */ >+ linux, /* prerequisite module */ >+ 1, 1, 1); /* vmin, vpref, vmax */ >++#if defined(NVCPU_X86_64) >++MODULE_DEPEND(nvidia_modeset, /* module name */ >++ linux_common, /* prerequisite module */ >++ 1, 1, 1); /* vmin, vpref, vmax */ >++#endif >+ #endif >Added: x11/nvidia-driver/files/extra-patch-450-src-nvidia_ctl.c.in >============================================================================== >--- /dev/null 00:00:00 1970 (empty, because file is newly added) >+++ x11/nvidia-driver/files/extra-patch-450-src-nvidia_ctl.c.in 2020-08-04 07:51:36.692631000 +0900 >@@ -0,0 +1,72 @@ >+--- src/%%NVSRC%%/nvidia_ctl.c.orig 2017-09-14 20:46:30 UTC >++++ src/%%NVSRC%%/nvidia_ctl.c >+@@ -13,6 +13,12 @@ >+ #include "nv.h" >+ #include "nv-freebsd.h" >+ >++#ifdef NV_SUPPORT_LINUX_COMPAT /* (COMPAT_LINUX || COMPAT_LINUX32) */ >++#include <compat/linux/linux_util.h> >++ >++const char nvidia_driver_name[] = "nvidia"; >++#endif >++ >+ static d_open_t nvidia_ctl_open; >+ static void nvidia_ctl_dtor(void *arg); >+ static d_ioctl_t nvidia_ctl_ioctl; >+@@ -138,6 +144,18 @@ static int nvidia_ctl_poll( >+ >+ int nvidia_ctl_attach(void) >+ { >++#ifdef NV_SUPPORT_LINUX_COMPAT >++ struct linux_device_handler nvidia_ctl_linux_handler = { >++ .bsd_driver_name = __DECONST(char *, nvidia_driver_name), >++ .linux_driver_name = __DECONST(char *, nvidia_driver_name), >++ .bsd_device_name = __DECONST(char *, nvidia_ctl_cdevsw.d_name), >++ .linux_device_name = __DECONST(char *, nvidia_ctl_cdevsw.d_name), >++ .linux_major = NV_MAJOR_DEVICE_NUMBER, >++ .linux_minor = 255, >++ .linux_char_device = 1 >++ }; >++#endif >++ >+ if (nvidia_count == 0) { >+ nvidia_ctl_cdev = make_dev(&nvidia_ctl_cdevsw, >+ CDEV_CTL_MINOR, >+@@ -145,6 +163,10 @@ int nvidia_ctl_attach(void) >+ "%s", nvidia_ctl_cdevsw.d_name); >+ if (nvidia_ctl_cdev == NULL) >+ return ENOMEM; >++ >++#ifdef NV_SUPPORT_LINUX_COMPAT >++ (void)linux_device_register_handler(&nvidia_ctl_linux_handler); >++#endif >+ } >+ >+ nvidia_count++; >+@@ -153,10 +175,25 @@ int nvidia_ctl_attach(void) >+ >+ int nvidia_ctl_detach(void) >+ { >++#ifdef NV_SUPPORT_LINUX_COMPAT >++ struct linux_device_handler nvidia_ctl_linux_handler = { >++ .bsd_driver_name = __DECONST(char *, nvidia_driver_name), >++ .linux_driver_name = __DECONST(char *, nvidia_driver_name), >++ .bsd_device_name = __DECONST(char *, nvidia_ctl_cdevsw.d_name), >++ .linux_device_name = __DECONST(char *, nvidia_ctl_cdevsw.d_name), >++ .linux_major = NV_MAJOR_DEVICE_NUMBER, >++ .linux_minor = 255, >++ .linux_char_device = 1 >++ }; >++#endif >+ nvidia_count--; >+ >+- if (nvidia_count == 0) >++ if (nvidia_count == 0) { >++#ifdef NV_SUPPORT_LINUX_COMPAT >++ (void)linux_device_unregister_handler(&nvidia_ctl_linux_handler); >++#endif >+ destroy_dev(nvidia_ctl_cdev); >++ } >+ >+ return 0; >+ }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 249505
:
218141
|
218142
|
218162
|
220379
|
220380
|
221657
|
221933
|
222183