Hi all, After an update to the kernel 4.7.0, I ran into these problems with the NVIDIA drivers: http://rglinuxtech.com/?p=1746 :
........../home/rgadsdon/kernel/NVIDIA-Linux-x86_64-367.18/kernel/nvidia-uvm/uvm_linux.h:557:13: error: redefinition of ‘radix_tree_empty’ static bool radix_tree_empty(struct radix_tree_root *tree)................................../home/rgadsdon/kernel/NVIDIA-Linux-x86_64-367.18/kernel/nvidia-drm/nvidia-drm-gem.c: In function ‘nvidia_drm_dumb_map_offset’:/home/rgadsdon/kernel/NVIDIA-Linux-x86_64-367.18/kernel/nvidia-drm/nvidia-drm-gem.c:411:33: error: passing argument 1 of ‘drm_gem_object_lookup’ from incompatible pointer type [-Werror=incompatible-pointer-types] gem = drm_gem_object_lookup(dev, file, handle);........................ I applied the attached patch unconditionally locally, and it seems to work. Which is correct way to apply the patch or not depending on the kernel version? Best regards, Natanael.
diff -ur NVIDIA-Linux-x86_64-367.35-original/kernel/nvidia-drm/nvidia-drm-fb.c NVIDIA-Linux-x86_64-367.35/kernel/nvidia-drm/nvidia-drm-fb.c --- NVIDIA-Linux-x86_64-367.35-original/kernel/nvidia-drm/nvidia-drm-fb.c 2016-07-12 06:53:45.000000000 +0200 +++ NVIDIA-Linux-x86_64-367.35/kernel/nvidia-drm/nvidia-drm-fb.c 2016-08-05 20:10:51.114008113 +0200 @@ -114,7 +114,7 @@ * We don't support any planar format, pick up first buffer only. */ - gem = drm_gem_object_lookup(dev, file, cmd->handles[0]); + gem = drm_gem_object_lookup(file, cmd->handles[0]); if (gem == NULL) { diff -ur NVIDIA-Linux-x86_64-367.35-original/kernel/nvidia-drm/nvidia-drm-gem.c NVIDIA-Linux-x86_64-367.35/kernel/nvidia-drm/nvidia-drm-gem.c --- NVIDIA-Linux-x86_64-367.35-original/kernel/nvidia-drm/nvidia-drm-gem.c 2016-07-12 06:53:45.000000000 +0200 +++ NVIDIA-Linux-x86_64-367.35/kernel/nvidia-drm/nvidia-drm-gem.c 2016-08-05 20:01:41.942998089 +0200 @@ -408,7 +408,7 @@ mutex_lock(&dev->struct_mutex); - gem = drm_gem_object_lookup(dev, file, handle); + gem = drm_gem_object_lookup(file, handle); if (gem == NULL) { diff -ur NVIDIA-Linux-x86_64-367.35-original/kernel/nvidia-uvm/uvm8_gpu.c NVIDIA-Linux-x86_64-367.35/kernel/nvidia-uvm/uvm8_gpu.c --- NVIDIA-Linux-x86_64-367.35-original/kernel/nvidia-uvm/uvm8_gpu.c 2016-07-12 06:52:17.000000000 +0200 +++ NVIDIA-Linux-x86_64-367.35/kernel/nvidia-uvm/uvm8_gpu.c 2016-08-05 19:34:51.454968692 +0200 @@ -647,7 +647,7 @@ gpu->id, uvm_gpu_retained_count(gpu)); // All channels should have been removed before the retained count went to 0 - UVM_ASSERT(radix_tree_empty(&gpu->instance_ptr_table)); + UVM_ASSERT(NV_radix_tree_empty(&gpu->instance_ptr_table)); // Remove the GPU from the table. uvm_spin_lock_irqsave(&g_uvm_global.gpu_table_lock); diff -ur NVIDIA-Linux-x86_64-367.35-original/kernel/nvidia-uvm/uvm_linux.h NVIDIA-Linux-x86_64-367.35/kernel/nvidia-uvm/uvm_linux.h --- NVIDIA-Linux-x86_64-367.35-original/kernel/nvidia-uvm/uvm_linux.h 2016-07-12 06:52:17.000000000 +0200 +++ NVIDIA-Linux-x86_64-367.35/kernel/nvidia-uvm/uvm_linux.h 2016-08-05 19:34:45.541968585 +0200 @@ -554,7 +554,7 @@ INIT_RADIX_TREE(tree, GFP_NOWAIT); } -static bool radix_tree_empty(struct radix_tree_root *tree) +static bool NV_radix_tree_empty(struct radix_tree_root *tree) { void *dummy; return radix_tree_gang_lookup(tree, &dummy, 0, 1) == 0;