1 --- NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/conftest.sh~ 2022-10-11 18:00:50.000000000 +0200
2 +++ NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/conftest.sh 2023-02-25 14:19:47.560962975 +0100
5 acpi_op_remove conftest_op_remove_routine;
7 + void conftest_acpi_device_ops_remove(struct acpi_device *device) {
8 + conftest_op_remove_routine(device);
11 + $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
14 + if [ -f conftest$$.o ]; then
16 + echo "#define NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT_VOID 1" | append_conftest "types"
20 + echo "$CONFTEST_PREAMBLE
21 + #include <linux/acpi.h>
23 + acpi_op_remove conftest_op_remove_routine;
25 int conftest_acpi_device_ops_remove(struct acpi_device *device) {
26 return conftest_op_remove_routine(device);
28 --- NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia/nv-acpi.c.orig 2022-10-12 11:30:26.000000000 +0200
29 +++ NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia/nv-acpi.c 2023-02-25 14:32:19.579118091 +0100
32 static int nv_acpi_add (struct acpi_device *);
34 -#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
35 +#if defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT_VOID)
36 +static void nv_acpi_remove_one_arg_void(struct acpi_device *device);
37 +#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
38 static int nv_acpi_remove_two_args(struct acpi_device *device, int type);
40 static int nv_acpi_remove_one_arg(struct acpi_device *device);
45 -#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
46 +#if defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT_VOID)
47 + .remove = nv_acpi_remove_one_arg_void,
48 +#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
49 .remove = nv_acpi_remove_two_args,
51 .remove = nv_acpi_remove_one_arg,
56 -#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
57 +#if defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT_VOID)
58 +static void nv_acpi_remove_one_arg_void(struct acpi_device *device)
59 +#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
60 static int nv_acpi_remove_two_args(struct acpi_device *device, int type)
62 static int nv_acpi_remove_one_arg(struct acpi_device *device)
64 device->driver_data = NULL;
67 +#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT_VOID)
72 static void nv_acpi_event(acpi_handle handle, u32 event_type, void *data)
73 --- NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c~ 2022-10-12 11:30:31.000000000 +0200
74 +++ NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c 2023-02-25 14:36:54.064187922 +0100
78 #include <linux/pci.h>
79 +#include <linux/version.h>
82 * Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
84 dev->mode_config.prefer_shadow = 1;
86 /* Currently unused. Update when needed. */
88 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
89 dev->mode_config.fb_base = 0;
92 dev->mode_config.async_page_flip = false;
94 /* Initialize output polling support */
95 --- NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia-drm/nvidia-drm-connector.c.orig 2022-10-12 11:30:31.000000000 +0200
96 +++ NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia-drm/nvidia-drm-connector.c 2023-02-25 14:44:30.759596334 +0100
98 #include <drm/drm_atomic.h>
99 #include <drm/drm_atomic_helper.h>
101 +#include <linux/version.h>
103 static void nv_drm_connector_destroy(struct drm_connector *connector)
105 struct nv_drm_connector *nv_connector = to_nv_connector(connector);
110 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
111 if (connector->override_edid) {
112 const struct drm_property_blob *edid = connector->edid_blob_ptr;
115 sizeof(pDetectParams->edid.buffer));
120 if (!nvKms->getDynamicDisplayInfo(nv_dev->pDevice, pDetectParams)) {