-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nvidia-dkms: Fix compilation for 6.12 kernel
Signed-off-by: Eric Naim <[email protected]>
- Loading branch information
Showing
4 changed files
with
115 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
87 changes: 0 additions & 87 deletions
87
nvidia/nvidia-utils/0005-6.12-drm_outpull_pill-changed-check.patch
This file was deleted.
Oops, something went wrong.
108 changes: 108 additions & 0 deletions
108
nvidia/nvidia-utils/0006-Fix-for-6.12.0-rc1-drm_mode_config_funcs.output_poll.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,108 @@ | ||
From ae68c52742d420cc6b1dcd9cf93f436596a26687 Mon Sep 17 00:00:00 2001 | ||
From: Peter Jung <[email protected]> | ||
Date: Wed, 2 Oct 2024 15:48:32 +0200 | ||
Subject: [PATCH] Fix for 6.12.0-rc1 drm_mode_config_funcs.output_poll_changed | ||
removal | ||
|
||
Tentative fix for NVIDIA 560.35.03 driver for Linux 6.12-rc1. | ||
|
||
Based on https://gist.github.com/joanbm/a6d3f7f873a60dec0aa4a734c0f1d64e | ||
|
||
Signed-off-by: Peter Jung <[email protected]> | ||
--- | ||
kernel-open/nvidia-drm/nvidia-drm-drv.c | 48 +++++++++++++++++++++++++ | ||
1 file changed, 48 insertions(+) | ||
|
||
diff --git a/kernel-open/nvidia-drm/nvidia-drm-drv.c b/kernel-open/nvidia-drm/nvidia-drm-drv.c | ||
index 50028c26..d28b33a9 100644 | ||
--- a/kernel-open/nvidia-drm/nvidia-drm-drv.c | ||
+++ b/kernel-open/nvidia-drm/nvidia-drm-drv.c | ||
@@ -100,6 +100,11 @@ | ||
#include <drm/drm_atomic_helper.h> | ||
#endif | ||
|
||
+#include <linux/version.h> | ||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
+#include <drm/drm_client.h> | ||
+#endif | ||
+ | ||
static int nv_drm_revoke_modeset_permission(struct drm_device *dev, | ||
struct drm_file *filep, | ||
NvU32 dpyId); | ||
@@ -206,7 +211,13 @@ static const struct drm_mode_config_funcs nv_mode_config_funcs = { | ||
.atomic_check = nv_drm_atomic_check, | ||
.atomic_commit = nv_drm_atomic_commit, | ||
|
||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 12, 0) | ||
+ // Rel. commit. "drm: Remove struct | ||
+ // drm_mode_config_funcs.output_poll_changed" (Thomas Zimmermann, 12 Aug | ||
+ // 2024) Replace this callback with a DRM client's hotplug callback. | ||
+ // This is required for e.g. /sys/class/drm/card*/modes to work. | ||
.output_poll_changed = nv_drm_output_poll_changed, | ||
+#endif | ||
}; | ||
|
||
static void nv_drm_event_callback(const struct NvKmsKapiEvent *event) | ||
@@ -1569,6 +1580,10 @@ static const struct file_operations nv_drm_fops = { | ||
.read = drm_read, | ||
|
||
.llseek = noop_llseek, | ||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
+ // Rel. commit. "fs: move FMODE_UNSIGNED_OFFSET to fop_flags" (Christian Brauner, 9 Aug 2024) | ||
+ .fop_flags = FOP_UNSIGNED_OFFSET, | ||
+#endif | ||
}; | ||
|
||
static const struct drm_ioctl_desc nv_drm_ioctls[] = { | ||
@@ -1777,6 +1792,20 @@ void nv_drm_update_drm_driver_features(void) | ||
} | ||
|
||
|
||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
+static int hotplug_helper_client_hotplug(struct drm_client_dev *client) | ||
+{ | ||
+ nv_drm_output_poll_changed(client->dev); | ||
+ return 0; | ||
+} | ||
+ | ||
+static const struct drm_client_funcs nv_hotplug_helper_client_funcs = { | ||
+ .owner = THIS_MODULE, | ||
+ .hotplug = hotplug_helper_client_hotplug, | ||
+}; | ||
+#endif | ||
+ | ||
+ | ||
|
||
/* | ||
* Helper function for allocate/register DRM device for given NVIDIA GPU ID. | ||
@@ -1866,8 +1895,27 @@ void nv_drm_register_drm_device(const nv_gpu_info_t *gpu_info) | ||
nv_dev->next = dev_list; | ||
dev_list = nv_dev; | ||
|
||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
+ /* Register a DRM client for receiving hotplug events */ | ||
+ struct drm_client_dev *client = kzalloc(sizeof(*client), GFP_KERNEL); | ||
+ if (client == NULL || drm_client_init(dev, client, | ||
+ "nv-hotplug-helper", &nv_hotplug_helper_client_funcs)) { | ||
+ printk(KERN_WARNING "Failed to initialize the nv-hotplug-helper DRM client."); | ||
+ goto failed_drm_client_init; | ||
+ } | ||
+ | ||
+ drm_client_register(client); | ||
+ pr_info("Registered the nv-hotplug-helper DRM client."); | ||
+#endif | ||
+ | ||
return; /* Success */ | ||
|
||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 12, 0) | ||
+failed_drm_client_init: | ||
+ | ||
+ kfree(client); | ||
+#endif | ||
+ | ||
failed_drm_register: | ||
|
||
nv_drm_dev_free(dev); | ||
-- | ||
2.47.0.rc0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters