Commit 4c8a2b08 authored by Mark Wagie's avatar Mark Wagie
Browse files

[pkg-upd] 390.147-1

parent b7744ab5
......@@ -15,13 +15,13 @@
_linuxprefix=linux514
_extramodules=extramodules-5.14-MANJARO
# don't edit here
pkgver=390.144
pkgver=390.147
_nver=390
# edit here for new version
_sver=144
_sver=147
# edit here for new build
pkgrel=25
pkgrel=1
pkgname=$_linuxprefix-nvidia-${_nver}xx
_pkgname=nvidia
_pkgver="${_nver}.${_sver}"
......@@ -39,10 +39,8 @@ license=('custom')
install=nvidia.install
options=(!strip)
durl="http://us.download.nvidia.com/XFree86/Linux-x86"
source=("${durl}_64/${_pkgver}/NVIDIA-Linux-x86_64-${_pkgver}-no-compat32.run"
"kernel-5.14.patch")
sha256sums=('d9b36e51253592d7aeecb9758ebccf30348ab364c88f95aa5ba33c767470949c'
'b03701c114c2a614859acf090c90e33c4c1954db7d198744bff348226c2f18d5')
source=("${durl}_64/${_pkgver}/NVIDIA-Linux-x86_64-${_pkgver}-no-compat32.run")
sha256sums=('3fc4b5a7c64326cea79156fc31e8160a89621219df09a4cd268844c3e318accc')
_pkg="NVIDIA-Linux-x86_64-${_pkgver}-no-compat32"
......@@ -54,9 +52,7 @@ prepare() {
sh "${_pkg}.run" --extract-only
cd "${_pkg}"
# patches here
# Fix compile problem with 5.14
msg2 "PATCH: kernel-5.14.patch"
patch -p1 -i ../kernel-5.14.patch
}
build() {
......
--- a/kernel/conftest.sh 2021-05-27 15:55:42.521430654 +0200
+++ b/kernel/conftest.sh 2021-05-28 12:54:15.544706047 +0200
@@ -1729,20 +1729,31 @@
# Determine if the DRM subsystem is usable
#
CODE="
+ #include <linux/version.h>
#if defined(NV_DRM_DRMP_H_PRESENT)
#include <drm/drmP.h>
+ #else
+ #include <drm/drm_drv.h>
+ #include <drm/drm_prime.h>
#endif
#if defined(NV_DRM_DRM_DRV_H_PRESENT)
#include <drm/drm_drv.h>
#endif
+ #if defined(NV_DRM_DRM_GEM_H_PRESENT)
+ #include <drm/drm_gem.h>
+ #endif
+
+ #if defined(NV_DRM_DRM_PRIME_H_PRESENT)
+ #include <drm/drm_prime.h>
+ #endif
+
#if !defined(CONFIG_DRM) && !defined(CONFIG_DRM_MODULE)
#error DRM not enabled
#endif
void conftest_drm_available(void) {
- struct drm_driver drv;
/* 2013-10-02 1bb72532ac260a2d3982b40bdd4c936d779d0d16 */
(void)drm_dev_alloc;
@@ -1752,6 +1763,24 @@
/* 2013-10-02 c3a49737ef7db0bdd4fcf6cf0b7140a883e32b2a */
(void)drm_dev_unregister;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
+ // Avoid failure due to all the changes in torvalds/linux commit d693def4fd1c23f1ca5aed1afb9993b3a2069ad2
+ struct drm_driver drv;
+ drv.gem_prime_pin = 0;
+ drv.gem_prime_get_sg_table = 0;
+ drv.gem_prime_vmap = 0;
+ drv.gem_prime_vunmap = 0;
+#else
+ struct drm_gem_object_funcs gem;
+ gem.pin = 0;
+ gem.get_sg_table = 0;
+ gem.vmap = 0;
+ gem.vunmap = 0;
+#endif
+ (void)drm_gem_prime_import;
+ (void)drm_gem_prime_export;
+
+
}"
compile_check_conftest "$CODE" "NV_DRM_AVAILABLE" "" "generic"
@@ -1764,6 +1793,8 @@
CODE="
#if defined(NV_DRM_DRMP_H_PRESENT)
#include <drm/drmP.h>
+ #else
+ #include <drm/drm_drv.h>
#endif
void conftest_drm_dev_unref(void) {
/*
@@ -2540,6 +2571,8 @@
CODE="
#if defined(NV_DRM_DRMP_H_PRESENT)
#include <drm/drmP.h>
+ #else
+ #include <drm/drm_crtc.h>
#endif
#if defined(NV_DRM_DRM_CRTC_H_PRESENT)
@@ -2562,6 +2595,8 @@
CODE="
#if defined(NV_DRM_DRMP_H_PRESENT)
#include <drm/drmP.h>
+ #else
+ #include <drm/drm_encoder.h>
#endif
#if defined(NV_DRM_DRM_ENCODER_H_PRESENT)
@@ -2583,6 +2618,8 @@
echo "$CONFTEST_PREAMBLE
#if defined(NV_DRM_DRMP_H_PRESENT)
#include <drm/drmP.h>
+ #else
+ #include <drm/drm_plane.h>
#endif
#if defined(NV_DRM_DRM_PLANE_H_PRESENT)
@@ -2616,6 +2653,8 @@
echo "$CONFTEST_PREAMBLE
#if defined(NV_DRM_DRMP_H_PRESENT)
#include <drm/drmP.h>
+ #else
+ #include <drm/drm_plane.h>
#endif
#if defined(NV_DRM_DRM_PLANE_H_PRESENT)
@@ -2893,6 +2932,7 @@
#
echo "$CONFTEST_PREAMBLE
#include <drm/drm_crtc_helper.h>
+ #include <drm/drm_probe_helper.h>
void drm_helper_mode_fill_fb_struct(struct drm_device *dev,
struct drm_framebuffer *fb,
const struct drm_mode_fb_cmd2 *mode_cmd)
@@ -2919,6 +2959,7 @@
#
echo "$CONFTEST_PREAMBLE
#include <drm/drm_crtc_helper.h>
+ #include <drm/drm_probe_helper.h>
void drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb,
const struct drm_mode_fb_cmd2 *mode_cmd)
{
--- a/kernel/nvidia-drm/nvidia-drm-connector.c 2021-05-28 11:39:18.723059671 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-connector.c 2021-05-28 11:39:37.423011907 +0200
@@ -39,6 +39,7 @@
#include <drm/drm_probe_helper.h>
#endif
#include <drm/drm_crtc_helper.h>
+#include <drm/drm_probe_helper.h>
#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
--- a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.h 2021-05-27 18:52:31.868299725 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.h 2021-05-28 12:11:51.538031418 +0200
@@ -20,15 +20,16 @@
* DEALINGS IN THE SOFTWARE.
*/
+#define NV_DRM_AVAILABLE
#ifndef __NVIDIA_DRM_GEM_NVKMS_MEMORY_H__
#define __NVIDIA_DRM_GEM_NVKMS_MEMORY_H__
#include "nvidia-drm-conftest.h"
+#include "nvidia-drm-gem.h"
+#include "nvidia-drm-priv.h"
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
-#include "nvidia-drm-gem.h"
-
struct nv_drm_gem_nvkms_memory {
struct nv_drm_gem_object base;
--- a/kernel/nvidia-drm/nvidia-drm-gem.h 2021-05-27 17:03:57.520288465 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-gem.h 2021-05-28 10:34:42.536603598 +0200
@@ -20,13 +20,15 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include <linux/version.h>
+#include "linux/dma-buf.h"
+#include "drm/drm_gem.h"
+
#ifndef __NVIDIA_DRM_GEM_H__
#define __NVIDIA_DRM_GEM_H__
#include "nvidia-drm-conftest.h"
-#if defined(NV_DRM_AVAILABLE)
-
#include "nvidia-drm-priv.h"
#if defined(NV_DRM_DRMP_H_PRESENT)
@@ -49,8 +51,15 @@
struct nv_drm_gem_object_funcs {
void (*free)(struct nv_drm_gem_object *nv_gem);
struct sg_table *(*prime_get_sg_table)(struct nv_drm_gem_object *nv_gem);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
void *(*prime_vmap)(struct nv_drm_gem_object *nv_gem);
void (*prime_vunmap)(struct nv_drm_gem_object *nv_gem, void *address);
+#else
+ // Updated vmap/vunmap operations to use struct dma_buf_map instead of raw pointers
+ // See torvalds/linux commits ccc22d41bd9acec58cdc7c3b012e1887aba40af4, 6619ccf1bb1d0ebb071f758111efa83918b216fc
+ int (*prime_vmap)(struct nv_drm_gem_object *nv_gem, struct dma_buf_map *map);
+ void (*prime_vunmap)(struct nv_drm_gem_object *nv_gem, struct dma_buf_map *map);
+#endif
};
struct nv_drm_gem_object {
@@ -185,14 +194,20 @@
struct sg_table *nv_drm_gem_prime_get_sg_table(struct drm_gem_object *gem);
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
void *nv_drm_gem_prime_vmap(struct drm_gem_object *gem);
void nv_drm_gem_prime_vunmap(struct drm_gem_object *gem, void *address);
+#else
+// Updated vmap/vunmap operations to use struct dma_buf_map instead of raw pointers
+// See torvalds/linux commits ccc22d41bd9acec58cdc7c3b012e1887aba40af4, 6619ccf1bb1d0ebb071f758111efa83918b216fc
+int nv_drm_gem_prime_vmap(struct drm_gem_object *gem, struct dma_buf_map *map);
+
+void nv_drm_gem_prime_vunmap(struct drm_gem_object *gem, struct dma_buf_map *map);
+#endif
#if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
nv_dma_resv_t* nv_drm_gem_prime_res_obj(struct drm_gem_object *obj);
#endif
-#endif /* NV_DRM_AVAILABLE */
-
#endif /* __NVIDIA_DRM_GEM_H__ */
--- a/kernel/nvidia-drm/nvidia-drm-gem.c 2021-05-27 16:59:29.537645833 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-gem.c 2021-05-28 12:20:37.383348684 +0200
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include <linux/version.h>
#include "nvidia-drm-conftest.h"
#if defined(NV_DRM_AVAILABLE)
@@ -56,7 +57,7 @@
static int nv_drm_gem_vmap(struct drm_gem_object *gem,
struct dma_buf_map *map)
{
- map->vaddr = nv_drm_gem_prime_vmap(gem);
+ map->vaddr = nv_drm_gem_prime_vmap(gem, map);
if (map->vaddr == NULL) {
return -ENOMEM;
}
@@ -161,6 +162,7 @@
return ERR_PTR(-ENOTSUPP);
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
void *nv_drm_gem_prime_vmap(struct drm_gem_object *gem)
{
struct nv_drm_gem_object *nv_gem = to_nv_gem_object(gem);
@@ -180,6 +182,29 @@
nv_gem->ops->prime_vunmap(nv_gem, address);
}
}
+#else
+// Updated vmap/vunmap operations to use struct dma_buf_map instead of raw pointers
+// See torvalds/linux commits ccc22d41bd9acec58cdc7c3b012e1887aba40af4, 6619ccf1bb1d0ebb071f758111efa83918b216fc
+int nv_drm_gem_prime_vmap(struct drm_gem_object *gem, struct dma_buf_map *map)
+{
+ struct nv_drm_gem_object *nv_gem = to_nv_gem_object(gem);
+
+ if (nv_gem->ops->prime_vmap != NULL) {
+ return nv_gem->ops->prime_vmap(nv_gem, map);
+ }
+
+ return -ENOTSUPP;
+}
+
+void nv_drm_gem_prime_vunmap(struct drm_gem_object *gem, struct dma_buf_map *map)
+{
+ struct nv_drm_gem_object *nv_gem = to_nv_gem_object(gem);
+
+ if (nv_gem->ops->prime_vunmap != NULL) {
+ nv_gem->ops->prime_vunmap(nv_gem, map);
+ }
+}
+#endif
#if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
nv_dma_resv_t* nv_drm_gem_prime_res_obj(struct drm_gem_object *obj)
--- a/kernel/nvidia-drm/nvidia-drm-fb.c 2021-05-28 11:45:24.498794248 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-fb.c 2021-05-28 11:46:08.145349929 +0200
@@ -31,6 +31,7 @@
#include "nvidia-drm-gem.h"
#include <drm/drm_crtc_helper.h>
+#include <drm/drm_probe_helper.h>
static void nv_drm_framebuffer_destroy(struct drm_framebuffer *fb)
{
--- a/kernel/nvidia-drm/nvidia-drm-encoder.c 2021-05-28 11:44:12.928976305 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-encoder.c 2021-05-28 11:44:55.662200931 +0200
@@ -31,6 +31,12 @@
#include "nvidia-drm-crtc.h"
#include "nvidia-drm-helper.h"
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_probe_helper.h>
+
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
+
/*
* Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
* moves a number of helper function definitions from
--- a/kernel/nvidia-drm/nvidia-drm-drv.c 2021-05-27 16:46:13.143326691 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c 2021-05-28 11:52:24.231061479 +0200
@@ -19,8 +19,12 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
-
+#include <linux/version.h>
#include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
+#include <drm/drm_gem.h>
+
+#include <drm/drm_crtc_helper.h>
+#include <drm/drm_probe_helper.h>
#include "nvidia-drm-priv.h"
#include "nvidia-drm-drv.h"
@@ -737,6 +741,13 @@
#endif
};
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0))
+// Reimport trivial forwarder function deleted in commit "drm: Don't export the drm_gem_dumb_destroy() function" (file drivers/gpu/drm/drm_gem.c)
+static int nv_drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev, u32 handle)
+{
+ return drm_gem_handle_delete(file, handle);
+}
+#endif
/*
* Update the global nv_drm_driver for the intended features.
@@ -760,7 +771,11 @@
nv_drm_driver.dumb_create = nv_drm_dumb_create;
nv_drm_driver.dumb_map_offset = nv_drm_dumb_map_offset;
- nv_drm_driver.dumb_destroy = nv_drm_dumb_destroy;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0))
+ nv_drm_driver.dumb_destroy = drm_gem_dumb_destroy;
+ #else
+ nv_drm_driver.dumb_destroy = nv_drm_gem_dumb_destroy;
+ #endif
#if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_CALLBACKS)
nv_drm_driver.gem_vm_ops = &nv_drm_gem_vma_ops;
--- a/kernel/nvidia-drm/nvidia-drm-crtc.h 2021-05-27 17:09:06.736181653 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-crtc.h 2021-05-27 18:53:46.498093856 +0200
@@ -20,10 +20,14 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include <linux/version.h>
+#include "nvidia-drm-conftest.h"
+#include "nvidia-drm-priv.h"
+#include "linux/dma-buf.h"
+
#ifndef __NVIDIA_DRM_CRTC_H__
#define __NVIDIA_DRM_CRTC_H__
-#include "nvidia-drm-conftest.h"
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
@@ -139,7 +143,7 @@
struct nv_drm_crtc *nv_drm_crtc_lookup(struct nv_drm_device *nv_dev, NvU32 head)
{
struct drm_crtc *crtc;
- nv_drm_for_each_crtc(crtc, nv_dev->dev) {
+ drm_for_each_crtc(crtc, nv_dev->dev) {
struct nv_drm_crtc *nv_crtc = to_nv_crtc(crtc);
if (nv_crtc->head == head) {
--- a/kernel/nvidia-drm/nvidia-drm-crtc.c 2021-05-27 16:07:46.706345471 +0200
+++ b/kernel/nvidia-drm/nvidia-drm-crtc.c 2021-05-28 11:40:31.889539532 +0200
@@ -19,7 +19,7 @@
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
-
+#include <linux/version.h>
#include "nvidia-drm-conftest.h" /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
@@ -34,6 +34,7 @@
#include "nvidia-drm-ioctl.h"
#include <drm/drm_crtc_helper.h>
+#include <drm/drm_probe_helper.h>
#include <drm/drm_plane_helper.h>
#include <drm/drm_atomic.h>
--- a/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c 2021-03-12 08:31:39.000000000 +0100
+++ b/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c 2021-05-27 16:59:01.954385155 +0200
@@ -20,6 +20,7 @@
* DEALINGS IN THE SOFTWARE.
*/
+#include <linux/version.h>
#include "nvidia-drm-conftest.h"
#if defined(NV_DRM_AVAILABLE)
@@ -32,6 +33,8 @@
#include "nvidia-drm-helper.h"
#include "nvidia-drm-ioctl.h"
+#include "linux/dma-buf.h"
+
static inline
void __nv_drm_gem_user_memory_free(struct nv_drm_gem_object *nv_gem)
{
@@ -54,6 +57,7 @@
nv_user_memory->pages_count);
}
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 11, 0))
static void *__nv_drm_gem_user_memory_prime_vmap(
struct nv_drm_gem_object *nv_gem)
{
@@ -69,6 +73,28 @@
{
nv_drm_vunmap(address);
}
+#else
+// Updated vmap/vunmap operations to use struct dma_buf_map instead of raw pointers
+// See torvalds/linux commits ccc22d41bd9acec58cdc7c3b012e1887aba40af4, 6619ccf1bb1d0ebb071f758111efa83918b216fc
+static int __nv_drm_gem_user_memory_prime_vmap(
+ struct nv_drm_gem_object *nv_gem,
+ struct dma_buf_map *map)
+{
+ struct nv_drm_gem_user_memory *nv_user_memory = to_nv_user_memory(nv_gem);
+
+ map->vaddr = nv_drm_vmap(nv_user_memory->pages,
+ nv_user_memory->pages_count);
+ map->is_iomem = false;
+ return 0;
+}
+
+static void __nv_drm_gem_user_memory_prime_vunmap(
+ struct nv_drm_gem_object *gem,
+ struct dma_buf_map *map)
+{
+ nv_drm_vunmap(map->vaddr);
+}
+#endif
static struct nv_drm_gem_object_funcs __nv_gem_user_memory_ops = {
.free = __nv_drm_gem_user_memory_free,
--- a/kernel/common/inc/nv-time.h 2021-07-16 10:14:41.109452166 +0200
+++ b/kernel/common/inc/nv-time.h 2021-07-16 10:32:48.005141841 +0200
@@ -23,6 +23,7 @@
#ifndef __NV_TIME_H__
#define __NV_TIME_H__
+#include <linux/version.h>
#include "conftest.h"
#include <linux/time.h>
--- a/kernel/nvidia/nvlink_linux.c 2021-07-16 10:04:53.105855418 +0200
+++ b/kernel/nvidia/nvlink_linux.c 2021-07-16 10:05:17.145678779 +0200
@@ -597,7 +597,7 @@
// the requested timeout has expired, loop until less
// than a jiffie of the desired delay remains.
//
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
do
{
schedule_timeout(jiffies);
--- a/kernel/nvidia/os-interface.c 2021-07-16 10:03:26.953231474 +0200
+++ b/kernel/nvidia/os-interface.c 2021-07-16 10:03:57.469631738 +0200
@@ -580,7 +580,7 @@
// the requested timeout has expired, loop until less
// than a jiffie of the desired delay remains.
//
- current->state = TASK_INTERRUPTIBLE;
+ set_current_state(TASK_INTERRUPTIBLE);
do
{
schedule_timeout(jiffies);
--- a/kernel/nvidia-drm/nvidia-drm-drv.c
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
@@ -826,7 +826,12 @@ static void nv_drm_register_drm_device(const nv_gpu_info_t *gpu_info)
dev->dev_private = nv_dev;
nv_dev->dev = dev;
- dev->pdev = pdev;
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
+ // Rel. commit "drm: Remove pdev field from struct drm_device" (Thomas Zimmermann, 3 May 2021)
+ if (device->bus == &pci_bus_type) {
+ dev->pdev = to_pci_dev(device);
+ }
+#endif
/* Register DRM device to DRM sub-system */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment