Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drm_mode_config_funcs.output_poll_changed got removed in 6.12-rc1 and will prevent compiling of the nvidia driver #708

Closed
1 task
philmmanjaro opened this issue Sep 21, 2024 · 8 comments
Labels
build-problem NV-Triaged An NVBug has been created for dev to investigate

Comments

@philmmanjaro
Copy link

NVIDIA Open GPU Kernel Modules Version

560.35.03 (open and propritary)

Operating System and Version

Manjaro Linux 24.1.0-pre1

Kernel Release

6.12 (1868f9d0260e9)

Please confirm you are running a stable release kernel (e.g. not a -rc). We do not accept bug reports for unreleased kernels.

  • I am running on a stable kernel release.

Build Command

make -C kernel SYSSRC=/usr/lib/modules/"${_kernver}/build" module

Terminal output/Build Log

build log: nvidia_202409211314.log

More Info

Drivers implementing fbdev emulation use drm_kms_helper_hotplug_event() to call this hook to inform the fbdev helper of output changes. This hook is deprecated, drivers should instead implement fbdev support with struct drm_client, which takes care of any necessary hotplug event forwarding already without further involvement by the driver.

@philmmanjaro
Copy link
Author

Also reported at the forum: https://forums.developer.nvidia.com/t/error-const-struct-drm-mode-config-funcs-has-no-member-named-output-poll-changed/306078. Having a fix in early development cycle of 6.12 would be the right move here.

@aritger
Copy link
Collaborator

aritger commented Sep 25, 2024

Thanks. We're aware of the issue, and a fix should be in a release shortly. You can refer to this as NVIDIA internal bug 4854525.

@ptr1337
Copy link

ptr1337 commented Sep 26, 2024

@philmmanjaro

From 94ad29389cd5129401adea6925f987f4529abb1c Mon Sep 17 00:00:00 2001
From: Peter Jung <[email protected]>
Date: Thu, 26 Sep 2024 14:53:31 +0200
Subject: [PATCH 5/5] 6.12: drm_outpull_pill changed check

---
 kernel/conftest.sh                      | 23 ++++++++++++++++++++
 kernel/nvidia-drm/nvidia-drm-drv.c      |  4 ++++
 kernel/nvidia-drm/nvidia-drm-sources.mk |  1 +
 3 files changed, 28 insertions(+)

diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 4a239e63..4d6fff64 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -6631,6 +6631,29 @@ compile_test() {
             compile_check_conftest "$CODE" "NV_DRM_FBDEV_TTM_SETUP_PRESENT" "" "functions"
         ;;
 
+        drm_output_poll_changed)
+            #
+            # Determine whether drm_mode_config_funcs.output_poll_changed
+            # callback is present
+            #
+            # Removed by commit 446d0f4849b1 ("drm: Remove struct
+            # drm_mode_config_funcs.output_poll_changed") in v6.12. Hotplug
+            # event support is handled through the fbdev emulation interface
+            # going forward.
+            #
+            CODE="
+            #if defined(NV_DRM_DRM_MODE_CONFIG_H_PRESENT)
+            #include <drm/drm_mode_config.h>
+            #else
+            #include <drm/drm_crtc.h>
+            #endif
+            int conftest_drm_output_poll_changed_available(void) {
+                return offsetof(struct drm_mode_config_funcs, output_poll_changed);
+            }"
+
+            compile_check_conftest "$CODE" "NV_DRM_OUTPUT_POLL_CHANGED_PRESENT" "" "types"
+         ;;
+
         drm_aperture_remove_conflicting_pci_framebuffers)
             #
             # Determine whether drm_aperture_remove_conflicting_pci_framebuffers is present.
diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
index 50028c26..034dda66 100644
--- a/kernel/nvidia-drm/nvidia-drm-drv.c
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
@@ -126,6 +126,7 @@ static const char* nv_get_input_colorspace_name(
 
 #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
 
+#if defined(NV_DRM_OUTPUT_POLL_CHANGED_PRESENT)
 static void nv_drm_output_poll_changed(struct drm_device *dev)
 {
     struct drm_connector *connector = NULL;
@@ -169,6 +170,7 @@ static void nv_drm_output_poll_changed(struct drm_device *dev)
     nv_drm_connector_list_iter_end(&conn_iter);
 #endif
 }
+#endif /* NV_DRM_OUTPUT_POLL_CHANGED_PRESENT */
 
 static struct drm_framebuffer *nv_drm_framebuffer_create(
     struct drm_device *dev,
@@ -206,7 +208,9 @@ static const struct drm_mode_config_funcs nv_mode_config_funcs = {
     .atomic_check  = nv_drm_atomic_check,
     .atomic_commit = nv_drm_atomic_commit,
 
+    #if defined(NV_DRM_OUTPUT_POLL_CHANGED_PRESENT)
     .output_poll_changed = nv_drm_output_poll_changed,
+    #endif
 };
 
 static void nv_drm_event_callback(const struct NvKmsKapiEvent *event)
diff --git a/kernel/nvidia-drm/nvidia-drm-sources.mk b/kernel/nvidia-drm/nvidia-drm-sources.mk
index 247096b7..f5964a57 100644
--- a/kernel/nvidia-drm/nvidia-drm-sources.mk
+++ b/kernel/nvidia-drm/nvidia-drm-sources.mk
@@ -131,3 +131,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_aperture_remove_conflicting_pci_framebuffe
 NV_CONFTEST_TYPE_COMPILE_TESTS += drm_mode_create_dp_colorspace_property_has_supported_colorspaces_arg
 NV_CONFTEST_TYPE_COMPILE_TESTS += drm_syncobj_features_present
 NV_CONFTEST_TYPE_COMPILE_TESTS += drm_unlocked_ioctl_flag_present
+NV_CONFTEST_TYPE_COMPILE_TESTS += drm_output_poll_changed
-- 
2.46.2

Can you check this patch? Has been extracted from the 550 driver.

@philmmanjaro
Copy link
Author

@ptr1337 applying that to all drivers, 390xx, 470xx and 560xx made it compile. For the older drivers I had to rewrite the 550xx patch a little. Thx for letting me know.

@ptr1337
Copy link

ptr1337 commented Sep 27, 2024

@ptr1337 applying that to all drivers, 390xx, 470xx and 560xx made it compile. For the older drivers I had to rewrite the 550xx patch a little. Thx for letting me know.

I think we can close this issue then, since its queued in 550.120 already, which is releated. The upcoming 560/565 should have it likely in

@philmmanjaro
Copy link
Author

Well, seems your issue #712 might be related to this one. Still have to get feedback if those drivers actually work ...

@joanbm
Copy link

joanbm commented Oct 1, 2024

At least for nvidia-470xx, just leaving out the .output_poll_changed member is insufficient, at the very least it makes the right modes not appear in /sys/class/drm/card*/modes, not sure if it actually breaks anything important. I have a workaround for it here which may be easy to port to the newer drivers.

@mtijanic
Copy link
Collaborator

This should now be fixed in all live driver branches, closing.

@mtijanic mtijanic added the NV-Triaged An NVBug has been created for dev to investigate label Oct 22, 2024
andersrh added a commit to CachyOS/copr-linux-cachyos that referenced this issue Nov 20, 2024
andersrh added a commit to CachyOS/copr-linux-cachyos that referenced this issue Nov 20, 2024
andersrh added a commit to CachyOS/copr-linux-cachyos that referenced this issue Nov 20, 2024
andersrh added a commit to CachyOS/copr-linux-cachyos that referenced this issue Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-problem NV-Triaged An NVBug has been created for dev to investigate
Projects
None yet
Development

No branches or pull requests

5 participants