summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Bidar2020-04-09 00:03:40 +0200
committerBjörn Bidar2020-04-09 00:08:47 +0200
commit81c325bb3b32a55856e00b327bea1bd7910081ee (patch)
tree752e410eb5147b8bf128e198f84ba40c15029b5b
parent72a5555baf25b540aae0522070c9ed3926389deb (diff)
downloadaur-81c325bb3b32a55856e00b327bea1bd7910081ee.tar.gz
urel
- Fix for building against 5.6 - Change good/bad kernel to 5.6/5.7 - Rebuild for new kernel release
-rw-r--r--.SRCINFO12
-rw-r--r--0001-proc_ops-struct.patch36
-rw-r--r--PKGBUILD10
-rw-r--r--linux_4.17_vgaswitch.patch65
4 files changed, 47 insertions, 76 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 12ba9c5c8b38..f22143bc9041 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,20 +1,20 @@
# Generated by mksrcinfo v8
-# Sat Jan 25 17:10:58 UTC 2020
+# Wed Apr 8 22:08:27 UTC 2020
pkgbase = bbswitch-pf
pkgdesc = Kernel module allowing to switch dedicated graphics card on Optimus laptops
pkgver = 0.8
- pkgrel = 96
+ pkgrel = 97
url = http://github.com/Bumblebee-Project/bbswitch
arch = i686
arch = x86_64
license = GPL
makedepends = linux-pf-headers
- depends = linux-pf>=5.4
- depends = linux-pf<5.5
+ depends = linux-pf>=5.6
+ depends = linux-pf<5.7
source = git+https://github.com/Bumblebee-Project/bbswitch.git
- source = linux_4.17_vgaswitch.patch
+ source = 0001-proc_ops-struct.patch
md5sums = SKIP
- md5sums = b0a672ecba5dadf7922a363a7a9960ba
+ md5sums = 2777876d45c986119286acffb18c58a7
pkgname = bbswitch-pf
diff --git a/0001-proc_ops-struct.patch b/0001-proc_ops-struct.patch
new file mode 100644
index 000000000000..c2b823ba00d9
--- /dev/null
+++ b/0001-proc_ops-struct.patch
@@ -0,0 +1,36 @@
+diff --unified --recursive --text bbswitch-0.8.orig/bbswitch.c bbswitch-0.8.new/bbswitch.c
+--- bbswitch-0.8.orig/bbswitch.c 2013-12-04 21:22:06.000000000 -0200
++++ bbswitch-0.8.new/bbswitch.c 2020-04-01 12:02:35.518754892 -0300
+@@ -35,6 +35,7 @@
+ #include <linux/suspend.h>
+ #include <linux/seq_file.h>
+ #include <linux/pm_runtime.h>
++#include <linux/version.h>
+
+ #define BBSWITCH_VERSION "0.8"
+
+@@ -375,13 +376,23 @@
+ return 0;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0)
++static struct proc_ops bbswitch_fops = {
++ .proc_open = bbswitch_proc_open,
++ .proc_read = seq_read,
++ .proc_write = bbswitch_proc_write,
++ .proc_lseek = seq_lseek,
++ .proc_release= single_release
++};
++#else
+ static struct file_operations bbswitch_fops = {
+ .open = bbswitch_proc_open,
+ .read = seq_read,
+ .write = bbswitch_proc_write,
+ .llseek = seq_lseek,
+ .release= single_release
+-};
++ };
++#endif
+
+ static struct notifier_block nb = {
+ .notifier_call = &bbswitch_pm_handler
diff --git a/PKGBUILD b/PKGBUILD
index 70b8ad92e19d..1c67235efee4 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -5,11 +5,11 @@
pkgname=bbswitch-pf
_pkgname=bbswitch
-_godver=5.4
-_badver=5.5
+_godver=5.6
+_badver=5.7
pkgver=0.8
_extramodules=extramodules-$_godver-pf # Don't forget to update bbswitch.install
-pkgrel=96
+pkgrel=97
pkgdesc="Kernel module allowing to switch dedicated graphics card on Optimus laptops"
arch=('i686' 'x86_64')
url="http://github.com/Bumblebee-Project/bbswitch"
@@ -17,9 +17,9 @@ license=('GPL')
depends=("linux-pf>=$_godver" "linux-pf<$_badver")
makedepends=("linux-pf-headers")
source=(git+https://github.com/Bumblebee-Project/bbswitch.git
- 'linux_4.17_vgaswitch.patch')
+ '0001-proc_ops-struct.patch')
md5sums=('SKIP'
- 'b0a672ecba5dadf7922a363a7a9960ba')
+ '2777876d45c986119286acffb18c58a7')
prepare()
{
diff --git a/linux_4.17_vgaswitch.patch b/linux_4.17_vgaswitch.patch
deleted file mode 100644
index ad54c9159e19..000000000000
--- a/linux_4.17_vgaswitch.patch
+++ /dev/null
@@ -1,65 +0,0 @@
---- a/bbswitch.c 2018-07-21 21:51:36.039044960 +0200
-+++ b/bbswitch.c 2018-07-21 21:56:29.706612678 +0200
-@@ -34,6 +34,7 @@
- #include <asm/uaccess.h>
- #include <linux/suspend.h>
- #include <linux/seq_file.h>
-+#include <drm/drmP.h>
- #include <linux/pm_runtime.h>
- #include <linux/pm_domain.h>
- #include <linux/vga_switcheroo.h>
-@@ -288,17 +289,25 @@
- static int bbswitch_pci_runtime_suspend(struct device *dev)
- {
- struct pci_dev *pdev = to_pci_dev(dev);
--
-+ struct drm_device *drm_dev = pci_get_drvdata(pdev);
-+
- pr_info("disabling discrete graphics\n");
-
-- /* Ensure that the audio driver knows not to touch us. */
-- vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_OFF);
-
-+ drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
-+
-+
- bbswitch_optimus_dsm();
-
- /* Save state now that the device is still awake, makes PCI layer happy */
- pci_save_state(pdev);
-- /* TODO if _PR3 is supported, should this be PCI_D3hot? */
-+ pci_disable_device(pdev);
-+ pci_ignore_hotplug(pdev);
-+
-+
-+ /* Ensure that the audio driver knows not to touch us. */
-+ drm_dev->switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF;
-+ /* TODO if _PR3 is supported, should this be PCI_D3hot? */
- pci_set_power_state(pdev, PCI_D3hot);
- return 0;
- }
-@@ -306,11 +315,22 @@
- static int bbswitch_pci_runtime_resume(struct device *dev)
- {
- struct pci_dev *pdev = to_pci_dev(dev);
--
-+ struct drm_device *drm_dev = pci_get_drvdata(pdev);
-+ int ret;
- pr_debug("Finishing runtime resume.\n");
-
-+ pci_restore_state(pdev);
-+ ret = pci_enable_device(pdev);
-+ if (ret)
-+ return ret;
-+
-+ pci_set_master(pdev);
-+
-+
-+ // drm_kms_helper_poll_enable(drm_dev);
- /* Resume audio driver. */
-- vga_switcheroo_set_dynamic_switch(pdev, VGA_SWITCHEROO_ON);
-+ drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
-+
- return 0;
- }
-