460.67 Incompatible with Kernel 5.13 at the moment

I know this isn’t entirely uncommon, but I figured I’d let everyone know that at the moment, the Nvidia proprietary driver isn’t compatible with kernel 5.13.

DKMS fails with:

  CC [M]  /var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-gem-nvkms-memory.o
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c: In function ‘plane_req_config_update’:
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c:89:9: warning: unused variable ‘ret’ [-Wunused-variable]
   89 |     int ret = 0;
      |         ^~~
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c: In function ‘nv_drm_plane_atomic_set_property’:
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c:372:32: warning: unused variable ‘nv_drm_plane_state’ [-Wunused-variable]
  372 |     struct nv_drm_plane_state *nv_drm_plane_state =
      |                                ^~~~~~~~~~~~~~~~~~
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c: At top level:
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c:454:23: error: initialization of ‘int (*)(struct drm_plane *, struct drm_atomic_state *)’ from incompatible pointer type ‘int (*)(struct drm_plane *, struct drm_plane_state *)’ [-Werror=incompatible-pointer-types]
  454 |     .atomic_check   = nv_drm_plane_atomic_check,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c:454:23: note: (near initialization for ‘nv_plane_helper_funcs.atomic_check’)
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c:455:23: error: initialization of ‘void (*)(struct drm_plane *, struct drm_atomic_state *)’ from incompatible pointer type ‘void (*)(struct drm_plane *, struct drm_plane_state *)’ [-Werror=incompatible-pointer-types]
  455 |     .atomic_update  = nv_drm_plane_atomic_update,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c:455:23: note: (near initialization for ‘nv_plane_helper_funcs.atomic_update’)
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c:456:23: error: initialization of ‘void (*)(struct drm_plane *, struct drm_atomic_state *)’ from incompatible pointer type ‘void (*)(struct drm_plane *, struct drm_plane_state *)’ [-Werror=incompatible-pointer-types]
  456 |     .atomic_disable = nv_drm_plane_atomic_disable,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.c:456:23: note: (near initialization for ‘nv_plane_helper_funcs.atomic_disable’)
  CC [M]  /var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-gem-user-memory.o
  CC [M]  /var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-gem-dma-buf.o
  CC [M]  /var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-format.o
  CC [M]  /var/lib/dkms/nvidia/465.27/build/nvidia-peermem/nvidia-peermem.o
  LD [M]  /var/lib/dkms/nvidia/465.27/build/nvidia.o
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-modeset.c: In function ‘__will_generate_flip_event’:
/var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-modeset.c:96:23: warning: unused variable ‘primary_plane’ [-Wunused-variable]
   96 |     struct drm_plane *primary_plane = crtc->primary;
      |                       ^~~~~~~~~~~~~
  LD [M]  /var/lib/dkms/nvidia/465.27/build/nvidia-uvm.o
  LD [M]  /var/lib/dkms/nvidia/465.27/build/nvidia-modeset.o
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:272: /var/lib/dkms/nvidia/465.27/build/nvidia-drm/nvidia-drm-crtc.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1839: /var/lib/dkms/nvidia/465.27/build] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.13.0-rc1-154-tkg-cfs/build'
make: *** [Makefile:80: modules] Error 2

I’m guessing it will require a driver update to be compatible.

I made a patch that seems to build at least (using wayland so not using the driver for display)

Put the patch in /usr/src/nvidia-current-465.27/patches and add the patch filename to the ‘series’ file in the same folder. Edit /usr/src/nvidia-current-465.27/dkms.conf to apply the patch for kernel 5.13 and run sudo dkms build nvidia-current/465.27 -k 5.13.0-rc1

/usr/src/nvidia-current-465.27/dkms.conf
dkms.conf (1.3 KB)

/usr/src/nvidia-current-465.27/patches/kernel-5.13-use-atomic-state.patch
kernel-5.13-use-atomic-state.patch (1.1 KB)