Mageia Bugzilla – Attachment 12063 Details for
Bug 27780
nvidia390 fails to install for kernel-5.10
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
dirty fix for swiotlb error
kernel-5.10.patch (text/plain), 1.93 KB, created by
Aurelian R
on 2020-12-07 22:39:24 CET
(
hide
)
Description:
dirty fix for swiotlb error
Filename:
MIME Type:
Creator:
Aurelian R
Created:
2020-12-07 22:39:24 CET
Size:
1.93 KB
patch
obsolete
> >Adjust for kernel 5.10 series changes > >Signed-off-by: Thomas Backlund <tmb@mageia.org> > >diff -Nurp NVIDIA-Linux-x86_64-390.138.orig/kernel/common/inc/nv-linux.h NVIDIA-Linux-x86_64-390.138/kernel/common/inc/nv-linux.h >--- NVIDIA-Linux-x86_64-390.138.orig/kernel/common/inc/nv-linux.h 2020-05-14 15:29:21.000000000 +0300 >+++ NVIDIA-Linux-x86_64-390.138/kernel/common/inc/nv-linux.h 2020-12-05 00:43:24.527950922 +0200 >@@ -178,6 +178,10 @@ static inline uid_t __kuid_val(kuid_t ui > #include <linux/dma-mapping.h> > #endif > >+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) >+#include <linux/dma-map-ops.h> >+#endif >+ > #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64) > #include <linux/swiotlb.h> > #endif >@@ -1389,7 +1389,7 @@ * isn't in place, use the swiotlb flag. Before dma_ops was added, this > * flag used to be exported. It still exists in modern kernels but is no > * longer exported. > */ >- swiotlb_in_use = (swiotlb == 1); >+ swiotlb_in_use = NV_FALSE; > #endif > #endif > >diff -Nurp NVIDIA-Linux-x86_64-390.138.orig/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c NVIDIA-Linux-x86_64-390.138/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c >--- NVIDIA-Linux-x86_64-390.138.orig/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c 2020-05-14 15:29:25.000000000 +0300 >+++ NVIDIA-Linux-x86_64-390.138/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c 2020-12-05 01:03:21.587003801 +0200 >@@ -20,6 +20,8 @@ > * DEALINGS IN THE SOFTWARE. > */ > >+#include <linux/version.h> >+ > #include "nvidia-drm-conftest.h" > > #if defined(NV_DRM_AVAILABLE) >@@ -47,7 +49,11 @@ static struct sg_table *__nv_drm_gem_use > { > struct nv_drm_gem_user_memory *nv_user_memory = to_nv_user_memory(nv_gem); > >+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) >+ return drm_prime_pages_to_sg(nv_gem->base.dev, nv_user_memory->pages, >+#else > return drm_prime_pages_to_sg(nv_user_memory->pages, >+#endif > nv_user_memory->pages_count); > } >
Adjust for kernel 5.10 series changes Signed-off-by: Thomas Backlund <tmb@mageia.org> diff -Nurp NVIDIA-Linux-x86_64-390.138.orig/kernel/common/inc/nv-linux.h NVIDIA-Linux-x86_64-390.138/kernel/common/inc/nv-linux.h --- NVIDIA-Linux-x86_64-390.138.orig/kernel/common/inc/nv-linux.h 2020-05-14 15:29:21.000000000 +0300 +++ NVIDIA-Linux-x86_64-390.138/kernel/common/inc/nv-linux.h 2020-12-05 00:43:24.527950922 +0200 @@ -178,6 +178,10 @@ static inline uid_t __kuid_val(kuid_t ui #include <linux/dma-mapping.h> #endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) +#include <linux/dma-map-ops.h> +#endif + #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64) #include <linux/swiotlb.h> #endif @@ -1389,7 +1389,7 @@ * isn't in place, use the swiotlb flag. Before dma_ops was added, this * flag used to be exported. It still exists in modern kernels but is no * longer exported. */ - swiotlb_in_use = (swiotlb == 1); + swiotlb_in_use = NV_FALSE; #endif #endif diff -Nurp NVIDIA-Linux-x86_64-390.138.orig/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c NVIDIA-Linux-x86_64-390.138/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c --- NVIDIA-Linux-x86_64-390.138.orig/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c 2020-05-14 15:29:25.000000000 +0300 +++ NVIDIA-Linux-x86_64-390.138/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c 2020-12-05 01:03:21.587003801 +0200 @@ -20,6 +20,8 @@ * DEALINGS IN THE SOFTWARE. */ +#include <linux/version.h> + #include "nvidia-drm-conftest.h" #if defined(NV_DRM_AVAILABLE) @@ -47,7 +49,11 @@ static struct sg_table *__nv_drm_gem_use { struct nv_drm_gem_user_memory *nv_user_memory = to_nv_user_memory(nv_gem); +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) + return drm_prime_pages_to_sg(nv_gem->base.dev, nv_user_memory->pages, +#else return drm_prime_pages_to_sg(nv_user_memory->pages, +#endif nv_user_memory->pages_count); }
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 27780
:
12062
| 12063