1 --- NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia/nv-acpi.c.orig 2022-10-12 11:30:26.000000000 +0200
2 +++ NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia/nv-acpi.c 2023-02-25 14:32:19.579118091 +0100
5 static int nv_acpi_add (struct acpi_device *);
7 -#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
8 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
9 +static void nv_acpi_remove_one_arg_void(struct acpi_device *device);
10 +#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
11 static int nv_acpi_remove_two_args(struct acpi_device *device, int type);
13 static int nv_acpi_remove_one_arg(struct acpi_device *device);
18 -#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
19 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
20 + .remove = nv_acpi_remove_one_arg_void,
21 +#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
22 .remove = nv_acpi_remove_two_args,
24 .remove = nv_acpi_remove_one_arg,
29 -#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
30 +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0)
31 +static void nv_acpi_remove_one_arg_void(struct acpi_device *device)
32 +#elif !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT) || (NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT == 2)
33 static int nv_acpi_remove_two_args(struct acpi_device *device, int type)
35 static int nv_acpi_remove_one_arg(struct acpi_device *device)
37 device->driver_data = NULL;
40 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
45 static void nv_acpi_event(acpi_handle handle, u32 event_type, void *data)
46 --- NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c~ 2022-10-12 11:30:31.000000000 +0200
47 +++ NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c 2023-02-25 14:36:54.064187922 +0100
51 #include <linux/pci.h>
52 +#include <linux/version.h>
55 * Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
57 dev->mode_config.prefer_shadow = 1;
59 /* Currently unused. Update when needed. */
61 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
62 dev->mode_config.fb_base = 0;
65 dev->mode_config.async_page_flip = false;
67 /* Initialize output polling support */
68 --- NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia-drm/nvidia-drm-connector.c.orig 2022-10-12 11:30:31.000000000 +0200
69 +++ NVIDIA-Linux-x86_64-390.157-no-compat32/kernel/nvidia-drm/nvidia-drm-connector.c 2023-02-25 14:44:30.759596334 +0100
71 #include <drm/drm_atomic.h>
72 #include <drm/drm_atomic_helper.h>
74 +#include <linux/version.h>
76 static void nv_drm_connector_destroy(struct drm_connector *connector)
78 struct nv_drm_connector *nv_connector = to_nv_connector(connector);
83 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
84 if (connector->override_edid) {
85 const struct drm_property_blob *edid = connector->edid_blob_ptr;
88 sizeof(pDetectParams->edid.buffer));
93 if (!nvKms->getDynamicDisplayInfo(nv_dev->pDevice, pDetectParams)) {