Created
March 1, 2021 16:29
-
-
Save joanbm/7a034ac4b79396c3841040e410ef7e91 to your computer and use it in GitHub Desktop.
Tentative fix for NVIDIA 460.56 driver for Linux 5.12-rc1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From a2963d47c009bcbdc98907f70717d9d49425f6db Mon Sep 17 00:00:00 2001 | |
From: Joan Bruguera <[email protected]> | |
Date: Mon, 1 Mar 2021 17:25:15 +0100 | |
Subject: [PATCH] Tentative fix for NVIDIA 460.56 driver for Linux 5.12-rc1 | |
--- | |
nvidia-drm/nvidia-drm-drv.c | 12 ++++++++++++ | |
1 file changed, 12 insertions(+) | |
diff --git a/nvidia-drm/nvidia-drm-drv.c b/nvidia-drm/nvidia-drm-drv.c | |
index 9582531..c23a338 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" | |
@@ -796,6 +797,13 @@ static struct drm_driver nv_drm_driver = { | |
#endif | |
}; | |
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)) | |
+// Reimport trivial forwarder function deleted in commit "drm: Don't export the drm_gem_dumb_destroy() function" (file drivers/gpu/drm/drm_gem.c) | |
+static int nv_drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev, u32 handle) | |
+{ | |
+ return drm_gem_handle_delete(file, handle); | |
+} | |
+#endif | |
/* | |
* Update the global nv_drm_driver for the intended features. | |
@@ -819,7 +827,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; | |
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)) | |
nv_drm_driver.dumb_destroy = drm_gem_dumb_destroy; | |
+#else | |
+ nv_drm_driver.dumb_destroy = nv_drm_gem_dumb_destroy; | |
+#endif | |
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */ | |
} | |
-- | |
2.30.1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like at least the line numbers have changed in the meantime.
Hence, the patch for
nvidia-drm-drv.c
had to be updated in order to allow the patches to be applied: