Skip to content

Instantly share code, notes, and snippets.

@joanbm
Created May 7, 2023 21:14
Show Gist options
  • Save joanbm/77f0650d45747b9a4dc8e330ade2bf5c to your computer and use it in GitHub Desktop.
Save joanbm/77f0650d45747b9a4dc8e330ade2bf5c to your computer and use it in GitHub Desktop.
Tentative fix for NVIDIA 470.182.03 driver for Linux 6.4-rc1
From 4981428cda825b415eea60313f71bf386cc9f7e1 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <[email protected]>
Date: Sat, 25 Feb 2023 10:57:26 +0000
Subject: [PATCH] Tentative fix for NVIDIA 470.182.03 driver for Linux 6.4-rc1
---
nvidia-drm/nvidia-drm-drv.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/nvidia-drm/nvidia-drm-drv.c b/nvidia-drm/nvidia-drm-drv.c
index 8ef4c27..85c43f2 100644
--- a/nvidia-drm/nvidia-drm-drv.c
+++ b/nvidia-drm/nvidia-drm-drv.c
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include <linux/version.h>
#include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
#include "nvidia-drm-priv.h"
@@ -873,7 +874,11 @@ static void nv_drm_update_drm_driver_features(void)
nv_drm_driver.dumb_create = nv_drm_dumb_create;
nv_drm_driver.dumb_map_offset = nv_drm_dumb_map_offset;
+// Rel. commit "drm: remove dumb_destroy callback" (Christian König, 26 Jan 2023)
+// NB: No resources are leaked, the kernel releases the same resources by default
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 4, 0)
nv_drm_driver.dumb_destroy = nv_drm_dumb_destroy;
+#endif
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
}
--
2.40.1
@ncs1
Copy link

ncs1 commented Jun 26, 2023

Thanks !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment