Kernel – 5.12-rc1 is Out. OK with Patched VMware, NVIDIA fails..
Kernel 5.12-rc1 has been released, and brief details are here: http://lkml.iu.edu/hypermail/linux/kernel/2102.3/03831.html
Patched VMware 16.1.0 compiles and loads OK, but latest NVIDIA (460.56) compile fails:
............................
/home/rgadsdon/NVIDIA-Linux-x86_64-460.56/kernel/nvidia-drm/nvidia-drm-drv.c: In function ‘nv_drm_update_drm_driver_features’:
/home/rgadsdon/NVIDIA-Linux-x86_64-460.56/kernel/nvidia-drm/nvidia-drm-drv.c:822:38: error: ‘drm_gem_dumb_destroy’ undeclared (first use in this function); did you mean ‘drm_mode_destroy’?
822 | nv_drm_driver.dumb_destroy = drm_gem_dumb_destroy;
| ^~~~~~~~~~~~~~~~~~~~
| drm_mode_destroy
/home/rgadsdon/NVIDIA-Linux-x86_64-460.56/kernel/nvidia-drm/nvidia-drm-drv.c:822:38: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [scripts/Makefile.build:271: /home/rgadsdon/NVIDIA-Linux-x86_64-460.56/kernel/nvidia-drm/nvidia-drm-drv.o] Error 1
make[1]: *** [Makefile:1849: /home/rgadsdon/NVIDIA-Linux-x86_64-460.56/kernel] Error 2
make[1]: Leaving directory '/usr/src/linux-5.12-rc1'
make: *** [Makefile:80: modules] Error 2
This is due to changes shown here: https://www.spinics.net/lists/dri-devel/msg283601.html The assumption was that the drm_gem_dumb_destroy() function was no longer used, but it was – by NVIDIA…
Robert Gadsdon. February 28th 2021.
Have not tried this one yet, as I was not able to compile the kernel itself 🙁
https://gist.github.com/joanbm (https://gist.githubusercontent.com/joanbm/7a034ac4b79396c3841040e410ef7e91/raw/b21e792dc0b6f891a4a83d182e0ba9b24b36bd80/nvidia-fix-linux-5.12.patch)
joanbm’s patch works but it was written for an older version of the driver sources. For recent versions, the line numbers need to be updated, and, depending on the driver version, additional changes might be necessary:
“`
diff –git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
index 1b4cc6d..0c26646 100644
— a/kernel/nvidia-drm/nvidia-drm-drv.c
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include
#include “nvidia-drm-conftest.h” /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
#include “nvidia-drm-priv.h”
@@ -700,10 +701,10 @@
.num_ioctls = ARRAY_SIZE(nv_drm_ioctls),
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
– .gem_prime_export = nv_drm_gem_prime_export,
– .gem_prime_get_sg_table = nv_drm_gem_prime_get_sg_table,
– .gem_prime_vmap = nv_drm_gem_prime_vmap,
– .gem_prime_vunmap = nv_drm_gem_prime_vunmap,
+/* .gem_prime_export = nv_drm_gem_prime_export, */
+/* .gem_prime_get_sg_table = nv_drm_gem_prime_get_sg_table, */
+/* .gem_prime_vmap = nv_drm_gem_prime_vmap, */
+/* .gem_prime_vunmap = nv_drm_gem_prime_vunmap, */
#if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
.gem_prime_res_obj = nv_drm_gem_prime_res_obj,
@@ -730,10 +731,17 @@
#if defined(NV_DRM_DRIVER_HAS_LEGACY_DEV_LIST)
.legacy_dev_list = LIST_HEAD_INIT(nv_drm_driver.legacy_dev_list),
#else
– .device_list = LIST_HEAD_INIT(nv_drm_driver.device_list),
+ /* .device_list = LIST_HEAD_INIT(nv_drm_driver.device_list),*/
#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.
@@ -757,9 +765,12 @@
nv_drm_driver.dumb_create = nv_drm_dumb_create;
nv_drm_driver.dumb_map_offset = nv_drm_dumb_map_offset;
– nv_drm_driver.dumb_destroy = drm_gem_dumb_destroy;
–
– nv_drm_driver.gem_vm_ops = &nv_drm_gem_vma_ops;
+ #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
+ /* nv_drm_driver.gem_vm_ops = &nv_drm_gem_vma_ops; */
#endif /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
}
“`