summarylogtreecommitdiffstats
path: root/nvidia-470xx-fix-linux-6.17.patch
blob: 19db5b427dfda9e92dfbebf155cdefcb6144e5ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From fd52e276f587394b9ae3ba7013b6a44cbdd526f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Bruguera=20Mic=C3=B3?= <joanbrugueram@gmail.com>
Date: Sat, 26 Jul 2025 21:19:03 +0000
Subject: [PATCH] Tentative fix for NVIDIA 470.256.02 driver for Linux 6.17-rc1

---
 nvidia-drm/nvidia-drm-drv.c | 8 ++++++++
 nvidia-drm/nvidia-drm-fb.c  | 9 +++++++++
 nvidia-drm/nvidia-drm-fb.h  | 6 ++++++
 3 files changed, 23 insertions(+)

diff --git a/nvidia-drm/nvidia-drm-drv.c b/nvidia-drm/nvidia-drm-drv.c
index b50b17a..9da3294 100644
--- a/nvidia-drm/nvidia-drm-drv.c
+++ b/nvidia-drm/nvidia-drm-drv.c
@@ -140,6 +140,10 @@ static void nv_drm_output_poll_changed(struct drm_device *dev)
 static struct drm_framebuffer *nv_drm_framebuffer_create(
     struct drm_device *dev,
     struct drm_file *file,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
+    // Rel. commit. "drm: Pass the format info to .fb_create()" (Ville Syrjälä, 1 Jul 2025)
+    const struct drm_format_info *info,
+#endif
     #if defined(NV_DRM_HELPER_MODE_FILL_FB_STRUCT_HAS_CONST_MODE_CMD_ARG)
     const struct drm_mode_fb_cmd2 *cmd
     #else
@@ -155,6 +159,10 @@ static struct drm_framebuffer *nv_drm_framebuffer_create(
     fb = nv_drm_internal_framebuffer_create(
             dev,
             file,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
+            // Rel. commit. "drm: Allow the caller to pass in the format info to drm_helper_mode_fill_fb_struct()" (Ville Syrjälä, 1 Jul 2025)
+            info,
+#endif
             &local_cmd);
 
     #if !defined(NV_DRM_HELPER_MODE_FILL_FB_STRUCT_HAS_CONST_MODE_CMD_ARG)
diff --git a/nvidia-drm/nvidia-drm-fb.c b/nvidia-drm/nvidia-drm-fb.c
index d119e7c..b84e026 100644
--- a/nvidia-drm/nvidia-drm-fb.c
+++ b/nvidia-drm/nvidia-drm-fb.c
@@ -33,6 +33,7 @@
 #include "nvidia-drm-format.h"
 
 #include <drm/drm_crtc_helper.h>
+#include <linux/version.h>
 
 static void __nv_drm_framebuffer_free(struct nv_drm_framebuffer *nv_fb)
 {
@@ -184,6 +185,10 @@ static int nv_drm_framebuffer_init(struct drm_device *dev,
 struct drm_framebuffer *nv_drm_internal_framebuffer_create(
     struct drm_device *dev,
     struct drm_file *file,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
+    // Rel. commit. "drm: Allow the caller to pass in the format info to drm_helper_mode_fill_fb_struct()" (Ville Syrjälä, 1 Jul 2025)
+    const struct drm_format_info *info,
+#endif
     struct drm_mode_fb_cmd2 *cmd)
 {
     struct nv_drm_device *nv_dev = to_nv_device(dev);
@@ -237,6 +242,10 @@ struct drm_framebuffer *nv_drm_internal_framebuffer_create(
         dev,
         #endif
         &nv_fb->base,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
+        // Rel. commit. "drm: Allow the caller to pass in the format info to drm_helper_mode_fill_fb_struct()" (Ville Syrjälä, 1 Jul 2025)
+        info,
+#endif
         cmd);
 
     /*
diff --git a/nvidia-drm/nvidia-drm-fb.h b/nvidia-drm/nvidia-drm-fb.h
index cf477cc..b61b309 100644
--- a/nvidia-drm/nvidia-drm-fb.h
+++ b/nvidia-drm/nvidia-drm-fb.h
@@ -35,6 +35,8 @@
 #include <drm/drm_framebuffer.h>
 #endif
 
+#include <linux/version.h>
+
 #include "nvidia-drm-gem-nvkms-memory.h"
 #include "nvkms-kapi.h"
 
@@ -59,6 +61,10 @@ static inline struct nv_drm_framebuffer *to_nv_framebuffer(
 struct drm_framebuffer *nv_drm_internal_framebuffer_create(
     struct drm_device *dev,
     struct drm_file *file,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 17, 0)
+    // Rel. commit. "drm: Allow the caller to pass in the format info to drm_helper_mode_fill_fb_struct()" (Ville Syrjälä, 1 Jul 2025)
+    const struct drm_format_info *info,
+#endif
     struct drm_mode_fb_cmd2 *cmd);
 
 #endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
-- 
2.50.1