Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BtbN/9089275 to your computer and use it in GitHub Desktop.
Save BtbN/9089275 to your computer and use it in GitHub Desktop.
/etc/portage/patches/x11-drivers/nvidia-drivers-334.16/kernel313.patch
diff -Naur work.orig/kernel/nv-linux.h work/kernel/nv-linux.h
--- work.orig/kernel/nv-linux.h 2014-02-12 16:10:19.316850127 +0100
+++ work/kernel/nv-linux.h 2014-02-12 16:21:56.236508230 +0100
@@ -273,7 +273,11 @@
#endif
#if !defined(NV_VMWARE) && defined(CONFIG_ACPI)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
#include <acpi/acpi.h>
+#else
+#include <linux/acpi.h>
+#endif
#include <acpi/acpi_drivers.h>
#if defined(NV_ACPI_DEVICE_OPS_HAS_MATCH) || defined(ACPI_VIDEO_HID)
#define NV_LINUX_ACPI_EVENTS_SUPPORTED 1
@@ -308,6 +312,7 @@
#endif
#if defined(NV_LINUX_ACPI_EVENTS_SUPPORTED)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
#if (NV_ACPI_OS_WAIT_EVENTS_COMPLETE_ARGUMENT_COUNT == 1)
#define NV_ACPI_OS_WAIT_EVENTS_COMPLETE() \
acpi_os_wait_events_complete(NULL)
@@ -317,6 +322,10 @@
#else
#error "NV_ACPI_OS_WAIT_EVENTS_COMPLETE_ARGUMENT_COUNT value unrecognized!"
#endif
+#else
+/* starting with 3.13 acpi_remove_notify_handler() waits for events to finish */
+#define NV_ACPI_OS_WAIT_EVENTS_COMPLETE() do { } while (0)
+#endif
#endif
#if defined(CONFIG_PREEMPT_RT) || defined(CONFIG_PREEMPT_RT_FULL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment