Moving this bug from nvidia-prime to nvidia-graphics-drivers-331, since the fix goes in the NVIDIA driver, and not nvidia-prime.
FWIW, the attached patch has been formatted for use with the NVIDIA .run installer's "--apply-patch" option, but it should be usable for DKMS, since DKMS uses patchlevel -p1. The patch includes a conftest so that the calls to the new pm_vt_switch_*() functions will only be compiled if the kernel actually provides them, so you don't need to worry about PATCH_MATCH, and can just apply the patch unconditionally.
Moving this bug from nvidia-prime to nvidia- graphics- drivers- 331, since the fix goes in the NVIDIA driver, and not nvidia-prime.
FWIW, the attached patch has been formatted for use with the NVIDIA .run installer's "--apply-patch" option, but it should be usable for DKMS, since DKMS uses patchlevel -p1. The patch includes a conftest so that the calls to the new pm_vt_switch_*() functions will only be compiled if the kernel actually provides them, so you don't need to worry about PATCH_MATCH, and can just apply the patch unconditionally.