]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia-legacy-390xx.git/blob - kenrel-6.2.patch
- fix building with kernel 6.2
[packages/xorg-driver-video-nvidia-legacy-390xx.git] / kenrel-6.2.patch
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
3 @@ -847,6 +847,24 @@
4  
5              acpi_op_remove conftest_op_remove_routine;
6  
7 +            void conftest_acpi_device_ops_remove(struct acpi_device *device) {
8 +                conftest_op_remove_routine(device);
9 +            }" > conftest$$.c
10 +
11 +            $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
12 +            rm -f conftest$$.c
13 +
14 +            if [ -f conftest$$.o ]; then
15 +                rm -f conftest$$.o
16 +                echo "#define NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT_VOID 1" | append_conftest "types"
17 +                return
18 +            fi
19 +
20 +            echo "$CONFTEST_PREAMBLE
21 +            #include <linux/acpi.h>
22 +
23 +            acpi_op_remove conftest_op_remove_routine;
24 +
25              int conftest_acpi_device_ops_remove(struct acpi_device *device) {
26                  return conftest_op_remove_routine(device);
27              }" > conftest$$.c
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
30 @@ -23,7 +23,9 @@
31  
32  static int         nv_acpi_add             (struct acpi_device *);
33  
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);
39  #else
40  static int         nv_acpi_remove_one_arg(struct acpi_device *device);
41 @@ -73,7 +75,9 @@
42  #endif
43      .ops = {
44          .add = nv_acpi_add,
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,
50  #else
51          .remove = nv_acpi_remove_one_arg,
52 @@ -331,7 +335,9 @@
53      return 0;
54  }
55  
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)
61  #else
62  static int nv_acpi_remove_one_arg(struct acpi_device *device)
63 @@ -385,7 +391,9 @@
64          device->driver_data = NULL;
65      }
66  
67 +#if !defined(NV_ACPI_DEVICE_OPS_REMOVE_ARGUMENT_COUNT_VOID)
68      return status;
69 +#endif
70  }
71  
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
75 @@ -60,6 +60,7 @@
76  #endif
77  
78  #include <linux/pci.h>
79 +#include <linux/version.h>
80  
81  /*
82   * Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
83 @@ -240,9 +240,9 @@
84      dev->mode_config.prefer_shadow = 1;
85  
86      /* Currently unused. Update when needed. */
87 -
88 +#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0)
89      dev->mode_config.fb_base = 0;
90 -
91 +#endif
92      dev->mode_config.async_page_flip = false;
93  
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
97 @@ -43,6 +43,8 @@
98  #include <drm/drm_atomic.h>
99  #include <drm/drm_atomic_helper.h>
100  
101 +#include <linux/version.h>
102 +
103  static void nv_drm_connector_destroy(struct drm_connector *connector)
104  {
105      struct nv_drm_connector *nv_connector = to_nv_connector(connector);
106 @@ -98,6 +100,7 @@
107              break;
108      }
109  
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;
113  
114 @@ -110,6 +113,7 @@
115                      sizeof(pDetectParams->edid.buffer));
116          }
117      }
118 +#endif
119  
120      if (!nvKms->getDynamicDisplayInfo(nv_dev->pDevice, pDetectParams)) {
121          NV_DRM_DEV_LOG_ERR(
This page took 0.120808 seconds and 4 git commands to generate.