mirror of
https://github.com/archlinux/aur.git
synced 2026-03-14 23:16:48 +01:00
Add kernel-6.2.patch from Joan Bruguera via Ike Devolder
This commit is contained in:
parent
6e941f4279
commit
36ce5f92aa
3 changed files with 154 additions and 2 deletions
4
.SRCINFO
4
.SRCINFO
|
|
@ -1,6 +1,6 @@
|
|||
pkgbase = nvidia-390xx-utils
|
||||
pkgver = 390.157
|
||||
pkgrel = 2
|
||||
pkgrel = 3
|
||||
url = https://www.nvidia.com/
|
||||
arch = x86_64
|
||||
license = custom
|
||||
|
|
@ -9,11 +9,13 @@ pkgbase = nvidia-390xx-utils
|
|||
source = nvidia-390xx-utils.sysusers
|
||||
source = nvidia-390xx.rules
|
||||
source = https://us.download.nvidia.com/XFree86/Linux-x86_64/390.157/NVIDIA-Linux-x86_64-390.157.run
|
||||
source = kernel-6.2.patch
|
||||
source = kernel-4.16+-memory-encryption.patch
|
||||
b2sums = 8e24aea70b139185bd682b080d32aeda673e6e92b45a90e6f6e0d736674180400bc8bd1aa5c66b8d033fc9d5e0cfffed456a87298bd93a3afbbc30b8dc48c4e9
|
||||
b2sums = c1da4ce5784e43385465913a95053a3e54f800aac6f1b49f33e2a77504d76da5e6db6ec7074fbe7ba5f52dcef9e1ebaa620942c33ff825a56caba5c9c8b0d1be
|
||||
b2sums = 67e32932eeddda8fef667d25c34faf7b3a02f01cf9c15a97e5613bd44a0e8dcf7396e25399a52701f55dd18054c689720f237bb07d5bd580394d8dc8c9d05534
|
||||
b2sums = 44b855cd11f3b2f231f9fb90492ae2e67a67ea3ea83c413e7c90956d38c9730a8bd0321281ae03c6afce633d102f5b499aed25622b9bfd31bdd2c98f0717e95b
|
||||
b2sums = 6d22365464db63431cf432ba576f6bfb56dc9a63f760b154602a27620462f1873dd6609bf28d045dd922d8a16bbd902a4a0dd0e94897f43ea1a090cf3585693e
|
||||
b2sums = a8234f542c2324ad698443e3decf7b6eacf3cb420b7aded787f102a8d32b64c2a8d45ea58e37a5e3b6f2f060f0cccd63d3a182065f57c606006d0ff8c7f6bb05
|
||||
|
||||
pkgname = nvidia-390xx-utils
|
||||
|
|
|
|||
7
PKGBUILD
7
PKGBUILD
|
|
@ -8,7 +8,7 @@
|
|||
pkgbase=nvidia-390xx-utils
|
||||
pkgname=('nvidia-390xx-utils' 'opencl-nvidia-390xx' 'nvidia-390xx-dkms')
|
||||
pkgver=390.157
|
||||
pkgrel=2
|
||||
pkgrel=3
|
||||
arch=('x86_64')
|
||||
url="https://www.nvidia.com/"
|
||||
license=('custom')
|
||||
|
|
@ -18,11 +18,13 @@ source=('nvidia-drm-outputclass.conf'
|
|||
'nvidia-390xx-utils.sysusers'
|
||||
'nvidia-390xx.rules'
|
||||
"https://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/${_pkg}.run"
|
||||
kernel-6.2.patch
|
||||
kernel-4.16+-memory-encryption.patch)
|
||||
b2sums=('8e24aea70b139185bd682b080d32aeda673e6e92b45a90e6f6e0d736674180400bc8bd1aa5c66b8d033fc9d5e0cfffed456a87298bd93a3afbbc30b8dc48c4e9'
|
||||
'c1da4ce5784e43385465913a95053a3e54f800aac6f1b49f33e2a77504d76da5e6db6ec7074fbe7ba5f52dcef9e1ebaa620942c33ff825a56caba5c9c8b0d1be'
|
||||
'67e32932eeddda8fef667d25c34faf7b3a02f01cf9c15a97e5613bd44a0e8dcf7396e25399a52701f55dd18054c689720f237bb07d5bd580394d8dc8c9d05534'
|
||||
'44b855cd11f3b2f231f9fb90492ae2e67a67ea3ea83c413e7c90956d38c9730a8bd0321281ae03c6afce633d102f5b499aed25622b9bfd31bdd2c98f0717e95b'
|
||||
'6d22365464db63431cf432ba576f6bfb56dc9a63f760b154602a27620462f1873dd6609bf28d045dd922d8a16bbd902a4a0dd0e94897f43ea1a090cf3585693e'
|
||||
'a8234f542c2324ad698443e3decf7b6eacf3cb420b7aded787f102a8d32b64c2a8d45ea58e37a5e3b6f2f060f0cccd63d3a182065f57c606006d0ff8c7f6bb05')
|
||||
|
||||
create_links() {
|
||||
|
|
@ -46,6 +48,9 @@ prepare() {
|
|||
# From loqs via https://bugs.archlinux.org/task/58074
|
||||
patch -Np1 -i ../kernel-4.16+-memory-encryption.patch
|
||||
|
||||
# From Joan Bruguera via Ike Devolder
|
||||
patch -Np1 -i ../kernel-6.2.patch
|
||||
|
||||
cd kernel
|
||||
sed -i "s/__VERSION_STRING/${pkgver}/" dkms.conf
|
||||
sed -i 's/__JOBS/`nproc`/' dkms.conf
|
||||
|
|
|
|||
145
kernel-6.2.patch
Normal file
145
kernel-6.2.patch
Normal file
|
|
@ -0,0 +1,145 @@
|
|||
From 5db7eb5a62003bbe04f3f07d089fcf5445b34a29 Mon Sep 17 00:00:00 2001
|
||||
From: Joan Bruguera <joanbrugueram@gmail.com>
|
||||
Date: Sun, 25 Dec 2022 22:05:14 +0000
|
||||
Subject: [PATCH] Tentative fix for NVIDIA 470.161.03 driver for Linux 6.2-rc1
|
||||
|
||||
---
|
||||
nvidia-drm/nvidia-drm-connector.c | 22 ++++++++++++++++++++++
|
||||
nvidia-drm/nvidia-drm-drv.c | 4 ++++
|
||||
nvidia/nv-acpi.c | 19 ++++++++++++++++---
|
||||
3 files changed, 42 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/nvidia-drm/nvidia-drm-connector.c b/nvidia-drm/nvidia-drm-connector.c
|
||||
index 6fbcd63..a5ab9e9 100644
|
||||
--- a/nvidia-drm/nvidia-drm-connector.c
|
||||
+++ b/nvidia-drm/nvidia-drm-connector.c
|
||||
@@ -20,6 +20,8 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#include <drm/drm_edid.h>
|
||||
#include "nvidia-drm-conftest.h" /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
|
||||
|
||||
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
|
||||
@@ -98,6 +100,7 @@ __nv_drm_detect_encoder(struct NvKmsKapiDynamicDisplayParams *pDetectParams,
|
||||
break;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
|
||||
if (connector->override_edid) {
|
||||
const struct drm_property_blob *edid = connector->edid_blob_ptr;
|
||||
|
||||
@@ -110,6 +113,25 @@ __nv_drm_detect_encoder(struct NvKmsKapiDynamicDisplayParams *pDetectParams,
|
||||
sizeof(pDetectParams->edid.buffer));
|
||||
}
|
||||
}
|
||||
+#else
|
||||
+ // Rel. commit "drm/edid: detach debugfs EDID override from EDID property update" (Jani Nikula, 24 Oct 2022)
|
||||
+ // NOTE: HUGE HACK!
|
||||
+ mutex_lock(&connector->edid_override_mutex);
|
||||
+ if (connector->edid_override) {
|
||||
+ const struct edid *edid = drm_edid_raw(connector->edid_override);
|
||||
+ size_t edid_length = EDID_LENGTH * (edid->extensions + 1);
|
||||
+ if (edid_length <= sizeof(pDetectParams->edid.buffer)) {
|
||||
+ memcpy(pDetectParams->edid.buffer, edid, edid_length);
|
||||
+ pDetectParams->edid.bufferSize = edid_length;
|
||||
+ pDetectParams->overrideEdid = NV_TRUE;
|
||||
+ } else {
|
||||
+ WARN_ON(edid_length >
|
||||
+ sizeof(pDetectParams->edid.buffer));
|
||||
+ }
|
||||
+ }
|
||||
+ mutex_unlock(&connector->edid_override_mutex);
|
||||
+
|
||||
+#endif
|
||||
|
||||
if (!nvKms->getDynamicDisplayInfo(nv_dev->pDevice, pDetectParams)) {
|
||||
NV_DRM_DEV_LOG_ERR(
|
||||
diff --git a/nvidia-drm/nvidia-drm-drv.c b/nvidia-drm/nvidia-drm-drv.c
|
||||
index 6d007b1..d08ab4c 100644
|
||||
--- a/nvidia-drm/nvidia-drm-drv.c
|
||||
+++ b/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"
|
||||
@@ -240,9 +241,12 @@ nv_drm_init_mode_config(struct nv_drm_device *nv_dev,
|
||||
dev->mode_config.preferred_depth = 24;
|
||||
dev->mode_config.prefer_shadow = 1;
|
||||
|
||||
+// Rel. commit "drm: Remove drm_mode_config::fb_base" (Zack Rusin, 18 Oct 2022)
|
||||
+#if defined(CONFIG_FB) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
|
||||
/* Currently unused. Update when needed. */
|
||||
|
||||
dev->mode_config.fb_base = 0;
|
||||
+#endif
|
||||
|
||||
#if defined(NV_DRM_CRTC_STATE_HAS_ASYNC_FLIP) || \
|
||||
defined(NV_DRM_CRTC_STATE_HAS_PAGEFLIP_FLAGS)
|
||||
diff --git a/nvidia/nv-acpi.c b/nvidia/nv-acpi.c
|
||||
index 07501eb..1fdf71c 100644
|
||||
--- a/nvidia/nv-acpi.c
|
||||
+++ b/nvidia/nv-acpi.c
|
||||
@@ -8,6 +8,7 @@
|
||||
* _NVRM_COPYRIGHT_END_
|
||||
*/
|
||||
|
||||
+#include <linux/version.h>
|
||||
#define __NO_VERSION__
|
||||
|
||||
#include "os-interface.h"
|
||||
@@ -24,7 +25,10 @@ static NV_STATUS nv_acpi_extract_object (const union acpi_object *, void *, N
|
||||
|
||||
static int nv_acpi_add (struct acpi_device *);
|
||||
|
||||
-#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
|
||||
+// Rel. commit "ACPI: make remove callback of ACPI driver void" (Dawei Li, 14 Nov 2022)
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0))
|
||||
+static void nv_acpi_remove_one_arg_void(struct acpi_device *device);
|
||||
+#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
|
||||
static int nv_acpi_remove_two_args(struct acpi_device *device, int type);
|
||||
#else
|
||||
static int nv_acpi_remove_one_arg(struct acpi_device *device);
|
||||
@@ -80,7 +84,10 @@ static const struct acpi_driver nv_acpi_driver_template = {
|
||||
.ids = nv_video_device_ids,
|
||||
.ops = {
|
||||
.add = nv_acpi_add,
|
||||
-#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
|
||||
+// Rel. commit "ACPI: make remove callback of ACPI driver void" (Dawei Li, 14 Nov 2022)
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0))
|
||||
+ .remove = nv_acpi_remove_one_arg_void,
|
||||
+#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
|
||||
.remove = nv_acpi_remove_two_args,
|
||||
#else
|
||||
.remove = nv_acpi_remove_one_arg,
|
||||
@@ -342,7 +349,10 @@ static int nv_acpi_add(struct acpi_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
-#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
|
||||
+// Rel. commit "ACPI: make remove callback of ACPI driver void" (Dawei Li, 14 Nov 2022)
|
||||
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0))
|
||||
+static void nv_acpi_remove_one_arg_void(struct acpi_device *device)
|
||||
+#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
|
||||
static int nv_acpi_remove_two_args(struct acpi_device *device, int type)
|
||||
#else
|
||||
static int nv_acpi_remove_one_arg(struct acpi_device *device)
|
||||
@@ -396,7 +406,10 @@ static int nv_acpi_remove_one_arg(struct acpi_device *device)
|
||||
device->driver_data = NULL;
|
||||
}
|
||||
|
||||
+// Rel. commit "ACPI: make remove callback of ACPI driver void" (Dawei Li, 14 Nov 2022)
|
||||
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0))
|
||||
return status;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/*
|
||||
--
|
||||
2.39.0
|
||||
|
||||
Loading…
Add table
Reference in a new issue