mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-29 13:46:49 +00:00
Merge pull request #6012 from SupervisedThinking/up_xorg_server_cleanup
[le11] update & fix X11
This commit is contained in:
commit
ecb3993a10
@ -2,8 +2,8 @@
|
|||||||
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
PKG_NAME="libglvnd"
|
PKG_NAME="libglvnd"
|
||||||
PKG_VERSION="1.3.3"
|
PKG_VERSION="1.3.4"
|
||||||
PKG_SHA256="4e59c06820c97125e19e96c4b70e71d72999ff740bb92306b830bb5338b8adea"
|
PKG_SHA256="8f4218d7cdaf89d5b7eced818e810ccbc76f4bb9cba36d66eddac5a7ca892bab"
|
||||||
PKG_LICENSE="GPL"
|
PKG_LICENSE="GPL"
|
||||||
PKG_SITE="https://github.com/NVIDIA/libglvnd"
|
PKG_SITE="https://github.com/NVIDIA/libglvnd"
|
||||||
PKG_URL="https://github.com/NVIDIA/libglvnd/archive/v${PKG_VERSION}.tar.gz"
|
PKG_URL="https://github.com/NVIDIA/libglvnd/archive/v${PKG_VERSION}.tar.gz"
|
||||||
@ -17,13 +17,25 @@ fi
|
|||||||
|
|
||||||
post_makeinstall_target() {
|
post_makeinstall_target() {
|
||||||
if [ "${DISPLAYSERVER}" = "x11" ]; then
|
if [ "${DISPLAYSERVER}" = "x11" ]; then
|
||||||
# Remove old symlinks to GLVND libGL.so.1.7.0
|
# Remove old symlinks to libGL.so.1.7.0 (GLVND)
|
||||||
safe_remove ${INSTALL}/usr/lib/libGL.so
|
safe_remove ${INSTALL}/usr/lib/libGL.so
|
||||||
safe_remove ${INSTALL}/usr/lib/libGL.so.1
|
safe_remove ${INSTALL}/usr/lib/libGL.so.1
|
||||||
# Create new symlinks to /var/lib/libGL.so
|
# Create new symlinks to /var/lib/libGL.so
|
||||||
ln -sf libGL.so.1 ${INSTALL}/usr/lib/libGL.so
|
ln -sf libGL.so.1 ${INSTALL}/usr/lib/libGL.so
|
||||||
ln -sf /var/lib/libGL.so ${INSTALL}/usr/lib/libGL.so.1
|
ln -sf /var/lib/libGL.so ${INSTALL}/usr/lib/libGL.so.1
|
||||||
# Create new symlink to GLVND libGL.so.1.7.0
|
# Create new symlink to libGL.so.1.7.0
|
||||||
ln -sf libGL.so.1.7.0 ${INSTALL}/usr/lib/libGL_glvnd.so.1
|
ln -sf libGL.so.1.7.0 ${INSTALL}/usr/lib/libGL_glvnd.so.1
|
||||||
|
|
||||||
|
# Remove old symlinks to libGLX.so.0.0.0 (GLVND)
|
||||||
|
safe_remove ${INSTALL}/usr/lib/libGLX.so
|
||||||
|
safe_remove ${INSTALL}/usr/lib/libGLX.so.0
|
||||||
|
# Create new symlinks to /var/lib/libGLX.so
|
||||||
|
ln -sf libGLX.so.0 ${INSTALL}/usr/lib/libGLX.so
|
||||||
|
ln -sf /var/lib/libGLX.so ${INSTALL}/usr/lib/libGLX.so.0
|
||||||
|
# Create new symlink to libGLX.so.0.0.0
|
||||||
|
ln -sf libGLX.so.0.0.0 ${INSTALL}/usr/lib/libGLX_glvnd.so.0
|
||||||
|
|
||||||
|
# indirect rendering
|
||||||
|
ln -sf /var/lib/libGLX_indirect.so.0 ${INSTALL}/usr/lib/libGLX_indirect.so.0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
From ae7174b3dbaefac0723a51c1c9f5f7cc004ca7cc Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jan Beich <jbeich@FreeBSD.org>
|
||||||
|
Date: Sun, 31 Oct 2021 07:32:18 +0000
|
||||||
|
Subject: [PATCH] VA/X11: VAAPI driver mapping for crocus DRI driver
|
||||||
|
|
||||||
|
crocus supports Gen4 to Gen7.5, so only i965 can be used.
|
||||||
|
---
|
||||||
|
va/x11/va_x11.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/va/x11/va_x11.c b/va/x11/va_x11.c
|
||||||
|
index 4d06acd2..9687afaf 100644
|
||||||
|
--- a/va/x11/va_x11.c
|
||||||
|
+++ b/va/x11/va_x11.c
|
||||||
|
@@ -55,6 +55,7 @@ static const struct driver_name_map g_dri2_driver_name_map[] = {
|
||||||
|
{ "i965", 4, "i965" }, // Intel i965 VAAPI driver with i965 DRI driver
|
||||||
|
{ "iris", 4, "iHD" }, // Intel iHD VAAPI driver with iris DRI driver
|
||||||
|
{ "iris", 4, "i965" }, // Intel i965 VAAPI driver with iris DRI driver
|
||||||
|
+ { "crocus", 6, "i965" }, // Intel i965 VAAPI driver with crocus DRI driver
|
||||||
|
{ NULL, 0, NULL }
|
||||||
|
};
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
From 514f68b5dd8f84a4b6f215a0808ba1aef9568366 Mon Sep 17 00:00:00 2001
|
|
||||||
From: MilhouseVH <milhouseVH.github@nmacleod.com>
|
|
||||||
Date: Mon, 13 Apr 2020 01:24:35 +0100
|
|
||||||
Subject: [PATCH] fix build with 5.7-rc1
|
|
||||||
|
|
||||||
legacy variant of: https://gitlab.com/snippets/1965550
|
|
||||||
|
|
||||||
credit: Isaak I. Aleksandrov
|
|
||||||
---
|
|
||||||
kernel/conftest.sh | 4 ++++
|
|
||||||
1 file changed, 4 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
|
|
||||||
index 83700ad..5a0ce4d 100755
|
|
||||||
--- a/kernel/conftest.sh
|
|
||||||
+++ b/kernel/conftest.sh
|
|
||||||
@@ -177,6 +177,7 @@ test_headers() {
|
|
||||||
FILES="$FILES linux/file.h"
|
|
||||||
|
|
||||||
FILES_ARCH="$FILES_ARCH asm/set_memory.h"
|
|
||||||
+ FILES_ARCH="$FILES_ARCH asm/pgtable.h"
|
|
||||||
|
|
||||||
translate_and_find_header_files $HEADERS $FILES
|
|
||||||
translate_and_find_header_files $HEADERS_ARCH $FILES_ARCH
|
|
||||||
@@ -440,6 +441,9 @@ compile_test() {
|
|
||||||
# Determine if the set_memory_array_uc() function is present.
|
|
||||||
#
|
|
||||||
CODE="
|
|
||||||
+ #if defined(NV_ASM_PGTABLE_H_PRESENT)
|
|
||||||
+ #include <asm/pgtable.h>
|
|
||||||
+ #endif
|
|
||||||
#if defined(NV_ASM_SET_MEMORY_H_PRESENT)
|
|
||||||
#include <asm/set_memory.h>
|
|
||||||
#else
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,156 +0,0 @@
|
|||||||
From a955b00bb4fc5f60f2b17f33e96d110bf0a605e1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: MilhouseVH <milhouseVH.github@nmacleod.com>
|
|
||||||
Date: Mon, 13 Apr 2020 01:47:06 +0100
|
|
||||||
Subject: [PATCH] HACK: implement the pci/agp support marked legacy in 5.7-rc1
|
|
||||||
|
|
||||||
drm_get_pci_dev: https://github.com/torvalds/linux/commit/c393fbae0226e9ad8719a516bec66bb2b8bbfcb6
|
|
||||||
drm_pci_agp_init: https://github.com/torvalds/linux/commit/ee21ec7767621c1adb0a388e0e7d841674cdc43f
|
|
||||||
---
|
|
||||||
kernel/nv-drm.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++++
|
|
||||||
1 file changed, 131 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
|
|
||||||
index 2e4b867..059f258 100644
|
|
||||||
--- a/kernel/nv-drm.c
|
|
||||||
+++ b/kernel/nv-drm.c
|
|
||||||
@@ -51,6 +51,137 @@
|
|
||||||
#define nv_drm_pci_init drm_legacy_pci_init
|
|
||||||
#define nv_drm_pci_exit drm_legacy_pci_exit
|
|
||||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
|
||||||
+
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
|
|
||||||
+#include <drm/drm_agpsupport.h>
|
|
||||||
+
|
|
||||||
+struct drm_agp_mem {
|
|
||||||
+ unsigned long handle;
|
|
||||||
+ struct agp_memory *memory;
|
|
||||||
+ unsigned long bound;
|
|
||||||
+ int pages;
|
|
||||||
+ struct list_head head;
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * drm_legacy_agp_clear - Clear AGP resource list
|
|
||||||
+ * @dev: DRM device
|
|
||||||
+ *
|
|
||||||
+ * Iterate over all AGP resources and remove them. But keep the AGP head
|
|
||||||
+ * intact so it can still be used. It is safe to call this if AGP is disabled or
|
|
||||||
+ * was already removed.
|
|
||||||
+ *
|
|
||||||
+ * Cleanup is only done for drivers who have DRIVER_LEGACY set.
|
|
||||||
+ */
|
|
||||||
+void drm_legacy_agp_clear(struct drm_device *dev)
|
|
||||||
+{
|
|
||||||
+ struct drm_agp_mem *entry, *tempe;
|
|
||||||
+
|
|
||||||
+ if (!dev->agp)
|
|
||||||
+ return;
|
|
||||||
+ if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
|
|
||||||
+ if (entry->bound)
|
|
||||||
+ agp_unbind_memory(entry->memory);
|
|
||||||
+ agp_free_memory(entry->memory);
|
|
||||||
+ kfree(entry);
|
|
||||||
+ }
|
|
||||||
+ INIT_LIST_HEAD(&dev->agp->memory);
|
|
||||||
+
|
|
||||||
+ if (dev->agp->acquired)
|
|
||||||
+ drm_agp_release(dev);
|
|
||||||
+
|
|
||||||
+ dev->agp->acquired = 0;
|
|
||||||
+ dev->agp->enabled = 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void drm_pci_agp_init(struct drm_device *dev)
|
|
||||||
+{
|
|
||||||
+ if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
|
|
||||||
+ if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
|
|
||||||
+ dev->agp = drm_agp_init(dev);
|
|
||||||
+ if (dev->agp) {
|
|
||||||
+ dev->agp->agp_mtrr = arch_phys_wc_add(
|
|
||||||
+ dev->agp->agp_info.aper_base,
|
|
||||||
+ dev->agp->agp_info.aper_size *
|
|
||||||
+ 1024 * 1024);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+void drm_pci_agp_destroy(struct drm_device *dev)
|
|
||||||
+{
|
|
||||||
+ if (dev->agp) {
|
|
||||||
+ arch_phys_wc_del(dev->agp->agp_mtrr);
|
|
||||||
+ drm_legacy_agp_clear(dev);
|
|
||||||
+ kfree(dev->agp);
|
|
||||||
+ dev->agp = NULL;
|
|
||||||
+ }
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+/**
|
|
||||||
+ * drm_get_pci_dev - Register a PCI device with the DRM subsystem
|
|
||||||
+ * @pdev: PCI device
|
|
||||||
+ * @ent: entry from the PCI ID table that matches @pdev
|
|
||||||
+ * @driver: DRM device driver
|
|
||||||
+ *
|
|
||||||
+ * Attempt to gets inter module "drm" information. If we are first
|
|
||||||
+ * then register the character device and inter module information.
|
|
||||||
+ * Try and register, if we fail to register, backout previous work.
|
|
||||||
+ *
|
|
||||||
+ * NOTE: This function is deprecated, please use drm_dev_alloc() and
|
|
||||||
+ * drm_dev_register() instead and remove your &drm_driver.load callback.
|
|
||||||
+ *
|
|
||||||
+ * Return: 0 on success or a negative error code on failure.
|
|
||||||
+ */
|
|
||||||
+int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent,
|
|
||||||
+ struct drm_driver *driver)
|
|
||||||
+{
|
|
||||||
+ struct drm_device *dev;
|
|
||||||
+ int ret;
|
|
||||||
+
|
|
||||||
+ DRM_DEBUG("\n");
|
|
||||||
+
|
|
||||||
+ dev = drm_dev_alloc(driver, &pdev->dev);
|
|
||||||
+ if (IS_ERR(dev))
|
|
||||||
+ return PTR_ERR(dev);
|
|
||||||
+
|
|
||||||
+ ret = pci_enable_device(pdev);
|
|
||||||
+ if (ret)
|
|
||||||
+ goto err_free;
|
|
||||||
+
|
|
||||||
+ dev->pdev = pdev;
|
|
||||||
+#ifdef __alpha__
|
|
||||||
+ dev->hose = pdev->sysdata;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
|
|
||||||
+ pci_set_drvdata(pdev, dev);
|
|
||||||
+
|
|
||||||
+ drm_pci_agp_init(dev);
|
|
||||||
+
|
|
||||||
+ ret = drm_dev_register(dev, ent->driver_data);
|
|
||||||
+ if (ret)
|
|
||||||
+ goto err_agp;
|
|
||||||
+
|
|
||||||
+ /* No locking needed since shadow-attach is single-threaded since it may
|
|
||||||
+ * only be called from the per-driver module init hook. */
|
|
||||||
+ if (drm_core_check_feature(dev, DRIVER_LEGACY))
|
|
||||||
+ list_add_tail(&dev->legacy_dev_list, &driver->legacy_dev_list);
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
+
|
|
||||||
+err_agp:
|
|
||||||
+ drm_pci_agp_destroy(dev);
|
|
||||||
+ pci_disable_device(pdev);
|
|
||||||
+err_free:
|
|
||||||
+ drm_dev_put(dev);
|
|
||||||
+ return ret;
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
int nv_drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
|
|
||||||
{
|
|
||||||
struct pci_dev *pdev = NULL;
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -1,57 +0,0 @@
|
|||||||
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nvidia-modules-common.mk NVIDIA-Linux-x86_64-340.108-new/kernel/nvidia-modules-common.mk
|
|
||||||
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nvidia-modules-common.mk 2019-12-11 23:04:24.000000000 +0100
|
|
||||||
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nvidia-modules-common.mk 2020-08-04 16:18:14.073333322 +0200
|
|
||||||
@@ -222,6 +222,7 @@
|
|
||||||
define BUILD_MODULE_RULE
|
|
||||||
$(1): build-sanity-checks $(3)
|
|
||||||
@echo "NVIDIA: calling KBUILD..."; \
|
|
||||||
+ touch .nv-kernel.o.cmd; \
|
|
||||||
$$(MAKE) "CC=$$(CC)" NV_MODULE_SUFFIX=$$(strip $(2)) $$(KBUILD_PARAMS) modules; \
|
|
||||||
echo "NVIDIA: left KBUILD."; \
|
|
||||||
if ! [ -f $(1) ]; then \
|
|
||||||
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv-linux.h NVIDIA-Linux-x86_64-340.108-new/kernel/nv-linux.h
|
|
||||||
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nv-linux.h 2020-08-01 20:34:33.900000000 +0200
|
|
||||||
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv-linux.h 2020-08-03 13:10:17.693333317 +0200
|
|
||||||
@@ -669,11 +669,19 @@
|
|
||||||
# define KM_FREE_RECORD(a,b,c)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
|
||||||
+#define NV_VMALLOC(ptr, size) \
|
|
||||||
+ { \
|
|
||||||
+ (ptr) = __vmalloc(size, GFP_KERNEL); \
|
|
||||||
+ VM_ALLOC_RECORD(ptr, size, "vm_vmalloc"); \
|
|
||||||
+ }
|
|
||||||
+#else
|
|
||||||
#define NV_VMALLOC(ptr, size) \
|
|
||||||
{ \
|
|
||||||
(ptr) = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL); \
|
|
||||||
VM_ALLOC_RECORD(ptr, size, "vm_vmalloc"); \
|
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
#define NV_VFREE(ptr, size) \
|
|
||||||
{ \
|
|
||||||
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/os-mlock.c NVIDIA-Linux-x86_64-340.108-new/kernel/os-mlock.c
|
|
||||||
--- NVIDIA-Linux-x86_64-340.108-old/kernel/os-mlock.c 2019-12-11 23:04:24.000000000 +0100
|
|
||||||
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/os-mlock.c 2020-08-03 13:11:06.536666663 +0200
|
|
||||||
@@ -44,11 +44,19 @@
|
|
||||||
return rmStatus;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
|
||||||
+ down_read(&mm->mmap_lock);
|
|
||||||
+ ret = NV_GET_USER_PAGES((unsigned long)address,
|
|
||||||
+ page_count, write, force, user_pages, NULL);
|
|
||||||
+ up_read(&mm->mmap_lock);
|
|
||||||
+ pinned = ret;
|
|
||||||
+#else
|
|
||||||
down_read(&mm->mmap_sem);
|
|
||||||
ret = NV_GET_USER_PAGES((unsigned long)address,
|
|
||||||
page_count, write, force, user_pages, NULL);
|
|
||||||
up_read(&mm->mmap_sem);
|
|
||||||
pinned = ret;
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
{
|
|
@ -1,76 +0,0 @@
|
|||||||
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv.c NVIDIA-Linux-x86_64-340.108-new/kernel/nv.c
|
|
||||||
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nv.c 2020-08-26 14:28:09.350000000 +0200
|
|
||||||
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv.c 2020-08-26 14:35:42.856666666 +0200
|
|
||||||
@@ -2785,8 +2785,12 @@
|
|
||||||
|
|
||||||
#if defined(CONFIG_VGA_ARB)
|
|
||||||
#if defined(VGA_DEFAULT_DEVICE)
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
|
||||||
+ vga_get(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK, 0);
|
|
||||||
+#else
|
|
||||||
vga_tryget(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK);
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
vga_set_legacy_decoding(dev, VGA_RSRC_NONE);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c
|
|
||||||
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c 2020-08-26 14:28:09.506666667 +0200
|
|
||||||
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c 2020-08-26 14:48:58.443333335 +0200
|
|
||||||
@@ -373,7 +373,11 @@
|
|
||||||
.set_busid = drm_pci_set_busid,
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
|
||||||
+ .gem_free_object_unlocked = nv_gem_free,
|
|
||||||
+#else
|
|
||||||
.gem_free_object = nv_gem_free,
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
|
|
||||||
.gem_prime_export = drm_gem_prime_export,
|
|
||||||
@@ -470,8 +474,14 @@
|
|
||||||
#if defined(NV_DRM_GEM_OBJECT_PUT_UNLOCKED_PRESENT)
|
|
||||||
drm_gem_object_put_unlocked(&nv_obj->base);
|
|
||||||
#else
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
|
|
||||||
+ drm_gem_object_put(&nv_obj->base);
|
|
||||||
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
|
||||||
+ drm_gem_object_put_locked(&nv_obj->base);
|
|
||||||
+#else
|
|
||||||
drm_gem_object_unreference_unlocked(&nv_obj->base);
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
status = RM_OK;
|
|
||||||
|
|
||||||
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv-linux.h NVIDIA-Linux-x86_64-340.108-new/kernel/nv-linux.h
|
|
||||||
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nv-linux.h 2020-08-26 14:28:09.583333333 +0200
|
|
||||||
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv-linux.h 2020-08-26 14:53:45.693333299 +0200
|
|
||||||
@@ -136,8 +136,10 @@
|
|
||||||
|
|
||||||
#if defined(NVCPU_X86_64) && !defined(HAVE_COMPAT_IOCTL)
|
|
||||||
#include <linux/syscalls.h> /* sys_ioctl() */
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
|
|
||||||
#include <linux/ioctl32.h> /* register_ioctl32_conversion() */
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
#if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \
|
|
||||||
!defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL)
|
|
||||||
@@ -2249,10 +2251,13 @@
|
|
||||||
pages, vmas, NULL);
|
|
||||||
|
|
||||||
#else
|
|
||||||
-
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
|
||||||
+ return get_user_pages_remote(mm, start, nr_pages, flags,
|
|
||||||
+ pages, vmas, NULL);
|
|
||||||
+#else
|
|
||||||
return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
|
|
||||||
pages, vmas);
|
|
||||||
-
|
|
||||||
+#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
--- NVIDIA-Linux-x86_64-340.108-orig/kernel/nv-drm.c 2020-12-14 19:58:21.951120294 +0100
|
|
||||||
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c 2020-12-14 20:30:05.855962292 +0100
|
|
||||||
@@ -365,7 +365,11 @@
|
|
||||||
struct nv_gem_object *nv_obj = container_of(obj, struct nv_gem_object, base);
|
|
||||||
int page_count = obj->size >> PAGE_SHIFT;
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
|
|
||||||
+ return drm_prime_pages_to_sg(obj->dev, nv_obj->pages, page_count);
|
|
||||||
+#else
|
|
||||||
return drm_prime_pages_to_sg(nv_obj->pages, page_count);
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void* nv_gem_prime_vmap(
|
|
@ -1,5 +1,26 @@
|
|||||||
|
From 2154cc447a2377cfd60a7b7c5b619e689ebf71b1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: graysky <graysky@archlinux.us>
|
||||||
|
Date: Thu, 22 Oct 2020 06:58:53 -0400
|
||||||
|
Subject: [PATCH 1/3] kernel-5.7
|
||||||
|
|
||||||
|
credit: https://gitlab.manjaro.org/packages?utf8=%E2%9C%93&filter=nvidia-340xx
|
||||||
|
---
|
||||||
|
kernel/Makefile | 5 +
|
||||||
|
kernel/conftest.sh | 81 +++++++++++++
|
||||||
|
kernel/dkms.conf | 8 +-
|
||||||
|
kernel/nv-drm.c | 229 ++++++++++++++++++++++++++++++++++-
|
||||||
|
kernel/nv-linux.h | 49 ++++++++
|
||||||
|
kernel/nv-procfs.c | 20 +++
|
||||||
|
kernel/nv-time.h | 9 +-
|
||||||
|
kernel/nv.c | 2 +-
|
||||||
|
kernel/os-interface.c | 8 +-
|
||||||
|
kernel/uvm/Makefile | 1 +
|
||||||
|
kernel/uvm/conftest.sh | 4 +
|
||||||
|
kernel/uvm/nvidia_uvm_lite.c | 29 ++++-
|
||||||
|
12 files changed, 431 insertions(+), 14 deletions(-)
|
||||||
|
|
||||||
diff --git a/kernel/Makefile b/kernel/Makefile
|
diff --git a/kernel/Makefile b/kernel/Makefile
|
||||||
index 125a690..a36cc63 100644
|
index 125a690..2597080 100644
|
||||||
--- a/kernel/Makefile
|
--- a/kernel/Makefile
|
||||||
+++ b/kernel/Makefile
|
+++ b/kernel/Makefile
|
||||||
@@ -108,12 +108,14 @@ COMPILE_TESTS = \
|
@@ -108,12 +108,14 @@ COMPILE_TESTS = \
|
||||||
@ -25,11 +46,38 @@ index 125a690..a36cc63 100644
|
|||||||
sg_alloc_table \
|
sg_alloc_table \
|
||||||
sg_init_table \
|
sg_init_table \
|
||||||
pci_get_domain_bus_and_slot \
|
pci_get_domain_bus_and_slot \
|
||||||
|
@@ -147,6 +150,8 @@ COMPILE_TESTS = \
|
||||||
|
vm_fault_present \
|
||||||
|
vm_fault_has_address \
|
||||||
|
drm_driver_unload_has_int_return_type \
|
||||||
|
+ drm_get_pci_dev \
|
||||||
|
+ drm_pci_init \
|
||||||
|
drm_legacy_pci_init \
|
||||||
|
timer_setup \
|
||||||
|
do_gettimeofday \
|
||||||
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
|
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
|
||||||
index b7a85f0..83700ad 100755
|
index b7a85f0..a5225e5 100755
|
||||||
--- a/kernel/conftest.sh
|
--- a/kernel/conftest.sh
|
||||||
+++ b/kernel/conftest.sh
|
+++ b/kernel/conftest.sh
|
||||||
@@ -914,6 +914,21 @@ compile_test() {
|
@@ -176,6 +176,7 @@ test_headers() {
|
||||||
|
FILES="$FILES linux/ktime.h"
|
||||||
|
FILES="$FILES linux/file.h"
|
||||||
|
|
||||||
|
+ FILES_ARCH="$FILES_ARCH asm/pgtable.h"
|
||||||
|
FILES_ARCH="$FILES_ARCH asm/set_memory.h"
|
||||||
|
|
||||||
|
translate_and_find_header_files $HEADERS $FILES
|
||||||
|
@@ -440,6 +441,9 @@ compile_test() {
|
||||||
|
# Determine if the set_memory_array_uc() function is present.
|
||||||
|
#
|
||||||
|
CODE="
|
||||||
|
+ #if defined(NV_ASM_PGTABLE_H_PRESENT)
|
||||||
|
+ #include <asm/pgtable.h>
|
||||||
|
+ #endif
|
||||||
|
#if defined(NV_ASM_SET_MEMORY_H_PRESENT)
|
||||||
|
#include <asm/set_memory.h>
|
||||||
|
#else
|
||||||
|
@@ -914,6 +918,21 @@ compile_test() {
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -51,7 +99,7 @@ index b7a85f0..83700ad 100755
|
|||||||
smp_call_function)
|
smp_call_function)
|
||||||
#
|
#
|
||||||
# Determine if the smp_call_function() function is
|
# Determine if the smp_call_function() function is
|
||||||
@@ -1188,6 +1203,22 @@ compile_test() {
|
@@ -1188,6 +1207,22 @@ compile_test() {
|
||||||
compile_check_conftest "$CODE" "NV_IOREMAP_CACHE_PRESENT" "" "functions"
|
compile_check_conftest "$CODE" "NV_IOREMAP_CACHE_PRESENT" "" "functions"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -74,7 +122,7 @@ index b7a85f0..83700ad 100755
|
|||||||
ioremap_wc)
|
ioremap_wc)
|
||||||
#
|
#
|
||||||
# Determine if the ioremap_wc() function is present.
|
# Determine if the ioremap_wc() function is present.
|
||||||
@@ -1371,6 +1402,16 @@ compile_test() {
|
@@ -1371,6 +1406,16 @@ compile_test() {
|
||||||
compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL" "" "types"
|
compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL" "" "types"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
@ -91,6 +139,49 @@ index b7a85f0..83700ad 100755
|
|||||||
sg_init_table)
|
sg_init_table)
|
||||||
#
|
#
|
||||||
# Determine if the sg_init_table() function is present.
|
# Determine if the sg_init_table() function is present.
|
||||||
|
@@ -2044,6 +2089,42 @@ compile_test() {
|
||||||
|
compile_check_conftest "$CODE" "NV_DRM_DRIVER_UNLOAD_HAS_INT_RETURN_TYPE" "" "types"
|
||||||
|
;;
|
||||||
|
|
||||||
|
+ drm_get_pci_dev)
|
||||||
|
+ #
|
||||||
|
+ # Determine if drm_get_pci_dev() is present.
|
||||||
|
+ #
|
||||||
|
+ CODE="
|
||||||
|
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||||
|
+ #include <drm/drmP.h>
|
||||||
|
+ #endif
|
||||||
|
+
|
||||||
|
+ #if defined(NV_DRM_DRM_PCI_H_PRESENT)
|
||||||
|
+ #include <drm/drm_pci.h>
|
||||||
|
+ #endif
|
||||||
|
+
|
||||||
|
+ void conftest_drm_legacy_pci_init(void) {
|
||||||
|
+ drm_get_pci_dev();
|
||||||
|
+ }"
|
||||||
|
+
|
||||||
|
+ compile_check_conftest "$CODE" "NV_DRM_GET_PCI_DEV_PRESENT" "" "functions"
|
||||||
|
+ ;;
|
||||||
|
+
|
||||||
|
+ drm_pci_init)
|
||||||
|
+ #
|
||||||
|
+ # Determine if drm_pci_init() is present.
|
||||||
|
+ #
|
||||||
|
+ CODE="
|
||||||
|
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||||
|
+ #include <drm/drmP.h>
|
||||||
|
+ #endif
|
||||||
|
+
|
||||||
|
+ void conftest_drm_legacy_pci_init(void) {
|
||||||
|
+ drm_pci_init();
|
||||||
|
+ }"
|
||||||
|
+
|
||||||
|
+ compile_check_conftest "$CODE" "NV_DRM_PCI_INIT_PRESENT" "" "functions"
|
||||||
|
+ ;;
|
||||||
|
+
|
||||||
|
drm_legacy_pci_init)
|
||||||
|
#
|
||||||
|
# Determine if drm_legacy_pci_init() is present. drm_pci_init() was
|
||||||
diff --git a/kernel/dkms.conf b/kernel/dkms.conf
|
diff --git a/kernel/dkms.conf b/kernel/dkms.conf
|
||||||
index 79a02ae..3140f03 100644
|
index 79a02ae..3140f03 100644
|
||||||
--- a/kernel/dkms.conf
|
--- a/kernel/dkms.conf
|
||||||
@ -111,70 +202,247 @@ index 79a02ae..3140f03 100644
|
|||||||
CLEAN="make clean"
|
CLEAN="make clean"
|
||||||
AUTOINSTALL="yes"
|
AUTOINSTALL="yes"
|
||||||
diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
|
diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
|
||||||
index 0d1cdbf..2e4b867 100644
|
index 0d1cdbf..85db07e 100644
|
||||||
--- a/kernel/nv-drm.c
|
--- a/kernel/nv-drm.c
|
||||||
+++ b/kernel/nv-drm.c
|
+++ b/kernel/nv-drm.c
|
||||||
@@ -50,6 +50,60 @@
|
@@ -50,9 +50,236 @@
|
||||||
#if defined(NV_DRM_LEGACY_PCI_INIT_PRESENT)
|
#if defined(NV_DRM_LEGACY_PCI_INIT_PRESENT)
|
||||||
#define nv_drm_pci_init drm_legacy_pci_init
|
#define nv_drm_pci_init drm_legacy_pci_init
|
||||||
#define nv_drm_pci_exit drm_legacy_pci_exit
|
#define nv_drm_pci_exit drm_legacy_pci_exit
|
||||||
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
-#else
|
||||||
|
+#elif defined(NV_DRM_PCI_INIT_PRESENT)
|
||||||
|
#define nv_drm_pci_init drm_pci_init
|
||||||
|
#define nv_drm_pci_exit drm_pci_exit
|
||||||
|
+#else
|
||||||
|
+#if defined(NV_DRM_GET_PCI_DEV_PRESENT)
|
||||||
|
+#define nv_drm_get_pci_dev drm_get_pci_dev
|
||||||
|
+#else
|
||||||
|
+#include <drm/drm_agpsupport.h>
|
||||||
|
+
|
||||||
|
+struct nv_drm_agp_head {
|
||||||
|
+ struct agp_kern_info agp_info;
|
||||||
|
+ struct list_head memory;
|
||||||
|
+ unsigned long mode;
|
||||||
|
+ struct agp_bridge_data *bridge;
|
||||||
|
+ int enabled;
|
||||||
|
+ int acquired;
|
||||||
|
+ unsigned long base;
|
||||||
|
+ int agp_mtrr;
|
||||||
|
+ int cant_use_aperture;
|
||||||
|
+ unsigned long page_mask;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+struct nv_drm_agp_mem {
|
||||||
|
+ unsigned long handle;
|
||||||
|
+ struct agp_memory *memory;
|
||||||
|
+ unsigned long bound;
|
||||||
|
+ int pages;
|
||||||
|
+ struct list_head head;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Code from drm_agp_init/nv_drm_{free,unbind}_agp
|
||||||
|
+ * Extracted from commit: 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94, file: drivers/gpu/drm/drm_agpsupport.c
|
||||||
|
+ */
|
||||||
|
+struct drm_agp_head *nv_drm_agp_init(struct drm_device *dev)
|
||||||
|
+{
|
||||||
|
+ struct nv_drm_agp_head *head = NULL;
|
||||||
|
+
|
||||||
|
+ head = kzalloc(sizeof(*head), GFP_KERNEL);
|
||||||
|
+ if (!head)
|
||||||
|
+ return NULL;
|
||||||
|
+ head->bridge = agp_find_bridge(dev->pdev);
|
||||||
|
+ if (!head->bridge) {
|
||||||
|
+ head->bridge = agp_backend_acquire(dev->pdev);
|
||||||
|
+ if (!head->bridge) {
|
||||||
|
+ kfree(head);
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+ agp_copy_info(head->bridge, &head->agp_info);
|
||||||
|
+ agp_backend_release(head->bridge);
|
||||||
|
+ } else {
|
||||||
|
+ agp_copy_info(head->bridge, &head->agp_info);
|
||||||
|
+ }
|
||||||
|
+ if (head->agp_info.chipset == NOT_SUPPORTED) {
|
||||||
|
+ kfree(head);
|
||||||
|
+ return NULL;
|
||||||
|
+ }
|
||||||
|
+ INIT_LIST_HEAD(&head->memory);
|
||||||
|
+ head->cant_use_aperture = head->agp_info.cant_use_aperture;
|
||||||
|
+ head->page_mask = head->agp_info.page_mask;
|
||||||
|
+ head->base = head->agp_info.aper_base;
|
||||||
|
+ return (struct drm_agp_head *)head;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void nv_drm_free_agp(struct agp_memory *handle, int pages)
|
||||||
|
+{
|
||||||
|
+ agp_free_memory(handle);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int nv_drm_unbind_agp(struct agp_memory *handle)
|
||||||
|
+{
|
||||||
|
+ return agp_unbind_memory(handle);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Code from drm_pci_agp_{clear,destroy,init}/drm_get_pci_dev
|
||||||
|
+ * Extracted from commit: 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94, file: drivers/gpu/drm/drm_pci.c
|
||||||
|
+ */
|
||||||
|
+static void nv_drm_pci_agp_init(struct drm_device *dev)
|
||||||
|
+{
|
||||||
|
+ if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
|
||||||
|
+ if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
|
||||||
|
+ dev->agp = nv_drm_agp_init(dev);
|
||||||
|
+ if (dev->agp) {
|
||||||
|
+ dev->agp->agp_mtrr = arch_phys_wc_add(
|
||||||
|
+ dev->agp->agp_info.aper_base,
|
||||||
|
+ dev->agp->agp_info.aper_size *
|
||||||
|
+ 1024 * 1024);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void nv_drm_legacy_agp_clear(struct drm_device *dev)
|
||||||
|
+{
|
||||||
|
+ struct nv_drm_agp_mem *entry, *tempe;
|
||||||
|
+
|
||||||
|
+ if (!dev->agp)
|
||||||
|
+ return;
|
||||||
|
+ if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||||
|
+ return;
|
||||||
|
+
|
||||||
|
+ list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
|
||||||
|
+ if (entry->bound)
|
||||||
|
+ nv_drm_unbind_agp(entry->memory);
|
||||||
|
+ nv_drm_free_agp(entry->memory, entry->pages);
|
||||||
|
+ kfree(entry);
|
||||||
|
+ }
|
||||||
|
+ INIT_LIST_HEAD(&dev->agp->memory);
|
||||||
|
+
|
||||||
|
+ if (dev->agp->acquired)
|
||||||
|
+ drm_agp_release(dev);
|
||||||
|
+
|
||||||
|
+ dev->agp->acquired = 0;
|
||||||
|
+ dev->agp->enabled = 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void nv_drm_pci_agp_destroy(struct drm_device *dev)
|
||||||
|
+{
|
||||||
|
+ if (dev->agp) {
|
||||||
|
+ arch_phys_wc_del(dev->agp->agp_mtrr);
|
||||||
|
+ nv_drm_legacy_agp_clear(dev);
|
||||||
|
+ kfree(dev->agp);
|
||||||
|
+ dev->agp = NULL;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static int nv_drm_get_pci_dev(struct pci_dev *pdev,
|
||||||
|
+ const struct pci_device_id *ent,
|
||||||
|
+ struct drm_driver *driver)
|
||||||
|
+{
|
||||||
|
+ struct drm_device *dev;
|
||||||
|
+ int ret;
|
||||||
|
+
|
||||||
|
+ DRM_DEBUG("\n");
|
||||||
|
+
|
||||||
|
+ dev = drm_dev_alloc(driver, &pdev->dev);
|
||||||
|
+ if (IS_ERR(dev))
|
||||||
|
+ return PTR_ERR(dev);
|
||||||
|
+
|
||||||
|
+ ret = pci_enable_device(pdev);
|
||||||
|
+ if (ret)
|
||||||
|
+ goto err_free;
|
||||||
|
+
|
||||||
|
+ dev->pdev = pdev;
|
||||||
|
+#ifdef __alpha__
|
||||||
|
+ dev->hose = pdev->sysdata;
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
|
||||||
|
+ pci_set_drvdata(pdev, dev);
|
||||||
|
+
|
||||||
|
+ nv_drm_pci_agp_init(dev);
|
||||||
|
+
|
||||||
|
+ ret = drm_dev_register(dev, ent->driver_data);
|
||||||
|
+ if (ret)
|
||||||
|
+ goto err_agp;
|
||||||
|
+
|
||||||
|
+ /* No locking needed since shadow-attach is single-threaded since it may
|
||||||
|
+ * only be called from the per-driver module init hook. */
|
||||||
|
+ if (drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||||
|
+ list_add_tail(&dev->legacy_dev_list, &driver->legacy_dev_list);
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+
|
||||||
|
+err_agp:
|
||||||
|
+ nv_drm_pci_agp_destroy(dev);
|
||||||
|
+ pci_disable_device(pdev);
|
||||||
|
+err_free:
|
||||||
|
+ drm_dev_put(dev);
|
||||||
|
+ return ret;
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
+ * Code from drm_legacy_pci_{init,exit}
|
||||||
|
+ * Extracted from tag: v5.6.3, file: drivers/gpu/drm/drm_pci.c
|
||||||
|
+ */
|
||||||
+int nv_drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
|
+int nv_drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
|
||||||
+{
|
+{
|
||||||
+ struct pci_dev *pdev = NULL;
|
+ struct pci_dev *pdev = NULL;
|
||||||
+ const struct pci_device_id *pid;
|
+ const struct pci_device_id *pid;
|
||||||
+ int i;
|
+ int i;
|
||||||
+
|
+
|
||||||
+ DRM_DEBUG("\n");
|
+ DRM_DEBUG("\n");
|
||||||
+
|
+
|
||||||
+ if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY)))
|
+ if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY)))
|
||||||
+ return -EINVAL;
|
+ return -EINVAL;
|
||||||
+
|
+
|
||||||
+ /* If not using KMS, fall back to stealth mode manual scanning. */
|
+ /* If not using KMS, fall back to stealth mode manual scanning. */
|
||||||
+ INIT_LIST_HEAD(&driver->legacy_dev_list);
|
+ INIT_LIST_HEAD(&driver->legacy_dev_list);
|
||||||
+ for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
|
+ for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
|
||||||
+ pid = &pdriver->id_table[i];
|
+ pid = &pdriver->id_table[i];
|
||||||
+
|
+
|
||||||
+ /* Loop around setting up a DRM device for each PCI device
|
+ /* Loop around setting up a DRM device for each PCI device
|
||||||
+ * matching our ID and device class. If we had the internal
|
+ * matching our ID and device class. If we had the internal
|
||||||
+ * function that pci_get_subsys and pci_get_class used, we'd
|
+ * function that pci_get_subsys and pci_get_class used, we'd
|
||||||
+ * be able to just pass pid in instead of doing a two-stage
|
+ * be able to just pass pid in instead of doing a two-stage
|
||||||
+ * thing.
|
+ * thing.
|
||||||
+ */
|
+ */
|
||||||
+ pdev = NULL;
|
+ pdev = NULL;
|
||||||
+ while ((pdev =
|
+ while ((pdev =
|
||||||
+ pci_get_subsys(pid->vendor, pid->device, pid->subvendor,
|
+ pci_get_subsys(pid->vendor, pid->device, pid->subvendor,
|
||||||
+ pid->subdevice, pdev)) != NULL) {
|
+ pid->subdevice, pdev)) != NULL) {
|
||||||
+ if ((pdev->class & pid->class_mask) != pid->class)
|
+ if ((pdev->class & pid->class_mask) != pid->class)
|
||||||
+ continue;
|
+ continue;
|
||||||
+
|
+
|
||||||
+ /* stealth mode requires a manual probe */
|
+ /* stealth mode requires a manual probe */
|
||||||
+ pci_dev_get(pdev);
|
+ pci_dev_get(pdev);
|
||||||
+ drm_get_pci_dev(pdev, pid, driver);
|
+ nv_drm_get_pci_dev(pdev, pid, driver);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
+void nv_drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
|
+void nv_drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
|
||||||
+{
|
+{
|
||||||
+ struct drm_device *dev, *tmp;
|
+ struct drm_device *dev, *tmp;
|
||||||
+ DRM_DEBUG("\n");
|
+ DRM_DEBUG("\n");
|
||||||
+
|
+
|
||||||
+ if (!(driver->driver_features & DRIVER_LEGACY)) {
|
+ if (!(driver->driver_features & DRIVER_LEGACY)) {
|
||||||
+ WARN_ON(1);
|
+ WARN_ON(1);
|
||||||
+ } else {
|
+ } else {
|
||||||
+ list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
|
+ list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
|
||||||
+ legacy_dev_list) {
|
+ legacy_dev_list) {
|
||||||
+ list_del(&dev->legacy_dev_list);
|
+ list_del(&dev->legacy_dev_list);
|
||||||
+ drm_put_dev(dev);
|
+ drm_put_dev(dev);
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+ DRM_INFO("Module unloaded\n");
|
+ DRM_INFO("Module unloaded\n");
|
||||||
+}
|
+}
|
||||||
#else
|
#endif
|
||||||
#define nv_drm_pci_init drm_pci_init
|
|
||||||
#define nv_drm_pci_exit drm_pci_exit
|
extern nv_linux_state_t *nv_linux_devices;
|
||||||
diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
|
diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
|
||||||
index a1d2c68..83e6433 100644
|
index a1d2c68..83e6433 100644
|
||||||
--- a/kernel/nv-linux.h
|
--- a/kernel/nv-linux.h
|
||||||
@ -413,6 +681,28 @@ index 0cad8ff..043a08d 100644
|
|||||||
|
|
||||||
module $(MODULE_NAME).ko: $(UVM_MODULE_SYMVERS) debug_diagnostics_printing
|
module $(MODULE_NAME).ko: $(UVM_MODULE_SYMVERS) debug_diagnostics_printing
|
||||||
|
|
||||||
|
diff --git a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh
|
||||||
|
index b7a85f0..33e2a63 100755
|
||||||
|
--- a/kernel/uvm/conftest.sh
|
||||||
|
+++ b/kernel/uvm/conftest.sh
|
||||||
|
@@ -176,6 +176,7 @@ test_headers() {
|
||||||
|
FILES="$FILES linux/ktime.h"
|
||||||
|
FILES="$FILES linux/file.h"
|
||||||
|
|
||||||
|
+ FILES_ARCH="$FILES_ARCH asm/pgtable.h"
|
||||||
|
FILES_ARCH="$FILES_ARCH asm/set_memory.h"
|
||||||
|
|
||||||
|
translate_and_find_header_files $HEADERS $FILES
|
||||||
|
@@ -440,6 +441,9 @@ compile_test() {
|
||||||
|
# Determine if the set_memory_array_uc() function is present.
|
||||||
|
#
|
||||||
|
CODE="
|
||||||
|
+ #if defined(NV_ASM_PGTABLE_H_PRESENT)
|
||||||
|
+ #include <asm/pgtable.h>
|
||||||
|
+ #endif
|
||||||
|
#if defined(NV_ASM_SET_MEMORY_H_PRESENT)
|
||||||
|
#include <asm/set_memory.h>
|
||||||
|
#else
|
||||||
diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
|
diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
|
||||||
index 6943e7c..9a7e3b6 100644
|
index 6943e7c..9a7e3b6 100644
|
||||||
--- a/kernel/uvm/nvidia_uvm_lite.c
|
--- a/kernel/uvm/nvidia_uvm_lite.c
|
||||||
@ -485,3 +775,6 @@ index 6943e7c..9a7e3b6 100644
|
|||||||
NvBool bEccErrorTimeout = NV_FALSE;
|
NvBool bEccErrorTimeout = NV_FALSE;
|
||||||
NvBool bEccIncomingError = NV_FALSE;
|
NvBool bEccIncomingError = NV_FALSE;
|
||||||
unsigned rmInterruptSet = 0;
|
unsigned rmInterruptSet = 0;
|
||||||
|
--
|
||||||
|
2.29.0
|
||||||
|
|
@ -0,0 +1,92 @@
|
|||||||
|
From 2cc3342b4b3c96bcc4062513011d35c079b009a2 Mon Sep 17 00:00:00 2001
|
||||||
|
From: graysky <graysky@archlinux.us>
|
||||||
|
Date: Thu, 22 Oct 2020 06:59:59 -0400
|
||||||
|
Subject: [PATCH 2/3] kernel-5.8
|
||||||
|
|
||||||
|
credit: https://launchpad.net/~kelebek333/+archive/ubuntu/nvidia-legacy/+packages
|
||||||
|
extracted from: https://launchpadlibrarian.net/492468557/nvidia-graphics-drivers-340_340.108-1lmtrfocal3_340.108-2lmtrfocal.diff.gz
|
||||||
|
---
|
||||||
|
kernel/nv-linux.h | 8 ++++++++
|
||||||
|
kernel/nvidia-modules-common.mk | 1 +
|
||||||
|
kernel/os-mlock.c | 8 ++++++++
|
||||||
|
kernel/uvm/nvidia_uvm_lite_api.c | 4 ++++
|
||||||
|
4 files changed, 21 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
|
||||||
|
index 83e6433..d055552 100644
|
||||||
|
--- a/kernel/nv-linux.h
|
||||||
|
+++ b/kernel/nv-linux.h
|
||||||
|
@@ -669,11 +669,19 @@ extern nv_spinlock_t km_lock;
|
||||||
|
# define KM_FREE_RECORD(a,b,c)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||||
|
+#define NV_VMALLOC(ptr, size) \
|
||||||
|
+ { \
|
||||||
|
+ (ptr) = __vmalloc(size, GFP_KERNEL); \
|
||||||
|
+ VM_ALLOC_RECORD(ptr, size, "vm_vmalloc"); \
|
||||||
|
+ }
|
||||||
|
+#else
|
||||||
|
#define NV_VMALLOC(ptr, size) \
|
||||||
|
{ \
|
||||||
|
(ptr) = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL); \
|
||||||
|
VM_ALLOC_RECORD(ptr, size, "vm_vmalloc"); \
|
||||||
|
}
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#define NV_VFREE(ptr, size) \
|
||||||
|
{ \
|
||||||
|
diff --git a/kernel/nvidia-modules-common.mk b/kernel/nvidia-modules-common.mk
|
||||||
|
index b94591b..0e4c228 100644
|
||||||
|
--- a/kernel/nvidia-modules-common.mk
|
||||||
|
+++ b/kernel/nvidia-modules-common.mk
|
||||||
|
@@ -222,6 +222,7 @@ build-sanity-checks:
|
||||||
|
define BUILD_MODULE_RULE
|
||||||
|
$(1): build-sanity-checks $(3)
|
||||||
|
@echo "NVIDIA: calling KBUILD..."; \
|
||||||
|
+ touch .nv-kernel.o.cmd; \
|
||||||
|
$$(MAKE) "CC=$$(CC)" NV_MODULE_SUFFIX=$$(strip $(2)) $$(KBUILD_PARAMS) modules; \
|
||||||
|
echo "NVIDIA: left KBUILD."; \
|
||||||
|
if ! [ -f $(1) ]; then \
|
||||||
|
diff --git a/kernel/os-mlock.c b/kernel/os-mlock.c
|
||||||
|
index 8a1fa2f..fc50543 100644
|
||||||
|
--- a/kernel/os-mlock.c
|
||||||
|
+++ b/kernel/os-mlock.c
|
||||||
|
@@ -44,11 +44,19 @@ RM_STATUS NV_API_CALL os_lock_user_pages(
|
||||||
|
return rmStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||||
|
+ down_read(&mm->mmap_lock);
|
||||||
|
+ ret = NV_GET_USER_PAGES((unsigned long)address,
|
||||||
|
+ page_count, write, force, user_pages, NULL);
|
||||||
|
+ up_read(&mm->mmap_lock);
|
||||||
|
+ pinned = ret;
|
||||||
|
+#else
|
||||||
|
down_read(&mm->mmap_sem);
|
||||||
|
ret = NV_GET_USER_PAGES((unsigned long)address,
|
||||||
|
page_count, write, force, user_pages, NULL);
|
||||||
|
up_read(&mm->mmap_sem);
|
||||||
|
pinned = ret;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
diff --git a/kernel/uvm/nvidia_uvm_lite_api.c b/kernel/uvm/nvidia_uvm_lite_api.c
|
||||||
|
index 8448eb6..97a4818 100644
|
||||||
|
--- a/kernel/uvm/nvidia_uvm_lite_api.c
|
||||||
|
+++ b/kernel/uvm/nvidia_uvm_lite_api.c
|
||||||
|
@@ -30,6 +30,10 @@
|
||||||
|
#include "uvm_gpu_ops_tests.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
|
||||||
|
+#define mmap_sem mmap_lock
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
//
|
||||||
|
// nvidia_uvm_lite_api.c
|
||||||
|
//
|
||||||
|
--
|
||||||
|
2.29.0
|
||||||
|
|
@ -0,0 +1,107 @@
|
|||||||
|
From fea401df7500bfbead5a42b1e74560dbddf2f5a3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: graysky <graysky@archlinux.us>
|
||||||
|
Date: Thu, 22 Oct 2020 07:00:35 -0400
|
||||||
|
Subject: [PATCH 3/3] kernel-5.9
|
||||||
|
|
||||||
|
credit: https://github.com/warpme/minimyth2/blob/master/script/nvidia/nvidia-340.108/files/nvidia-340.108-fix-5.9-kernel-compile.patch
|
||||||
|
---
|
||||||
|
kernel/nv-drm.c | 8 ++++++++
|
||||||
|
kernel/nv-linux.h | 9 +++++++--
|
||||||
|
kernel/nv.c | 4 ++++
|
||||||
|
kernel/uvm/nvidia_uvm_linux.h | 2 ++
|
||||||
|
4 files changed, 21 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
|
||||||
|
index 85db07e..f0c1299 100644
|
||||||
|
--- a/kernel/nv-drm.c
|
||||||
|
+++ b/kernel/nv-drm.c
|
||||||
|
@@ -415,7 +415,11 @@ static struct drm_driver nv_drm_driver = {
|
||||||
|
.set_busid = drm_pci_set_busid,
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
||||||
|
+ .gem_free_object_unlocked = nv_gem_free,
|
||||||
|
+#else
|
||||||
|
.gem_free_object = nv_gem_free,
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
|
||||||
|
.gem_prime_export = drm_gem_prime_export,
|
||||||
|
@@ -511,8 +515,12 @@ RM_STATUS NV_API_CALL nv_alloc_os_descriptor_handle(
|
||||||
|
|
||||||
|
#if defined(NV_DRM_GEM_OBJECT_PUT_UNLOCKED_PRESENT)
|
||||||
|
drm_gem_object_put_unlocked(&nv_obj->base);
|
||||||
|
+#else
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
||||||
|
+ drm_gem_object_put_locked(&nv_obj->base);
|
||||||
|
#else
|
||||||
|
drm_gem_object_unreference_unlocked(&nv_obj->base);
|
||||||
|
+#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
status = RM_OK;
|
||||||
|
diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
|
||||||
|
index d055552..524a8fe 100644
|
||||||
|
--- a/kernel/nv-linux.h
|
||||||
|
+++ b/kernel/nv-linux.h
|
||||||
|
@@ -136,8 +136,10 @@
|
||||||
|
|
||||||
|
#if defined(NVCPU_X86_64) && !defined(HAVE_COMPAT_IOCTL)
|
||||||
|
#include <linux/syscalls.h> /* sys_ioctl() */
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
|
||||||
|
#include <linux/ioctl32.h> /* register_ioctl32_conversion() */
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \
|
||||||
|
!defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL)
|
||||||
|
@@ -2249,10 +2251,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
|
||||||
|
pages, vmas, NULL);
|
||||||
|
|
||||||
|
#else
|
||||||
|
-
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
||||||
|
+ return get_user_pages_remote(mm, start, nr_pages, flags,
|
||||||
|
+ pages, vmas, NULL);
|
||||||
|
+#else
|
||||||
|
return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
|
||||||
|
pages, vmas);
|
||||||
|
-
|
||||||
|
+#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
}
|
||||||
|
diff --git a/kernel/nv.c b/kernel/nv.c
|
||||||
|
index a218f83..be4e0f8 100644
|
||||||
|
--- a/kernel/nv.c
|
||||||
|
+++ b/kernel/nv.c
|
||||||
|
@@ -2785,7 +2785,11 @@ nvidia_probe
|
||||||
|
|
||||||
|
#if defined(CONFIG_VGA_ARB)
|
||||||
|
#if defined(VGA_DEFAULT_DEVICE)
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
||||||
|
+ vga_get(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK, 0);
|
||||||
|
+#else
|
||||||
|
vga_tryget(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK);
|
||||||
|
+#endif
|
||||||
|
#endif
|
||||||
|
vga_set_legacy_decoding(dev, VGA_RSRC_NONE);
|
||||||
|
#endif
|
||||||
|
diff --git a/kernel/uvm/nvidia_uvm_linux.h b/kernel/uvm/nvidia_uvm_linux.h
|
||||||
|
index 1625209..efc181f 100644
|
||||||
|
--- a/kernel/uvm/nvidia_uvm_linux.h
|
||||||
|
+++ b/kernel/uvm/nvidia_uvm_linux.h
|
||||||
|
@@ -158,8 +158,10 @@
|
||||||
|
|
||||||
|
#if defined(NVCPU_X86_64) && !defined(HAVE_COMPAT_IOCTL)
|
||||||
|
#include <linux/syscalls.h> /* sys_ioctl() */
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
|
||||||
|
#include <linux/ioctl32.h> /* register_ioctl32_conversion() */
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \
|
||||||
|
!defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL)
|
||||||
|
--
|
||||||
|
2.29.0
|
||||||
|
|
@ -0,0 +1,18 @@
|
|||||||
|
https://github.com/warpme/minimyth2/tree/master/script/nvidia/nvidia-340.108/files
|
||||||
|
|
||||||
|
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c
|
||||||
|
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c 2020-12-13 19:10:56.759999937 +0100
|
||||||
|
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c 2020-12-13 19:09:02.039999925 +0100
|
||||||
|
@@ -322,8 +322,11 @@
|
||||||
|
{
|
||||||
|
struct nv_gem_object *nv_obj = container_of(obj, struct nv_gem_object, base);
|
||||||
|
int page_count = obj->size >> PAGE_SHIFT;
|
||||||
|
-
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)
|
||||||
|
+ return drm_prime_pages_to_sg(obj->dev, nv_obj->pages, page_count);
|
||||||
|
+#else
|
||||||
|
return drm_prime_pages_to_sg(nv_obj->pages, page_count);
|
||||||
|
+#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
static void* nv_gem_prime_vmap(
|
@ -36,98 +36,52 @@ diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/conftest.sh NVIDIA-Linux-x86_6
|
|||||||
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c
|
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c
|
||||||
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c 2021-05-24 20:08:18.779739237 +0200
|
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c 2021-05-24 20:08:18.779739237 +0200
|
||||||
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c 2021-05-24 20:42:13.443288819 +0200
|
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c 2021-05-24 20:42:13.443288819 +0200
|
||||||
@@ -52,7 +52,9 @@
|
@@ -60,6 +60,8 @@
|
||||||
#define nv_drm_pci_exit drm_legacy_pci_exit
|
#else
|
||||||
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
|
|
||||||
|
|
||||||
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0)
|
|
||||||
+#include "linux/dma-buf.h"
|
|
||||||
+
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 7, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
|
||||||
#include <drm/drm_agpsupport.h>
|
#include <drm/drm_agpsupport.h>
|
||||||
|
|
||||||
struct drm_agp_mem {
|
+#include "linux/dma-buf.h"
|
||||||
@@ -168,8 +170,10 @@
|
+
|
||||||
|
struct nv_drm_agp_head {
|
||||||
|
struct agp_kern_info agp_info;
|
||||||
|
struct list_head memory;
|
||||||
|
@@ -210,8 +212,10 @@
|
||||||
|
|
||||||
/* No locking needed since shadow-attach is single-threaded since it may
|
/* No locking needed since shadow-attach is single-threaded since it may
|
||||||
* only be called from the per-driver module init hook. */
|
* only be called from the per-driver module init hook. */
|
||||||
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 10, 0)
|
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 10, 0)
|
||||||
if (drm_core_check_feature(dev, DRIVER_LEGACY))
|
if (drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||||
list_add_tail(&dev->legacy_dev_list, &driver->legacy_dev_list);
|
list_add_tail(&dev->legacy_dev_list, &driver->legacy_dev_list);
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@@ -193,8 +197,10 @@
|
@@ -239,8 +243,10 @@
|
||||||
if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY)))
|
if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY)))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 10, 0)
|
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 10, 0)
|
||||||
/* If not using KMS, fall back to stealth mode manual scanning. */
|
/* If not using KMS, fall back to stealth mode manual scanning. */
|
||||||
INIT_LIST_HEAD(&driver->legacy_dev_list);
|
INIT_LIST_HEAD(&driver->legacy_dev_list);
|
||||||
+#endif
|
+#endif
|
||||||
for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
|
for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
|
||||||
pid = &pdriver->id_table[i];
|
pid = &pdriver->id_table[i];
|
||||||
|
|
||||||
@@ -219,7 +219,9 @@
|
@@ -273,11 +279,13 @@
|
||||||
|
if (!(driver->driver_features & DRIVER_LEGACY)) {
|
||||||
/* stealth mode requires a manual probe */
|
WARN_ON(1);
|
||||||
pci_dev_get(pdev);
|
} else {
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
|
||||||
drm_get_pci_dev(pdev, pid, driver);
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
@@ -227,11 +233,13 @@
|
|
||||||
if (!(driver->driver_features & DRIVER_LEGACY)) {
|
|
||||||
WARN_ON(1);
|
|
||||||
} else {
|
|
||||||
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 10, 0)
|
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 10, 0)
|
||||||
list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
|
list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
|
||||||
legacy_dev_list) {
|
legacy_dev_list) {
|
||||||
list_del(&dev->legacy_dev_list);
|
list_del(&dev->legacy_dev_list);
|
||||||
drm_put_dev(dev);
|
drm_put_dev(dev);
|
||||||
}
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
DRM_INFO("Module unloaded\n");
|
|
||||||
}
|
|
||||||
@@ -254,6 +262,8 @@
|
|
||||||
{
|
|
||||||
nv_linux_state_t *nvl;
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
|
||||||
+ /* dev->pdev is no longer avaialble in 5.14 */
|
|
||||||
for (nvl = nv_linux_devices; nvl != NULL; nvl = nvl->next)
|
|
||||||
{
|
|
||||||
if (nvl->dev == dev->pdev)
|
|
||||||
@@ -262,6 +272,7 @@
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
+#endif
|
+#endif
|
||||||
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
@@ -278,6 +289,8 @@
|
|
||||||
{
|
|
||||||
nv_linux_state_t *nvl;
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
|
||||||
+ /* dev->pdev is no longer avaialble in 5.14 */
|
|
||||||
for (nvl = nv_linux_devices; nvl != NULL; nvl = nvl->next)
|
|
||||||
{
|
|
||||||
if (nvl->dev == dev->pdev)
|
|
||||||
@@ -287,6 +300,7 @@
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+#endif
|
DRM_INFO("Module unloaded\n");
|
||||||
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
}
|
||||||
@@ -359,6 +373,39 @@
|
@@ -402,6 +410,39 @@
|
||||||
.llseek = noop_llseek,
|
.llseek = noop_llseek,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -167,7 +121,7 @@ diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c NVIDIA-Linux-x86_64-3
|
|||||||
static struct drm_driver nv_drm_driver = {
|
static struct drm_driver nv_drm_driver = {
|
||||||
|
|
||||||
.driver_features = DRIVER_GEM
|
.driver_features = DRIVER_GEM
|
||||||
@@ -377,17 +424,19 @@
|
@@ -420,17 +461,19 @@
|
||||||
.set_busid = drm_pci_set_busid,
|
.set_busid = drm_pci_set_busid,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -218,14 +172,3 @@ diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/uvm/nvidia_uvm_linux.h NVIDIA-
|
|||||||
|
|
||||||
#include <linux/interrupt.h> /* tasklets, interrupt helpers */
|
#include <linux/interrupt.h> /* tasklets, interrupt helpers */
|
||||||
#include <linux/timer.h>
|
#include <linux/timer.h>
|
||||||
--- a/kernel/os-interface.c 2021-09-04 22:01:56.175807486 +1000
|
|
||||||
+++ b/kernel/os-interface.c 2021-09-04 22:01:56.175807486 +1000
|
|
||||||
@@ -549,7 +549,7 @@
|
|
||||||
// the requested timeout has expired, loop until less
|
|
||||||
// than a jiffie of the desired delay remains.
|
|
||||||
//
|
|
||||||
- current->state = TASK_INTERRUPTIBLE;
|
|
||||||
+ current->__state = TASK_INTERRUPTIBLE;
|
|
||||||
do
|
|
||||||
{
|
|
||||||
schedule_timeout(jiffies);
|
|
@ -0,0 +1,213 @@
|
|||||||
|
diff -Naur NVIDIA-Linux-x86_64-340.108-no-compat32.5.13/kernel/nv-drm.c NVIDIA-Linux-x86_64-340.108-no-compat32.5.14/kernel/nv-drm.c
|
||||||
|
--- NVIDIA-Linux-x86_64-340.108-no-compat32.5.13/kernel/nv-drm.c 2021-07-25 10:29:29.336505688 +0200
|
||||||
|
+++ NVIDIA-Linux-x86_64-340.108-no-compat32.5.14/kernel/nv-drm.c 2021-09-16 16:49:10.929858547 +0200
|
||||||
|
@@ -57,8 +57,11 @@
|
||||||
|
#if defined(NV_DRM_GET_PCI_DEV_PRESENT)
|
||||||
|
#define nv_drm_get_pci_dev drm_get_pci_dev
|
||||||
|
#else
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
||||||
|
#include <drm/drm_agpsupport.h>
|
||||||
|
-
|
||||||
|
+#else
|
||||||
|
+#include <drm/drm_legacy.h>
|
||||||
|
+#endif
|
||||||
|
#include "linux/dma-buf.h"
|
||||||
|
|
||||||
|
struct nv_drm_agp_head {
|
||||||
|
@@ -82,6 +85,11 @@
|
||||||
|
struct list_head head;
|
||||||
|
};
|
||||||
|
|
||||||
|
+struct nv_drm_extra_priv_data {
|
||||||
|
+ struct pci_dev *pdev;
|
||||||
|
+ struct drm_agp_head *agp;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Code from drm_agp_init/nv_drm_{free,unbind}_agp
|
||||||
|
* Extracted from commit: 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94, file: drivers/gpu/drm/drm_agpsupport.c
|
||||||
|
@@ -89,13 +97,14 @@
|
||||||
|
struct drm_agp_head *nv_drm_agp_init(struct drm_device *dev)
|
||||||
|
{
|
||||||
|
struct nv_drm_agp_head *head = NULL;
|
||||||
|
+ struct nv_drm_extra_priv_data *extra = dev->dev_private;
|
||||||
|
|
||||||
|
head = kzalloc(sizeof(*head), GFP_KERNEL);
|
||||||
|
if (!head)
|
||||||
|
return NULL;
|
||||||
|
- head->bridge = agp_find_bridge(dev->pdev);
|
||||||
|
+ head->bridge = agp_find_bridge(extra->pdev);
|
||||||
|
if (!head->bridge) {
|
||||||
|
- head->bridge = agp_backend_acquire(dev->pdev);
|
||||||
|
+ head->bridge = agp_backend_acquire(extra->pdev);
|
||||||
|
if (!head->bridge) {
|
||||||
|
kfree(head);
|
||||||
|
return NULL;
|
||||||
|
@@ -133,48 +142,71 @@
|
||||||
|
static void nv_drm_pci_agp_init(struct drm_device *dev)
|
||||||
|
{
|
||||||
|
if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
|
||||||
|
- if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
|
||||||
|
- dev->agp = nv_drm_agp_init(dev);
|
||||||
|
- if (dev->agp) {
|
||||||
|
- dev->agp->agp_mtrr = arch_phys_wc_add(
|
||||||
|
- dev->agp->agp_info.aper_base,
|
||||||
|
- dev->agp->agp_info.aper_size *
|
||||||
|
+ struct nv_drm_extra_priv_data *extra = dev->dev_private;
|
||||||
|
+
|
||||||
|
+ if (pci_find_capability(extra->pdev, PCI_CAP_ID_AGP))
|
||||||
|
+ extra->agp = nv_drm_agp_init(dev);
|
||||||
|
+ if (extra->agp) {
|
||||||
|
+ extra->agp->agp_mtrr = arch_phys_wc_add(
|
||||||
|
+ extra->agp->agp_info.aper_base,
|
||||||
|
+ extra->agp->agp_info.aper_size *
|
||||||
|
1024 * 1024);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
||||||
|
+
|
||||||
|
+#else
|
||||||
|
+/* copied from v5.14.5 */
|
||||||
|
+int nv_drm_legacy_agp_release(struct drm_device *dev)
|
||||||
|
+{
|
||||||
|
+ struct nv_drm_extra_priv_data *extra = dev->dev_private;
|
||||||
|
+
|
||||||
|
+ if (!extra->agp || !extra->agp->acquired)
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ agp_backend_release(extra->agp->bridge);
|
||||||
|
+ extra->agp->acquired = 0;
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
void nv_drm_legacy_agp_clear(struct drm_device *dev)
|
||||||
|
{
|
||||||
|
struct nv_drm_agp_mem *entry, *tempe;
|
||||||
|
+ struct nv_drm_extra_priv_data *extra = dev->dev_private;
|
||||||
|
|
||||||
|
- if (!dev->agp)
|
||||||
|
+ if (!extra->agp)
|
||||||
|
return;
|
||||||
|
if (!drm_core_check_feature(dev, DRIVER_LEGACY))
|
||||||
|
return;
|
||||||
|
|
||||||
|
- list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
|
||||||
|
+ list_for_each_entry_safe(entry, tempe, &extra->agp->memory, head) {
|
||||||
|
if (entry->bound)
|
||||||
|
nv_drm_unbind_agp(entry->memory);
|
||||||
|
nv_drm_free_agp(entry->memory, entry->pages);
|
||||||
|
kfree(entry);
|
||||||
|
}
|
||||||
|
- INIT_LIST_HEAD(&dev->agp->memory);
|
||||||
|
+ INIT_LIST_HEAD(&extra->agp->memory);
|
||||||
|
|
||||||
|
- if (dev->agp->acquired)
|
||||||
|
+ if (extra->agp->acquired)
|
||||||
|
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
||||||
|
drm_agp_release(dev);
|
||||||
|
-
|
||||||
|
- dev->agp->acquired = 0;
|
||||||
|
- dev->agp->enabled = 0;
|
||||||
|
+#else
|
||||||
|
+ nv_drm_legacy_agp_release(dev);
|
||||||
|
+#endif
|
||||||
|
+ extra->agp->acquired = 0;
|
||||||
|
+ extra->agp->enabled = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void nv_drm_pci_agp_destroy(struct drm_device *dev)
|
||||||
|
{
|
||||||
|
- if (dev->agp) {
|
||||||
|
- arch_phys_wc_del(dev->agp->agp_mtrr);
|
||||||
|
+ struct nv_drm_extra_priv_data *extra = dev->dev_private;
|
||||||
|
+ if (extra->agp) {
|
||||||
|
+ arch_phys_wc_del(extra->agp->agp_mtrr);
|
||||||
|
nv_drm_legacy_agp_clear(dev);
|
||||||
|
- kfree(dev->agp);
|
||||||
|
- dev->agp = NULL;
|
||||||
|
+ kfree(extra->agp);
|
||||||
|
+ extra->agp = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -183,6 +215,7 @@
|
||||||
|
struct drm_driver *driver)
|
||||||
|
{
|
||||||
|
struct drm_device *dev;
|
||||||
|
+ struct nv_drm_extra_priv_data *extra;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
DRM_DEBUG("\n");
|
||||||
|
@@ -191,11 +224,18 @@
|
||||||
|
if (IS_ERR(dev))
|
||||||
|
return PTR_ERR(dev);
|
||||||
|
|
||||||
|
+ extra = kzalloc(sizeof(*extra), GFP_KERNEL);
|
||||||
|
+ if (IS_ERR(extra))
|
||||||
|
+ goto err_free;
|
||||||
|
+
|
||||||
|
+ extra->pdev = pdev;
|
||||||
|
+
|
||||||
|
ret = pci_enable_device(pdev);
|
||||||
|
if (ret)
|
||||||
|
- goto err_free;
|
||||||
|
+ goto err_free2;
|
||||||
|
|
||||||
|
- dev->pdev = pdev;
|
||||||
|
+ /* use the not used (i hope) dev_private to store deprecated/legacy pointers */
|
||||||
|
+ dev->dev_private = extra;
|
||||||
|
#ifdef __alpha__
|
||||||
|
dev->hose = pdev->sysdata;
|
||||||
|
#endif
|
||||||
|
@@ -221,6 +261,8 @@
|
||||||
|
err_agp:
|
||||||
|
nv_drm_pci_agp_destroy(dev);
|
||||||
|
pci_disable_device(pdev);
|
||||||
|
+err_free2:
|
||||||
|
+ kfree(extra);
|
||||||
|
err_free:
|
||||||
|
drm_dev_put(dev);
|
||||||
|
return ret;
|
||||||
|
@@ -303,10 +345,11 @@
|
||||||
|
)
|
||||||
|
{
|
||||||
|
nv_linux_state_t *nvl;
|
||||||
|
+ struct nv_drm_extra_priv_data *extra = dev->dev_private;
|
||||||
|
|
||||||
|
for (nvl = nv_linux_devices; nvl != NULL; nvl = nvl->next)
|
||||||
|
{
|
||||||
|
- if (nvl->dev == dev->pdev)
|
||||||
|
+ if (nvl->dev == extra->pdev)
|
||||||
|
{
|
||||||
|
nvl->drm = dev;
|
||||||
|
return 0;
|
||||||
|
@@ -327,10 +370,11 @@
|
||||||
|
)
|
||||||
|
{
|
||||||
|
nv_linux_state_t *nvl;
|
||||||
|
+ struct nv_drm_extra_priv_data *extra = dev->dev_private;
|
||||||
|
|
||||||
|
for (nvl = nv_linux_devices; nvl != NULL; nvl = nvl->next)
|
||||||
|
{
|
||||||
|
- if (nvl->dev == dev->pdev)
|
||||||
|
+ if (nvl->dev == extra->pdev)
|
||||||
|
{
|
||||||
|
BUG_ON(nvl->drm != dev);
|
||||||
|
nvl->drm = NULL;
|
||||||
|
diff -Naur NVIDIA-Linux-x86_64-340.108-no-compat32.5.13/kernel/os-interface.c NVIDIA-Linux-x86_64-340.108-no-compat32.5.14/kernel/os-interface.c
|
||||||
|
--- NVIDIA-Linux-x86_64-340.108-no-compat32.5.13/kernel/os-interface.c 2021-07-25 10:29:29.083168593 +0200
|
||||||
|
+++ NVIDIA-Linux-x86_64-340.108-no-compat32.5.14/kernel/os-interface.c 2021-09-16 13:17:43.345906445 +0200
|
||||||
|
@@ -549,7 +549,11 @@
|
||||||
|
// the requested timeout has expired, loop until less
|
||||||
|
// than a jiffie of the desired delay remains.
|
||||||
|
//
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 14, 0)
|
||||||
|
+ current->__state = TASK_INTERRUPTIBLE;
|
||||||
|
+#else
|
||||||
|
current->state = TASK_INTERRUPTIBLE;
|
||||||
|
+#endif
|
||||||
|
do
|
||||||
|
{
|
||||||
|
schedule_timeout(jiffies);
|
@ -0,0 +1,14 @@
|
|||||||
|
diff -Naur NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c
|
||||||
|
--- NVIDIA-Linux-x86_64-340.108-old/kernel/nv-drm.c 2021-11-06 20:08:18.779739237 +0200
|
||||||
|
+++ NVIDIA-Linux-x86_64-340.108-new/kernel/nv-drm.c 2021-11-06 20:42:13.443288819 +0200
|
||||||
|
@@ -529,7 +529,9 @@ RM_STATUS NV_API_CALL nv_alloc_os_descri
|
||||||
|
#if defined(NV_DRM_GEM_OBJECT_PUT_UNLOCKED_PRESENT)
|
||||||
|
drm_gem_object_put_unlocked(&nv_obj->base);
|
||||||
|
#else
|
||||||
|
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
||||||
|
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0)
|
||||||
|
+ drm_gem_object_put(&nv_obj->base);
|
||||||
|
+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
|
||||||
|
drm_gem_object_put_locked(&nv_obj->base);
|
||||||
|
#else
|
||||||
|
drm_gem_object_unreference_unlocked(&nv_obj->base);
|
@ -6,8 +6,8 @@ PKG_NAME="xf86-video-nvidia"
|
|||||||
# Remember to run "python3 packages/x11/driver/xf86-video-nvidia/scripts/make_nvidia_udev.py" and commit
|
# Remember to run "python3 packages/x11/driver/xf86-video-nvidia/scripts/make_nvidia_udev.py" and commit
|
||||||
# changes to "packages/x11/driver/xf86-video-nvidia/udev.d/96-nvidia.rules" whenever bumping version.
|
# changes to "packages/x11/driver/xf86-video-nvidia/udev.d/96-nvidia.rules" whenever bumping version.
|
||||||
# The build host may require installation of python3-lxml and python3-requests packages.
|
# The build host may require installation of python3-lxml and python3-requests packages.
|
||||||
PKG_VERSION="460.91.03"
|
PKG_VERSION="470.94"
|
||||||
PKG_SHA256="448156cfcef182ed6997c2754c472fd681bf7139b821d2adce1d847220c6c933"
|
PKG_SHA256="0b49cb861fdfea91753d3fddf7bd4251c3705cd93f0ebc7b5a52cbcdb7e4cf48"
|
||||||
PKG_ARCH="x86_64"
|
PKG_ARCH="x86_64"
|
||||||
PKG_LICENSE="nonfree"
|
PKG_LICENSE="nonfree"
|
||||||
PKG_SITE="https://www.nvidia.com/en-us/drivers/unix/"
|
PKG_SITE="https://www.nvidia.com/en-us/drivers/unix/"
|
||||||
@ -47,6 +47,7 @@ makeinstall_target() {
|
|||||||
|
|
||||||
mkdir -p ${INSTALL}/usr/lib
|
mkdir -p ${INSTALL}/usr/lib
|
||||||
cp -P libnvidia-glcore.so.${PKG_VERSION} ${INSTALL}/usr/lib
|
cp -P libnvidia-glcore.so.${PKG_VERSION} ${INSTALL}/usr/lib
|
||||||
|
cp -P libnvidia-glsi.so.${PKG_VERSION} ${INSTALL}/usr/lib
|
||||||
cp -P libnvidia-ml.so.${PKG_VERSION} ${INSTALL}/usr/lib
|
cp -P libnvidia-ml.so.${PKG_VERSION} ${INSTALL}/usr/lib
|
||||||
ln -sf /var/lib/libnvidia-ml.so.1 ${INSTALL}/usr/lib/libnvidia-ml.so.1
|
ln -sf /var/lib/libnvidia-ml.so.1 ${INSTALL}/usr/lib/libnvidia-ml.so.1
|
||||||
cp -P libnvidia-tls.so.${PKG_VERSION} ${INSTALL}/usr/lib
|
cp -P libnvidia-tls.so.${PKG_VERSION} ${INSTALL}/usr/lib
|
||||||
|
@ -1,63 +0,0 @@
|
|||||||
From f18c541edc5e122b06b0c1e65d0a422f0b8109e7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Joan Bruguera <joanbrugueram@gmail.com>
|
|
||||||
Date: Fri, 2 Jul 2021 02:09:58 +0200
|
|
||||||
Subject: [PATCH] Tentative fix for NVIDIA 465.31 driver for Linux 5.14-rc1
|
|
||||||
|
|
||||||
---
|
|
||||||
kernel/common/inc/nv-time.h | 6 ++++++
|
|
||||||
kernel/nvidia-drm/nvidia-drm-drv.c | 4 ++++
|
|
||||||
2 files changed, 10 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/kernel/common/inc/nv-time.h b/kernel/common/inc/nv-time.h
|
|
||||||
index dc80806..cc343a5 100644
|
|
||||||
--- a/kernel/common/inc/nv-time.h
|
|
||||||
+++ b/kernel/common/inc/nv-time.h
|
|
||||||
@@ -23,6 +23,7 @@
|
|
||||||
#ifndef __NV_TIME_H__
|
|
||||||
#define __NV_TIME_H__
|
|
||||||
|
|
||||||
+#include <linux/version.h>
|
|
||||||
#include "conftest.h"
|
|
||||||
#include <linux/sched.h>
|
|
||||||
#include <linux/delay.h>
|
|
||||||
@@ -205,7 +206,12 @@ static inline NV_STATUS nv_sleep_ms(unsigned int ms)
|
|
||||||
// the requested timeout has expired, loop until less
|
|
||||||
// than a jiffie of the desired delay remains.
|
|
||||||
//
|
|
||||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
|
|
||||||
current->state = TASK_INTERRUPTIBLE;
|
|
||||||
+#else
|
|
||||||
+ // Rel. commit "sched: Change task_struct::state" (Peter Zijlstra, Jun 11 2021)
|
|
||||||
+ WRITE_ONCE(current->__state, TASK_INTERRUPTIBLE);
|
|
||||||
+#endif
|
|
||||||
do
|
|
||||||
{
|
|
||||||
schedule_timeout(jiffies);
|
|
||||||
diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
|
|
||||||
index 84d4479..99ea552 100644
|
|
||||||
--- a/kernel/nvidia-drm/nvidia-drm-drv.c
|
|
||||||
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
|
|
||||||
@@ -20,6 +20,7 @@
|
|
||||||
* DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
+#include <linux/version.h>
|
|
||||||
#include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
|
|
||||||
|
|
||||||
#include "nvidia-drm-priv.h"
|
|
||||||
@@ -903,9 +904,12 @@ static void nv_drm_register_drm_device(const nv_gpu_info_t *gpu_info)
|
|
||||||
|
|
||||||
dev->dev_private = nv_dev;
|
|
||||||
nv_dev->dev = dev;
|
|
||||||
+#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 */
|
|
||||||
|
|
||||||
--
|
|
||||||
2.32.0
|
|
||||||
|
|
@ -253,6 +253,7 @@ ATTR{device}=="0x1e91", GOTO="configure_nvidia"
|
|||||||
ATTR{device}=="0x1e93", GOTO="configure_nvidia"
|
ATTR{device}=="0x1e93", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1eb0", GOTO="configure_nvidia"
|
ATTR{device}=="0x1eb0", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1eb1", GOTO="configure_nvidia"
|
ATTR{device}=="0x1eb1", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x1eb4", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1eb5", GOTO="configure_nvidia"
|
ATTR{device}=="0x1eb5", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1eb6", GOTO="configure_nvidia"
|
ATTR{device}=="0x1eb6", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1eb8", GOTO="configure_nvidia"
|
ATTR{device}=="0x1eb8", GOTO="configure_nvidia"
|
||||||
@ -263,6 +264,7 @@ ATTR{device}=="0x1ed1", GOTO="configure_nvidia"
|
|||||||
ATTR{device}=="0x1ed3", GOTO="configure_nvidia"
|
ATTR{device}=="0x1ed3", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1ef5", GOTO="configure_nvidia"
|
ATTR{device}=="0x1ef5", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1f02", GOTO="configure_nvidia"
|
ATTR{device}=="0x1f02", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x1f03", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1f06", GOTO="configure_nvidia"
|
ATTR{device}=="0x1f06", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1f07", GOTO="configure_nvidia"
|
ATTR{device}=="0x1f07", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1f08", GOTO="configure_nvidia"
|
ATTR{device}=="0x1f08", GOTO="configure_nvidia"
|
||||||
@ -300,13 +302,19 @@ ATTR{device}=="0x1fba", GOTO="configure_nvidia"
|
|||||||
ATTR{device}=="0x1fbb", GOTO="configure_nvidia"
|
ATTR{device}=="0x1fbb", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1fbc", GOTO="configure_nvidia"
|
ATTR{device}=="0x1fbc", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1fdd", GOTO="configure_nvidia"
|
ATTR{device}=="0x1fdd", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x1ff0", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x1ff2", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x1ff9", GOTO="configure_nvidia"
|
ATTR{device}=="0x1ff9", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x20b0", GOTO="configure_nvidia"
|
ATTR{device}=="0x20b0", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x20b1", GOTO="configure_nvidia"
|
ATTR{device}=="0x20b1", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x20b2", GOTO="configure_nvidia"
|
ATTR{device}=="0x20b2", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x20b3", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x20b5", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x20b6", GOTO="configure_nvidia"
|
ATTR{device}=="0x20b6", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x20b7", GOTO="configure_nvidia"
|
ATTR{device}=="0x20b7", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x20f0", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x20f1", GOTO="configure_nvidia"
|
ATTR{device}=="0x20f1", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x20f2", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2182", GOTO="configure_nvidia"
|
ATTR{device}=="0x2182", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2184", GOTO="configure_nvidia"
|
ATTR{device}=="0x2184", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2187", GOTO="configure_nvidia"
|
ATTR{device}=="0x2187", GOTO="configure_nvidia"
|
||||||
@ -319,17 +327,21 @@ ATTR{device}=="0x21d1", GOTO="configure_nvidia"
|
|||||||
ATTR{device}=="0x2204", GOTO="configure_nvidia"
|
ATTR{device}=="0x2204", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2206", GOTO="configure_nvidia"
|
ATTR{device}=="0x2206", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2208", GOTO="configure_nvidia"
|
ATTR{device}=="0x2208", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x220d", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2216", GOTO="configure_nvidia"
|
ATTR{device}=="0x2216", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2230", GOTO="configure_nvidia"
|
ATTR{device}=="0x2230", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2231", GOTO="configure_nvidia"
|
ATTR{device}=="0x2231", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x2232", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2235", GOTO="configure_nvidia"
|
ATTR{device}=="0x2235", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2236", GOTO="configure_nvidia"
|
ATTR{device}=="0x2236", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2237", GOTO="configure_nvidia"
|
ATTR{device}=="0x2237", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2482", GOTO="configure_nvidia"
|
ATTR{device}=="0x2482", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2484", GOTO="configure_nvidia"
|
ATTR{device}=="0x2484", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2486", GOTO="configure_nvidia"
|
ATTR{device}=="0x2486", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x2487", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2488", GOTO="configure_nvidia"
|
ATTR{device}=="0x2488", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2489", GOTO="configure_nvidia"
|
ATTR{device}=="0x2489", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x248a", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x249c", GOTO="configure_nvidia"
|
ATTR{device}=="0x249c", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x249d", GOTO="configure_nvidia"
|
ATTR{device}=="0x249d", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x24b0", GOTO="configure_nvidia"
|
ATTR{device}=="0x24b0", GOTO="configure_nvidia"
|
||||||
@ -342,11 +354,14 @@ ATTR{device}=="0x2503", GOTO="configure_nvidia"
|
|||||||
ATTR{device}=="0x2504", GOTO="configure_nvidia"
|
ATTR{device}=="0x2504", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2520", GOTO="configure_nvidia"
|
ATTR{device}=="0x2520", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2523", GOTO="configure_nvidia"
|
ATTR{device}=="0x2523", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x2531", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2560", GOTO="configure_nvidia"
|
ATTR{device}=="0x2560", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x2563", GOTO="configure_nvidia"
|
ATTR{device}=="0x2563", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x2571", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x25a0", GOTO="configure_nvidia"
|
ATTR{device}=="0x25a0", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x25a2", GOTO="configure_nvidia"
|
ATTR{device}=="0x25a2", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x25a5", GOTO="configure_nvidia"
|
ATTR{device}=="0x25a5", GOTO="configure_nvidia"
|
||||||
|
ATTR{device}=="0x25b6", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x25b8", GOTO="configure_nvidia"
|
ATTR{device}=="0x25b8", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x25e0", GOTO="configure_nvidia"
|
ATTR{device}=="0x25e0", GOTO="configure_nvidia"
|
||||||
ATTR{device}=="0x25e2", GOTO="configure_nvidia"
|
ATTR{device}=="0x25e2", GOTO="configure_nvidia"
|
||||||
|
@ -3,11 +3,11 @@
|
|||||||
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
PKG_NAME="libX11"
|
PKG_NAME="libX11"
|
||||||
PKG_VERSION="1.7.2"
|
PKG_VERSION="1.7.3.1"
|
||||||
PKG_SHA256="1cfa35e37aaabbe4792e9bb690468efefbfbf6b147d9c69d6f90d13c3092ea6c"
|
PKG_SHA256="2ffd417266fb875028fdc0ef349694f63dbcd76d0b0cfacfb52e6151f4b60989"
|
||||||
PKG_LICENSE="OSS"
|
PKG_LICENSE="OSS"
|
||||||
PKG_SITE="http://www.x.org/"
|
PKG_SITE="http://www.x.org/"
|
||||||
PKG_URL="http://xorg.freedesktop.org/archive/individual/lib/${PKG_NAME}-${PKG_VERSION}.tar.bz2"
|
PKG_URL="http://xorg.freedesktop.org/archive/individual/lib/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||||
PKG_DEPENDS_TARGET="toolchain util-macros xtrans libXau libxcb xorgproto"
|
PKG_DEPENDS_TARGET="toolchain util-macros xtrans libXau libxcb xorgproto"
|
||||||
PKG_LONGDESC="LibX11 is the main X11 library containing all the client-side code to access the X11 windowing system."
|
PKG_LONGDESC="LibX11 is the main X11 library containing all the client-side code to access the X11 windowing system."
|
||||||
PKG_TOOLCHAIN="autotools"
|
PKG_TOOLCHAIN="autotools"
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2021-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
PKG_NAME="libxcvt"
|
PKG_NAME="libxcvt"
|
||||||
PKG_VERSION="0.1.0"
|
PKG_VERSION="0.1.1"
|
||||||
PKG_SHA256="90a4d4814935109890aa6c8101bf98ffbdc293000772f5db3d206f27d8a61976"
|
PKG_SHA256="27ebce180d355f94c1992930bedb40a36f6d7312ee50bf7f0acbcd22f33e8c29"
|
||||||
PKG_LICENSE="OSS"
|
PKG_LICENSE="OSS"
|
||||||
PKG_SITE="https://gitlab.freedesktop.org/xorg/lib/libxcvt"
|
PKG_SITE="https://gitlab.freedesktop.org/xorg/lib/libxcvt"
|
||||||
PKG_URL="https://gitlab.freedesktop.org/xorg/lib/${PKG_NAME}/-/archive/${PKG_NAME}-${PKG_VERSION}/${PKG_NAME}-${PKG_NAME}-${PKG_VERSION}.tar.bz2"
|
PKG_URL="http://xorg.freedesktop.org/archive/individual/lib/${PKG_NAME}-${PKG_VERSION}.tar.xz"
|
||||||
PKG_DEPENDS_TARGET="toolchain"
|
PKG_DEPENDS_TARGET="toolchain"
|
||||||
PKG_LONGDESC="libxcvt is a library providing a standalone version of the X server implementation of the VESA CVT standard timing modelines generator."
|
PKG_LONGDESC="libxcvt is a library providing a standalone version of the X server implementation of the VESA CVT standard timing modelines generator."
|
||||||
PKG_BUILD_FLAGS="+pic"
|
PKG_BUILD_FLAGS="+pic"
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
PKG_NAME="xorg-server"
|
PKG_NAME="xorg-server"
|
||||||
PKG_VERSION="21.1.1"
|
PKG_VERSION="21.1.2"
|
||||||
PKG_SHA256="915edd49f394283cc587b88a68b5e13e6e2d7f0276edabc9249afb2e22adf634"
|
PKG_SHA256="7ad8cdeaaa348508beb805d3c5e9d8b619f4036ee065d203423cddbec2b73d80"
|
||||||
PKG_LICENSE="OSS"
|
PKG_LICENSE="OSS"
|
||||||
PKG_SITE="http://www.X.org"
|
PKG_SITE="http://www.X.org"
|
||||||
PKG_URL="https://github.com/freedesktop/xorg-xserver/archive/refs/tags/${PKG_NAME}-${PKG_VERSION}.tar.gz"
|
PKG_URL="https://github.com/freedesktop/xorg-xserver/archive/refs/tags/${PKG_NAME}-${PKG_VERSION}.tar.gz"
|
||||||
|
@ -58,7 +58,6 @@ logger -t Xorg "### creating needed directories and symlinks ###"
|
|||||||
|
|
||||||
# Used to support GeForce 600 Series & newer
|
# Used to support GeForce 600 Series & newer
|
||||||
if [ "${1}" = "nvidia" ]; then
|
if [ "${1}" = "nvidia" ]; then
|
||||||
ln -sf /usr/lib/libGL_glvnd.so.1 /var/lib/libGL.so
|
|
||||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_nvidia.so /var/lib/libglx.so
|
ln -sf /usr/lib/xorg/modules/extensions/libglx_nvidia.so /var/lib/libglx.so
|
||||||
ln -sf /usr/lib/libnvidia-ml.so.@NVIDIA_VERSION@ /var/lib/libnvidia-ml.so.1
|
ln -sf /usr/lib/libnvidia-ml.so.@NVIDIA_VERSION@ /var/lib/libnvidia-ml.so.1
|
||||||
ln -sf /usr/lib/xorg/modules/drivers/nvidia-main_drv.so /var/lib/nvidia_drv.so
|
ln -sf /usr/lib/xorg/modules/drivers/nvidia-main_drv.so /var/lib/nvidia_drv.so
|
||||||
@ -68,6 +67,11 @@ logger -t Xorg "### creating needed directories and symlinks ###"
|
|||||||
ln -sf /usr/bin/nvidia-main-smi /var/lib/nvidia-smi
|
ln -sf /usr/bin/nvidia-main-smi /var/lib/nvidia-smi
|
||||||
ln -sf /usr/bin/nvidia-main-xconfig /var/lib/nvidia-xconfig
|
ln -sf /usr/bin/nvidia-main-xconfig /var/lib/nvidia-xconfig
|
||||||
insmod /var/lib/nvidia.ko
|
insmod /var/lib/nvidia.ko
|
||||||
|
# GL/GLX (GLVND)
|
||||||
|
ln -sf /usr/lib/libGL_glvnd.so.1 /var/lib/libGL.so
|
||||||
|
ln -sf /usr/lib/libGLX_glvnd.so.0 /var/lib/libGLX.so
|
||||||
|
# indirect rendering
|
||||||
|
ln -sf /usr/lib/libGLX_nvidia.so.0 /var/lib/libGLX_indirect.so.0
|
||||||
XORG_ARGS="${XORG_ARGS} -ignoreABI"
|
XORG_ARGS="${XORG_ARGS} -ignoreABI"
|
||||||
# Used to support GeForce 500 Series & older
|
# Used to support GeForce 500 Series & older
|
||||||
elif [ "${1}" = "nvidia-legacy" ]; then
|
elif [ "${1}" = "nvidia-legacy" ]; then
|
||||||
@ -81,11 +85,19 @@ logger -t Xorg "### creating needed directories and symlinks ###"
|
|||||||
ln -sf /usr/bin/nvidia-legacy-smi /var/lib/nvidia-smi
|
ln -sf /usr/bin/nvidia-legacy-smi /var/lib/nvidia-smi
|
||||||
ln -sf /usr/bin/nvidia-legacy-xconfig /var/lib/nvidia-xconfig
|
ln -sf /usr/bin/nvidia-legacy-xconfig /var/lib/nvidia-xconfig
|
||||||
insmod /var/lib/nvidia.ko
|
insmod /var/lib/nvidia.ko
|
||||||
|
# GLX (NON-GLVND)
|
||||||
|
ln -sf /usr/lib/libGL_nvidia-legacy.so.1 /var/lib/libGLX.so
|
||||||
|
# indirect rendering
|
||||||
|
ln -sf /usr/lib/libGL_nvidia-legacy.so.1 /var/lib/libGLX_indirect.so.0
|
||||||
XORG_ARGS="${XORG_ARGS} -ignoreABI"
|
XORG_ARGS="${XORG_ARGS} -ignoreABI"
|
||||||
# Used for AMD & Intel GPUs supported by MESA 3D
|
# Used for AMD & Intel GPUs supported by MESA 3D
|
||||||
else
|
else
|
||||||
ln -sf /usr/lib/libGL_glvnd.so.1 /var/lib/libGL.so
|
|
||||||
ln -sf /usr/lib/xorg/modules/extensions/libglx_mesa.so /var/lib/libglx.so
|
ln -sf /usr/lib/xorg/modules/extensions/libglx_mesa.so /var/lib/libglx.so
|
||||||
|
# GL/GLX (GLVND)
|
||||||
|
ln -sf /usr/lib/libGL_glvnd.so.1 /var/lib/libGL.so
|
||||||
|
ln -sf /usr/lib/libGLX_glvnd.so.0 /var/lib/libGLX.so
|
||||||
|
# indirect rendering
|
||||||
|
ln -sf /usr/lib/libGLX_mesa.so.0 /var/lib/libGLX_indirect.so.0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user