Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] nvidia470: update to 470.256.02.
@ 2025-01-16 18:58 abenson
  2025-01-17 14:11 ` [PR PATCH] [Updated] " abenson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: abenson @ 2025-01-16 18:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 488 bytes --]

There is a new pull request by abenson against master on the void-packages repository

https://github.com/void-linux/void-packages nvidia470_470.256.02
https://github.com/void-linux/void-packages/pull/53996

nvidia470: update to 470.256.02.

#### Testing the changes
- I tested the changes in this PR: **NO**

#### Local build testing
- I built this PR locally for my native architecture, x86_64


A patch file from https://github.com/void-linux/void-packages/pull/53996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nvidia470_470.256.02-53996.patch --]
[-- Type: text/x-diff, Size: 1251 bytes --]

From 8155b1cf915699e6f28a25e897fd059476f8bfc2 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Thu, 16 Jan 2025 12:58:48 -0600
Subject: [PATCH] nvidia470: update to 470.256.02.

---
 srcpkgs/nvidia470/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/nvidia470/template b/srcpkgs/nvidia470/template
index b9fdb1168bbf62..6faa6f3c8eb61f 100644
--- a/srcpkgs/nvidia470/template
+++ b/srcpkgs/nvidia470/template
@@ -3,7 +3,7 @@
 _desc="NVIDIA drivers (GKxxx “Kepler”)"
 
 pkgname=nvidia470
-version=470.239.06
+version=470.256.02
 revision=1
 maintainer="Andrew Benson <abenson+void@gmail.com>"
 license="custom:NVIDIA Proprietary"
@@ -19,7 +19,7 @@ conflicts="xserver-abi-video>25_1 nvidia390>=0"
 
 _pkg="NVIDIA-Linux-x86_64-${version}"
 distfiles="http://uk.download.nvidia.com/XFree86/Linux-x86_64/${version}/${_pkg}.run"
-checksum=7d74caac140a0432d79ebe8e4330dc796f39ba7dd40b3fcd61df760181bf9ccc
+checksum=d6451862deb695bb0447f3b7cd6268f73e81168c10e2c10597ff3fa01349b1de
 # subpackages need to be processed in this specific order
 subpackages="nvidia470-gtklibs nvidia470-dkms nvidia470-opencl nvidia470-libs nvidia470-libs-32bit"
 depends="nvidia470-libs-${version}_${revision}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] nvidia470: update to 470.256.02.
  2025-01-16 18:58 [PR PATCH] nvidia470: update to 470.256.02 abenson
@ 2025-01-17 14:11 ` abenson
  2025-01-19  3:15 ` abenson
  2025-01-19 20:51 ` [PR PATCH] [Merged]: " abenson
  2 siblings, 0 replies; 4+ messages in thread
From: abenson @ 2025-01-17 14:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

There is an updated pull request by abenson against master on the void-packages repository

https://github.com/void-linux/void-packages nvidia470_470.256.02
https://github.com/void-linux/void-packages/pull/53996

nvidia470: update to 470.256.02.

#### Testing the changes
- I tested the changes in this PR: **NO**

#### Local build testing
- I built this PR locally for my native architecture, x86_64


A patch file from https://github.com/void-linux/void-packages/pull/53996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nvidia470_470.256.02-53996.patch --]
[-- Type: text/x-diff, Size: 5575 bytes --]

From df4e1e0a8ee5cb4a7e3abff0fa2941d51f5ffa6a Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Thu, 16 Jan 2025 12:58:48 -0600
Subject: [PATCH] nvidia470: update to 470.256.02.

---
 srcpkgs/nvidia470/patches/kernel-6.12.patch | 111 ++++++++++++++++++++
 srcpkgs/nvidia470/template                  |   4 +-
 2 files changed, 113 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/nvidia470/patches/kernel-6.12.patch

diff --git a/srcpkgs/nvidia470/patches/kernel-6.12.patch b/srcpkgs/nvidia470/patches/kernel-6.12.patch
new file mode 100644
index 00000000000000..d4e4093031ded9
--- /dev/null
+++ b/srcpkgs/nvidia470/patches/kernel-6.12.patch
@@ -0,0 +1,111 @@
+From 839b964bd5be20275a4d1add020e68e407380adb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
+Date: Sat, 17 Aug 2024 14:26:04 +0000
+Subject: [PATCH] Tentative fix for NVIDIA 470.256.02 driver for Linux 6.12-rc1
+
+Note that the fix requires enabling DRM kernel mode setting
+(add the `nvidia-drm.modeset=1` parameter to the kernel command line).
+
+(Thanks xtexChooser for the memory management fixes!)
+---
+ nvidia-drm/nvidia-drm-drv.c | 47 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 47 insertions(+)
+
+diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
+index f350134..d6233a5 100644
+--- a/kernel/nvidia-drm/nvidia-drm-drv.c
++++ b/kernel/nvidia-drm/nvidia-drm-drv.c
+@@ -84,6 +84,11 @@
+ #include <drm/drm_atomic_helper.h>
+ #endif
+ 
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++#include <drm/drm_client.h>
++#endif
++
+ static struct nv_drm_device *dev_list = NULL;
+ 
+ #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
+@@ -168,7 +173,12 @@ static const struct drm_mode_config_funcs nv_mode_config_funcs = {
+     .atomic_check  = nv_drm_atomic_check,
+     .atomic_commit = nv_drm_atomic_commit,
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
++    // Rel. commit. "drm: Remove struct drm_mode_config_funcs.output_poll_changed" (Thomas Zimmermann, 12 Aug 2024)
++    // Replace this callback with a DRM client's hotplug callback.
++    // This is required for e.g. /sys/class/drm/card*/modes to work.
+     .output_poll_changed = nv_drm_output_poll_changed,
++#endif
+ };
+ 
+ static void nv_drm_event_callback(const struct NvKmsKapiEvent *event)
+@@ -739,6 +749,10 @@ static const struct file_operations nv_drm_fops = {
+     .read           = drm_read,
+ 
+     .llseek         = noop_llseek,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++    // Rel. commit. "fs: move FMODE_UNSIGNED_OFFSET to fop_flags" (Christian Brauner, 9 Aug 2024)
++    .fop_flags      = FOP_UNSIGNED_OFFSET,
++#endif
+ };
+ 
+ static const struct drm_ioctl_desc nv_drm_ioctls[] = {
+@@ -906,7 +920,18 @@ static void nv_drm_update_drm_driver_features(void)
+ #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
+ }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++static int hotplug_helper_client_hotplug(struct drm_client_dev *client)
++{
++    nv_drm_output_poll_changed(client->dev);
++    return 0;
++}
+ 
++static const struct drm_client_funcs nv_hotplug_helper_client_funcs = {
++    .owner      = THIS_MODULE,
++    .hotplug    = hotplug_helper_client_hotplug,
++};
++#endif
+ 
+ /*
+  * Helper function for allocate/register DRM device for given NVIDIA GPU ID.
+@@ -962,6 +987,20 @@ static void nv_drm_register_drm_device(const nv_gpu_info_t *gpu_info)
+         goto failed_drm_register;
+     }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++    /* Register a DRM client for receiving hotplug events */
++    struct drm_client_dev *client = kzalloc(sizeof(*client), GFP_KERNEL);
++    if (client == NULL || drm_client_init(dev, client,
++        "nv-hotplug-helper", &nv_hotplug_helper_client_funcs)) {
++        printk(KERN_WARNING "Failed to initialize the nv-hotplug-helper DRM client"
++            " (ensure DRM kernel mode setting is enabled via nvidia-drm.modeset=1).\n");
++        goto failed_drm_client_init;
++    }
++
++    drm_client_register(client);
++    pr_info("Registered the nv-hotplug-helper DRM client.\n");
++#endif
++
+     /* Add NVIDIA-DRM device into list */
+ 
+     nv_dev->next = dev_list;
+@@ -969,6 +1008,14 @@ static void nv_drm_register_drm_device(const nv_gpu_info_t *gpu_info)
+ 
+     return; /* Success */
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++failed_drm_client_init:
++
++    kfree(client);
++    drm_dev_unregister(dev);
++
++#endif
++
+ failed_drm_register:
+ 
+     nv_drm_dev_free(dev);
+-- 
+2.47.0
+
diff --git a/srcpkgs/nvidia470/template b/srcpkgs/nvidia470/template
index b9fdb1168bbf62..6faa6f3c8eb61f 100644
--- a/srcpkgs/nvidia470/template
+++ b/srcpkgs/nvidia470/template
@@ -3,7 +3,7 @@
 _desc="NVIDIA drivers (GKxxx “Kepler”)"
 
 pkgname=nvidia470
-version=470.239.06
+version=470.256.02
 revision=1
 maintainer="Andrew Benson <abenson+void@gmail.com>"
 license="custom:NVIDIA Proprietary"
@@ -19,7 +19,7 @@ conflicts="xserver-abi-video>25_1 nvidia390>=0"
 
 _pkg="NVIDIA-Linux-x86_64-${version}"
 distfiles="http://uk.download.nvidia.com/XFree86/Linux-x86_64/${version}/${_pkg}.run"
-checksum=7d74caac140a0432d79ebe8e4330dc796f39ba7dd40b3fcd61df760181bf9ccc
+checksum=d6451862deb695bb0447f3b7cd6268f73e81168c10e2c10597ff3fa01349b1de
 # subpackages need to be processed in this specific order
 subpackages="nvidia470-gtklibs nvidia470-dkms nvidia470-opencl nvidia470-libs nvidia470-libs-32bit"
 depends="nvidia470-libs-${version}_${revision}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] nvidia470: update to 470.256.02.
  2025-01-16 18:58 [PR PATCH] nvidia470: update to 470.256.02 abenson
  2025-01-17 14:11 ` [PR PATCH] [Updated] " abenson
@ 2025-01-19  3:15 ` abenson
  2025-01-19 20:51 ` [PR PATCH] [Merged]: " abenson
  2 siblings, 0 replies; 4+ messages in thread
From: abenson @ 2025-01-19  3:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 493 bytes --]

There is an updated pull request by abenson against master on the void-packages repository

https://github.com/void-linux/void-packages nvidia470_470.256.02
https://github.com/void-linux/void-packages/pull/53996

nvidia470: update to 470.256.02.

#### Testing the changes
- I tested the changes in this PR: **NO**

#### Local build testing
- I built this PR locally for my native architecture, x86_64


A patch file from https://github.com/void-linux/void-packages/pull/53996.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-nvidia470_470.256.02-53996.patch --]
[-- Type: text/x-diff, Size: 13205 bytes --]

From 2d669df6f99b37069caf5a90c8e25e34c6c1b1b7 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Thu, 16 Jan 2025 12:58:48 -0600
Subject: [PATCH] nvidia470: update to 470.256.02.

---
 ...ignore-implicit-function-declaration.patch |  27 +++++
 ...-Fix-conftest-to-use-a-short-wchar_t.patch |  25 ++++
 ...use-nv_drm_gem_vmap-which-has-the-se.patch |  30 +++++
 srcpkgs/nvidia470/patches/kernel-6.10.patch   |  61 ++++++++++
 srcpkgs/nvidia470/patches/kernel-6.12.patch   | 111 ++++++++++++++++++
 srcpkgs/nvidia470/template                    |   4 +-
 6 files changed, 256 insertions(+), 2 deletions(-)
 create mode 100644 srcpkgs/nvidia470/patches/0001-Fix-conftest-to-ignore-implicit-function-declaration.patch
 create mode 100644 srcpkgs/nvidia470/patches/0002-Fix-conftest-to-use-a-short-wchar_t.patch
 create mode 100644 srcpkgs/nvidia470/patches/0003-Fix-conftest-to-use-nv_drm_gem_vmap-which-has-the-se.patch
 create mode 100644 srcpkgs/nvidia470/patches/kernel-6.10.patch
 create mode 100644 srcpkgs/nvidia470/patches/kernel-6.12.patch

diff --git a/srcpkgs/nvidia470/patches/0001-Fix-conftest-to-ignore-implicit-function-declaration.patch b/srcpkgs/nvidia470/patches/0001-Fix-conftest-to-ignore-implicit-function-declaration.patch
new file mode 100644
index 00000000000000..19eae3f28eca94
--- /dev/null
+++ b/srcpkgs/nvidia470/patches/0001-Fix-conftest-to-ignore-implicit-function-declaration.patch
@@ -0,0 +1,27 @@
+From: Benjamin ROBIN <dev@benjarobin.fr>
+Date: Sun, 12 May 2024 17:06:20 +0200
+Subject: [PATCH 1/3] Fix conftest to ignore implicit-function-declaration and
+ strict-prototypes warnings
+
+conftest rely on the fact that a missing prototype should build, but an invalid
+call to a function (missing function parameters) the build fail.
+---
+ conftest.sh | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/conftest.sh b/kernel/conftest.sh
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -101,7 +101,9 @@ test_header_presence() {
+ build_cflags() {
+     BASE_CFLAGS="-O2 -D__KERNEL__ \
+ -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
+--nostdinc -isystem $ISYSTEM"
++-nostdinc -isystem $ISYSTEM \
++-Wno-implicit-function-declaration -Wno-strict-prototypes \
++-Wno-incompatible-pointer-types"
+ 
+     if [ "$OUTPUT" != "$SOURCES" ]; then
+         OUTPUT_CFLAGS="-I$OUTPUT/include2 -I$OUTPUT/include"
+---
+2.45.0
diff --git a/srcpkgs/nvidia470/patches/0002-Fix-conftest-to-use-a-short-wchar_t.patch b/srcpkgs/nvidia470/patches/0002-Fix-conftest-to-use-a-short-wchar_t.patch
new file mode 100644
index 00000000000000..c80bd57ba41075
--- /dev/null
+++ b/srcpkgs/nvidia470/patches/0002-Fix-conftest-to-use-a-short-wchar_t.patch
@@ -0,0 +1,25 @@
+From: Benjamin ROBIN <dev@benjarobin.fr>
+Date: Sun, 12 May 2024 17:45:43 +0200
+Subject: [PATCH 2/3] Fix conftest to use a short wchar_t
+
+Fix build error about ``const efi_char16_t *v = L"SecureBoot"``
+when including include/linux/efi.h
+---
+ conftest.sh | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kernel/conftest.sh b/kernel/conftest.sh
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -101,7 +101,7 @@ test_header_presence() {
+ build_cflags() {
+     BASE_CFLAGS="-O2 -D__KERNEL__ \
+ -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
+--nostdinc -isystem $ISYSTEM \
++-nostdinc -isystem $ISYSTEM -fshort-wchar \
+ -Wno-implicit-function-declaration -Wno-strict-prototypes \
+ -Wno-incompatible-pointer-types"
+ 
+     if [ "$OUTPUT" != "$SOURCES" ]; then
+---
+2.45.0
diff --git a/srcpkgs/nvidia470/patches/0003-Fix-conftest-to-use-nv_drm_gem_vmap-which-has-the-se.patch b/srcpkgs/nvidia470/patches/0003-Fix-conftest-to-use-nv_drm_gem_vmap-which-has-the-se.patch
new file mode 100644
index 00000000000000..b0a6e08528e1a8
--- /dev/null
+++ b/srcpkgs/nvidia470/patches/0003-Fix-conftest-to-use-nv_drm_gem_vmap-which-has-the-se.patch
@@ -0,0 +1,30 @@
+From: Benjamin ROBIN <dev@benjarobin.fr>
+Date: Sun, 12 May 2024 17:54:18 +0200
+Subject: [PATCH 3/3] Fix conftest to use nv_drm_gem_vmap() which has the
+ secondary map argument
+
+See https://forums.developer.nvidia.com/t/nvidia-modules-build-failure-with-upcoming-gcc-14-and-recent-kernels-due-to-misfiring-conftest-sh-test-heads-up/279072
+---
+ conftest.sh | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+diff --git a/kernel/conftest.sh b/kernel/conftest.sh
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -4593,8 +4593,13 @@ compile_test() {
+             #
+             CODE="
+             #include <drm/drm_gem.h>
++            #if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
++            typedef struct iosys_map nv_sysio_map_t;
++            #else
++            typedef struct dma_buf_map nv_sysio_map_t;
++            #endif
+             int conftest_drm_gem_object_vmap_has_map_arg(
+-                    struct drm_gem_object *obj, struct dma_buf_map *map) {
++                    struct drm_gem_object *obj, nv_sysio_map_t *map) {
+                 return obj->funcs->vmap(obj, map);
+             }"
+ 
+---
+2.45.0
diff --git a/srcpkgs/nvidia470/patches/kernel-6.10.patch b/srcpkgs/nvidia470/patches/kernel-6.10.patch
new file mode 100644
index 00000000000000..7639e4464ff863
--- /dev/null
+++ b/srcpkgs/nvidia470/patches/kernel-6.10.patch
@@ -0,0 +1,61 @@
+diff -ruNb a/kernel/conftest.sh b/kernel/conftest.sh
+--- a/kernel/conftest.sh        2024-07-19 04:36:26.183701185 -0500
++++ b/kernel/conftest.sh        2024-07-19 04:36:26.230366381 -0500
+@@ -4464,20 +4464,22 @@
+             compile_check_conftest "$CODE" "NV_DRM_GEM_OBJECT_VMAP_HAS_MAP_ARG" "" "types"
+         ;;
+
+-        unsafe_follow_pfn)
++        follow_pfn)
+             #
+-            # Determine if unsafe_follow_pfn() is present.
++            # Determine if follow_pfn() is present.
+             #
+-            # unsafe_follow_pfn() was added by commit 69bacee7f9ad
+-            # ("mm: Add unsafe_follow_pfn") in v5.13-rc1.
++            # follow_pfn() was added by commit 3b6748e2dd69
++            # ("mm: introduce follow_pfn()") in v2.6.31-rc1, and removed
++            # by commit 233eb0bf3b94 ("mm: remove follow_pfn")
++            # from linux-next 233eb0bf3b94.
+             #
+             CODE="
+             #include <linux/mm.h>
+-            void conftest_unsafe_follow_pfn(void) {
+-                unsafe_follow_pfn();
++            void conftest_follow_pfn(void) {
++                follow_pfn();
+             }"
+
+-            compile_check_conftest "$CODE" "NV_UNSAFE_FOLLOW_PFN_PRESENT" "" "functions"
++            compile_check_conftest "$CODE" "NV_FOLLOW_PFN_PRESENT" "" "functions"
+         ;;
+
+         drm_plane_atomic_check_has_atomic_state_arg)
+diff -ruNb a/kernel/nvidia/nvidia.Kbuild b/kernel/nvidia/nvidia.Kbuild
+--- a/kernel/nvidia/nvidia.Kbuild       2022-10-12 04:29:57.000000000 -0500
++++ b/kernel/nvidia/nvidia.Kbuild       2024-07-19 05:17:39.148448922 -0500
+@@ -164,7 +164,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += cc
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += iterate_fd
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += seq_read_iter
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += sg_page_iter_page
+-NV_CONFTEST_FUNCTION_COMPILE_TESTS += unsafe_follow_pfn
++NV_CONFTEST_FUNCTION_COMPILE_TESTS += follow_pfn
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_gem_object_get
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += drm_gem_object_put_unlocked
+ NV_CONFTEST_FUNCTION_COMPILE_TESTS += set_close_on_exec
+diff -ruNb a/kernel/nvidia/os-mlock.c b/kernel/nvidia/os-mlock.c
+--- a/kernel/nvidia/os-mlock.c  2022-10-12 04:30:26.000000000 -0500
++++ b/kernel/nvidia/os-mlock.c  2024-07-19 04:36:26.230366381 -0500
+@@ -18,10 +18,10 @@
+                                 unsigned long address,
+                                 unsigned long *pfn)
+ {
+-#if defined(NV_UNSAFE_FOLLOW_PFN_PRESENT)
+-    return unsafe_follow_pfn(vma, address, pfn);
+-#else
++#if defined(NV_FOLLOW_PFN_PRESENT)
+     return follow_pfn(vma, address, pfn);
++#else
++    return -1;
+ #endif
+ }
diff --git a/srcpkgs/nvidia470/patches/kernel-6.12.patch b/srcpkgs/nvidia470/patches/kernel-6.12.patch
new file mode 100644
index 00000000000000..d4e4093031ded9
--- /dev/null
+++ b/srcpkgs/nvidia470/patches/kernel-6.12.patch
@@ -0,0 +1,111 @@
+From 839b964bd5be20275a4d1add020e68e407380adb Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
+Date: Sat, 17 Aug 2024 14:26:04 +0000
+Subject: [PATCH] Tentative fix for NVIDIA 470.256.02 driver for Linux 6.12-rc1
+
+Note that the fix requires enabling DRM kernel mode setting
+(add the `nvidia-drm.modeset=1` parameter to the kernel command line).
+
+(Thanks xtexChooser for the memory management fixes!)
+---
+ nvidia-drm/nvidia-drm-drv.c | 47 +++++++++++++++++++++++++++++++++++++
+ 1 file changed, 47 insertions(+)
+
+diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
+index f350134..d6233a5 100644
+--- a/kernel/nvidia-drm/nvidia-drm-drv.c
++++ b/kernel/nvidia-drm/nvidia-drm-drv.c
+@@ -84,6 +84,11 @@
+ #include <drm/drm_atomic_helper.h>
+ #endif
+ 
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++#include <drm/drm_client.h>
++#endif
++
+ static struct nv_drm_device *dev_list = NULL;
+ 
+ #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
+@@ -168,7 +173,12 @@ static const struct drm_mode_config_funcs nv_mode_config_funcs = {
+     .atomic_check  = nv_drm_atomic_check,
+     .atomic_commit = nv_drm_atomic_commit,
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0)
++    // Rel. commit. "drm: Remove struct drm_mode_config_funcs.output_poll_changed" (Thomas Zimmermann, 12 Aug 2024)
++    // Replace this callback with a DRM client's hotplug callback.
++    // This is required for e.g. /sys/class/drm/card*/modes to work.
+     .output_poll_changed = nv_drm_output_poll_changed,
++#endif
+ };
+ 
+ static void nv_drm_event_callback(const struct NvKmsKapiEvent *event)
+@@ -739,6 +749,10 @@ static const struct file_operations nv_drm_fops = {
+     .read           = drm_read,
+ 
+     .llseek         = noop_llseek,
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++    // Rel. commit. "fs: move FMODE_UNSIGNED_OFFSET to fop_flags" (Christian Brauner, 9 Aug 2024)
++    .fop_flags      = FOP_UNSIGNED_OFFSET,
++#endif
+ };
+ 
+ static const struct drm_ioctl_desc nv_drm_ioctls[] = {
+@@ -906,7 +920,18 @@ static void nv_drm_update_drm_driver_features(void)
+ #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
+ }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++static int hotplug_helper_client_hotplug(struct drm_client_dev *client)
++{
++    nv_drm_output_poll_changed(client->dev);
++    return 0;
++}
+ 
++static const struct drm_client_funcs nv_hotplug_helper_client_funcs = {
++    .owner      = THIS_MODULE,
++    .hotplug    = hotplug_helper_client_hotplug,
++};
++#endif
+ 
+ /*
+  * Helper function for allocate/register DRM device for given NVIDIA GPU ID.
+@@ -962,6 +987,20 @@ static void nv_drm_register_drm_device(const nv_gpu_info_t *gpu_info)
+         goto failed_drm_register;
+     }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++    /* Register a DRM client for receiving hotplug events */
++    struct drm_client_dev *client = kzalloc(sizeof(*client), GFP_KERNEL);
++    if (client == NULL || drm_client_init(dev, client,
++        "nv-hotplug-helper", &nv_hotplug_helper_client_funcs)) {
++        printk(KERN_WARNING "Failed to initialize the nv-hotplug-helper DRM client"
++            " (ensure DRM kernel mode setting is enabled via nvidia-drm.modeset=1).\n");
++        goto failed_drm_client_init;
++    }
++
++    drm_client_register(client);
++    pr_info("Registered the nv-hotplug-helper DRM client.\n");
++#endif
++
+     /* Add NVIDIA-DRM device into list */
+ 
+     nv_dev->next = dev_list;
+@@ -969,6 +1008,14 @@ static void nv_drm_register_drm_device(const nv_gpu_info_t *gpu_info)
+ 
+     return; /* Success */
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0)
++failed_drm_client_init:
++
++    kfree(client);
++    drm_dev_unregister(dev);
++
++#endif
++
+ failed_drm_register:
+ 
+     nv_drm_dev_free(dev);
+-- 
+2.47.0
+
diff --git a/srcpkgs/nvidia470/template b/srcpkgs/nvidia470/template
index b9fdb1168bbf62..6faa6f3c8eb61f 100644
--- a/srcpkgs/nvidia470/template
+++ b/srcpkgs/nvidia470/template
@@ -3,7 +3,7 @@
 _desc="NVIDIA drivers (GKxxx “Kepler”)"
 
 pkgname=nvidia470
-version=470.239.06
+version=470.256.02
 revision=1
 maintainer="Andrew Benson <abenson+void@gmail.com>"
 license="custom:NVIDIA Proprietary"
@@ -19,7 +19,7 @@ conflicts="xserver-abi-video>25_1 nvidia390>=0"
 
 _pkg="NVIDIA-Linux-x86_64-${version}"
 distfiles="http://uk.download.nvidia.com/XFree86/Linux-x86_64/${version}/${_pkg}.run"
-checksum=7d74caac140a0432d79ebe8e4330dc796f39ba7dd40b3fcd61df760181bf9ccc
+checksum=d6451862deb695bb0447f3b7cd6268f73e81168c10e2c10597ff3fa01349b1de
 # subpackages need to be processed in this specific order
 subpackages="nvidia470-gtklibs nvidia470-dkms nvidia470-opencl nvidia470-libs nvidia470-libs-32bit"
 depends="nvidia470-libs-${version}_${revision}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Merged]: nvidia470: update to 470.256.02.
  2025-01-16 18:58 [PR PATCH] nvidia470: update to 470.256.02 abenson
  2025-01-17 14:11 ` [PR PATCH] [Updated] " abenson
  2025-01-19  3:15 ` abenson
@ 2025-01-19 20:51 ` abenson
  2 siblings, 0 replies; 4+ messages in thread
From: abenson @ 2025-01-19 20:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 321 bytes --]

There's a merged pull request on the void-packages repository

nvidia470: update to 470.256.02.
https://github.com/void-linux/void-packages/pull/53996

Description:

#### Testing the changes
- I tested the changes in this PR: **NO**

#### Local build testing
- I built this PR locally for my native architecture, x86_64


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-01-19 20:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-16 18:58 [PR PATCH] nvidia470: update to 470.256.02 abenson
2025-01-17 14:11 ` [PR PATCH] [Updated] " abenson
2025-01-19  3:15 ` abenson
2025-01-19 20:51 ` [PR PATCH] [Merged]: " abenson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).