mirror of
https://github.com/Frogging-Family/nvidia-all
synced 2024-10-30 15:20:10 +00:00
31 lines
1.1 KiB
Diff
31 lines
1.1 KiB
Diff
diff --git a/kernel-dkms/nvidia-drm/nvidia-drm-drv.c b/kernel-dkms/nvidia-drm/nvidia-drm-drv.c
|
|
index 9582531..c23a338 100644
|
|
--- a/kernel-dkms/nvidia-drm/nvidia-drm-drv.c
|
|
+++ b/kernel-dkms/nvidia-drm/nvidia-drm-drv.c
|
|
@@ -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 */
|
|
}
|
|
|