1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
drm: Remove struct drm_mode_config_funcs.output_poll_changed
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=446d0f4849b101bfc35c0d00835c3e3a4804616d
Patch found here:
https://github.com/NVIDIA/open-gpu-kernel-modules/issues/708#issuecomment-2377038258
Altered somewhat to work with 525.147.05
diff --git a/conftest.sh b/conftest.sh
index d24d308..d1a51b0 100755
--- a/conftest.sh
+++ b/conftest.sh
@@ -5770,6 +5770,29 @@ compile_test() {
echo "Error: unknown conftest '$1' requested" >&2
exit 1
;;
+
+ 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"
+ ;;
esac
}
diff --git a/nvidia-drm/nvidia-drm-drv.c b/nvidia-drm/nvidia-drm-drv.c
index 50028c26..034dda66 100644
--- a/nvidia-drm/nvidia-drm-drv.c
+++ b/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)
|