--- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/common/inc/nv-list-helpers.h~ 2019-01-27 17:12:19.000000000 +0100 +++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/common/inc/nv-list-helpers.h 2019-05-07 19:39:34.895403211 +0200 @@ -23,6 +23,7 @@ #ifndef __NV_LIST_HELPERS_H__ #define __NV_LIST_HELPERS_H__ +#include #include #include "conftest.h" @@ -91,10 +91,12 @@ list_entry((pos)->member.next, typeof(*(pos)), member) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0) static inline int list_is_first(const struct list_head *list, const struct list_head *head) { return list->prev == head; } +#endif #endif // __NV_LIST_HELPERS_H__ --- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c.orig 2019-01-27 17:12:27.000000000 +0100 +++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c 2019-05-07 20:39:24.748960946 +0200 @@ -55,6 +55,11 @@ #include #endif +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +#include +#endif + static struct nv_drm_device *dev_list = NULL; #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE) --- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-encoder.c~ 2019-01-27 17:12:27.000000000 +0100 +++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-encoder.c 2019-05-07 20:42:06.361103325 +0200 @@ -36,6 +36,11 @@ #include #include +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +#include +#endif + static void nv_drm_encoder_destroy(struct drm_encoder *encoder) { struct nv_drm_encoder *nv_encoder = to_nv_encoder(encoder); --- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-connector.c~ 2019-01-27 17:12:27.000000000 +0100 +++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-connector.c 2019-05-07 20:43:20.487229513 +0200 @@ -35,6 +35,11 @@ #include #include +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +#include +#endif + static void nv_drm_connector_destroy(struct drm_connector *connector) { struct nv_drm_connector *nv_connector = to_nv_connector(connector); --- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c~ 2019-01-27 17:12:27.000000000 +0100 +++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c 2019-05-07 20:45:43.466195062 +0200 @@ -19,6 +19,7 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ +#include #include "nvidia-drm-conftest.h" @@ -268,12 +268,20 @@ */ #if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +static vm_fault_t nv_drm_vma_fault(struct vm_fault *vmf) +#else static int nv_drm_vma_fault(struct vm_fault *vmf) +#endif { return __nv_drm_vma_fault(vmf->vma, vmf); } #else +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0) +static vm_fault_t nv_drm_vma_fault(struct vm_area_struct *vma, +#else static int nv_drm_vma_fault(struct vm_area_struct *vma, +#endif struct vm_fault *vmf) { return __nv_drm_vma_fault(vma, vmf);